Back to Website
Show / Hide Table of Contents

Class ContentItemHandler

Inheritance
ItemHandler
BaseRectangleItemHandler
ShapeItemHandler
RectangleItemHandler
ContentItemHandler
Package: @aurigma/design-atoms

Constructors

(constructor)(item, textWhizz, apiClient, colorPreviewService, options)

Constructs a new instance of the ContentItemHandler class

Declaration
constructor(item?: ContentItem, textWhizz?: typeof TextWhizz, apiClient?: IDesignAtomsApiClient, colorPreviewService?: IListenableColorPreviewService, options?: IPlaceholderHandlerOptions);
Parameters
Type Name Description
ContentItem item
typeof TextWhizz textWhizz
IDesignAtomsApiClient apiClient
IListenableColorPreviewService colorPreviewService
IPlaceholderHandlerOptions options

Properties

_copperHandler

Declaration
protected _copperHandler?: ImageCropperHandler;
Property Value
Type Description
ImageCropperHandler

_fitModeType

Declaration
protected _fitModeType: PlaceholderFitModeType;
Property Value
Type Description
PlaceholderFitModeType

_imageContainer

Declaration
protected readonly _imageContainer: ImageContainer;
Property Value
Type Description
ImageContainer

_isCropMode

Declaration
protected _isCropMode: boolean;
Property Value
Type Description
boolean

_needToDownloadImage

Declaration
protected _needToDownloadImage: boolean;
Property Value
Type Description
boolean

_pixelHeight

Declaration
protected _pixelHeight: number;
Property Value
Type Description
number

_pixelWidth

Declaration
protected _pixelWidth: number;
Property Value
Type Description
number

contentType

Declaration
get contentType(): ContentType;

set contentType(value: ContentType);
Property Value
Type Description
ContentType

inEdit

Declaration
get inEdit(): boolean;
Property Value
Type Description
boolean

isAlwaysFitMode

Declaration
get isAlwaysFitMode(): boolean;
Property Value
Type Description
boolean

isCropMode

Declaration
get isCropMode(): boolean;
Property Value
Type Description
boolean

isPlaceholderContent

Declaration
get isPlaceholderContent(): boolean;
Property Value
Type Description
boolean

item

Declaration
get item(): ContentItem;
Property Value
Type Description
ContentItem

parentPlaceholder

Declaration
get parentPlaceholder(): PlaceholderItemHandler;

set parentPlaceholder(value: PlaceholderItemHandler);
Property Value
Type Description
PlaceholderItemHandler

typeName

Declaration
static readonly typeName: string;
Property Value
Type Description
string

Methods

_createImageUrl()

Declaration
protected _createImageUrl(): any;
Returns
Type Description
any

_drawImage(ctx, disableSmoothing, opacity, image)

Declaration
protected _drawImage(ctx: CanvasRenderingContext2D, disableSmoothing: boolean, opacity?: number, image?: HTMLImageElement): void;
Parameters
Type Name Description
CanvasRenderingContext2D ctx
boolean disableSmoothing
number opacity
HTMLImageElement image
Returns
Type Description
void

_getBoundsMargin()

Declaration
protected _getBoundsMargin(): number;
Returns
Type Description
number

_getDrawingFillColor()

Declaration
protected _getDrawingFillColor(): Color;
Returns
Type Description
Color

_getItemColorPreviews()

Declaration
protected _getItemColorPreviews(): {
        fillColorPreview: RgbColor;
        borderColorPreview: RgbColor;
        altBorderColorPreview: RgbColor;
    };
Returns
Type Description
{ fillColorPreview: RgbColor; borderColorPreview: RgbColor; altBorderColorPreview: RgbColor; }

_getLayer()

Declaration
_getLayer(): Layer;
Returns
Type Description
Layer

_getRequestRatio(originalWidth, originalHeight, config)

Declaration
protected _getRequestRatio(originalWidth: number, originalHeight: number, config: ImageResizeRequestConfig): number;
Parameters
Type Name Description
number originalWidth
number originalHeight
ImageResizeRequestConfig config
Returns
Type Description
number

_getSrc()

Declaration
protected _getSrc(): string;
Returns
Type Description
string

_isLoadingImage()

Declaration
protected _isLoadingImage(): boolean;
Returns
Type Description
boolean

_isReady()

Declaration
protected _isReady(): boolean;
Returns
Type Description
boolean

_onAddedOnCanvas(canvas, supressUpdate)

Declaration
protected _onAddedOnCanvas(canvas: ICanvas, supressUpdate?: boolean): void;
Parameters
Type Name Description
ICanvas canvas
boolean supressUpdate
Returns
Type Description
void

_onCanvasChanged(args)

Declaration
protected _onCanvasChanged(args: {
        fullUpdate: boolean;
    }): void;
Parameters
Type Name Description
{ fullUpdate: boolean; } args
Returns
Type Description
void

_onImageLoaded(e, target)

Declaration
protected _onImageLoaded(e: any, target: any): void;
Parameters
Type Name Description
any e
any target
Returns
Type Description
void

_onItemPropertyChanged(sender, propertyName)

Declaration
protected _onItemPropertyChanged(sender: ContentItem, propertyName: string): void;
Parameters
Type Name Description
ContentItem sender
string propertyName
Returns
Type Description
void

_onRemovedFromCanvas(canvas)

Declaration
protected _onRemovedFromCanvas(canvas: ICanvas): void;
Parameters
Type Name Description
ICanvas canvas
Returns
Type Description
void

_setIsLoadingImage(value)

Declaration
protected _setIsLoadingImage(value: boolean): void;
Parameters
Type Name Description
boolean value
Returns
Type Description
void

_setSrc(value)

Declaration
protected _setSrc(value: string): void;
Parameters
Type Name Description
string value
Returns
Type Description
void

_shouldRequest(prevSize, nextSize, config)

Declaration
protected _shouldRequest(prevSize: number, nextSize: number, config: ImageResizeRequestConfig): boolean;
Parameters
Type Name Description
number prevSize
number nextSize
ImageResizeRequestConfig config
Returns
Type Description
boolean

_updateImageUrl()

Declaration
protected _updateImageUrl(): void;
Returns
Type Description
void

dispose()

Declaration
dispose(): void;
Returns
Type Description
void

drawItemHandler(itemHandlerCtx, originalCtx)

Declaration
drawItemHandler(itemHandlerCtx: CanvasRenderingContext2D, originalCtx?: CanvasRenderingContext2D): void;
Parameters
Type Name Description
CanvasRenderingContext2D itemHandlerCtx
CanvasRenderingContext2D originalCtx
Returns
Type Description
void

drawMaskedContent(ctx)

Declaration
drawMaskedContent(ctx: any): void;
Parameters
Type Name Description
any ctx
Returns
Type Description
void

isVisible()

Declaration
isVisible(): boolean;
Returns
Type Description
boolean

quickUpdate()

Declaration
quickUpdate(): void;
Returns
Type Description
void

setRectangle(rectangle, suppressOnChanged)

Declaration
setRectangle(rectangle?: RotatedRectangleF, suppressOnChanged?: boolean): void;
Parameters
Type Name Description
RotatedRectangleF rectangle
boolean suppressOnChanged
Returns
Type Description
void

transformByMatrix(matrix, finished, newAngle)

Declaration
transformByMatrix(matrix: Matrix, finished: boolean, newAngle?: number): void;
Parameters
Type Name Description
Matrix matrix
boolean finished
number newAngle
Returns
Type Description
void

updateRectangle(keepLocation, resizeMode, parentPlaceholder, sourceWidth, sourceHeight, hiResOutputDpi)

Declaration
updateRectangle(keepLocation?: boolean, resizeMode?: ResizeMode, parentPlaceholder?: PlaceholderItemHandler, sourceWidth?: number, sourceHeight?: number, hiResOutputDpi?: number): void;
Parameters
Type Name Description
boolean keepLocation
ResizeMode resizeMode
PlaceholderItemHandler parentPlaceholder
number sourceWidth
number sourceHeight
number hiResOutputDpi
Returns
Type Description
void
Was this page helpful?
Thanks for your feedback!
Back to top Copyright © 2001–2025 Aurigma, Inc. All rights reserved.
Loading...
    Thank for your vote
    Your opinion is important to us. To provide details, send feedback.
    Send feedback