Class ContentItemHandler
Inheritance
ContentItemHandler
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
Properties
_copperHandler
Declaration
protected _copperHandler?: ImageCropperHandler;
Property Value
| Type |
Description |
| ImageCropperHandler |
|
_fitModeType
Declaration
protected _fitModeType: PlaceholderFitModeType;
Property Value
_imageContainer
Declaration
protected readonly _imageContainer: ImageContainer;
Property Value
_isCropMode
Declaration
protected _isCropMode: boolean;
Property Value
_needToDownloadImage
Declaration
protected _needToDownloadImage: boolean;
Property Value
_pixelHeight
Declaration
protected _pixelHeight: number;
Property Value
_pixelWidth
Declaration
protected _pixelWidth: number;
Property Value
contentType
Declaration
get contentType(): ContentType;
set contentType(value: ContentType);
Property Value
inEdit
Declaration
Property Value
isAlwaysFitMode
Declaration
get isAlwaysFitMode(): boolean;
Property Value
isCropMode
Declaration
get isCropMode(): boolean;
Property Value
isPlaceholderContent
Declaration
get isPlaceholderContent(): boolean;
Property Value
item
Declaration
Property Value
parentPlaceholder
Declaration
get parentPlaceholder(): PlaceholderItemHandler;
set parentPlaceholder(value: PlaceholderItemHandler);
Property Value
typeName
Declaration
static readonly typeName: string;
Property Value
Methods
_createImageUrl()
Declaration
protected _createImageUrl(): any;
Returns
_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
_getBoundsMargin()
Declaration
protected _getBoundsMargin(): number;
Returns
_getDrawingFillColor()
Declaration
protected _getDrawingFillColor(): Color;
Returns
_getItemColorPreviews()
Declaration
protected _getItemColorPreviews(): {
fillColorPreview: RgbColor;
borderColorPreview: RgbColor;
altBorderColorPreview: RgbColor;
};
Returns
_getLayer()
Declaration
Returns
_getRequestRatio(originalWidth, originalHeight, config)
Declaration
protected _getRequestRatio(originalWidth: number, originalHeight: number, config: ImageResizeRequestConfig): number;
Parameters
Returns
_getSrc()
Declaration
protected _getSrc(): string;
Returns
_isLoadingImage()
Declaration
protected _isLoadingImage(): boolean;
Returns
_isReady()
Declaration
protected _isReady(): boolean;
Returns
_onAddedOnCanvas(canvas, supressUpdate)
Declaration
protected _onAddedOnCanvas(canvas: ICanvas, supressUpdate?: boolean): void;
Parameters
| Type |
Name |
Description |
| ICanvas |
canvas |
|
| boolean |
supressUpdate |
|
Returns
_onCanvasChanged(args)
Declaration
protected _onCanvasChanged(args: {
fullUpdate: boolean;
}): void;
Parameters
| Type |
Name |
Description |
| {
fullUpdate: boolean;
} |
args |
|
Returns
_onImageLoaded(e, target)
Declaration
protected _onImageLoaded(e: any, target: any): void;
Parameters
| Type |
Name |
Description |
| any |
e |
|
| any |
target |
|
Returns
_onItemPropertyChanged(sender, propertyName)
Declaration
protected _onItemPropertyChanged(sender: ContentItem, propertyName: string): void;
Parameters
| Type |
Name |
Description |
| ContentItem |
sender |
|
| string |
propertyName |
|
Returns
_onRemovedFromCanvas(canvas)
Declaration
protected _onRemovedFromCanvas(canvas: ICanvas): void;
Parameters
| Type |
Name |
Description |
| ICanvas |
canvas |
|
Returns
_setIsLoadingImage(value)
Declaration
protected _setIsLoadingImage(value: boolean): void;
Parameters
| Type |
Name |
Description |
| boolean |
value |
|
Returns
_setSrc(value)
Declaration
protected _setSrc(value: string): void;
Parameters
| Type |
Name |
Description |
| string |
value |
|
Returns
_shouldRequest(prevSize, nextSize, config)
Declaration
protected _shouldRequest(prevSize: number, nextSize: number, config: ImageResizeRequestConfig): boolean;
Parameters
Returns
_updateImageUrl()
Declaration
protected _updateImageUrl(): void;
Returns
dispose()
Declaration
Returns
drawItemHandler(itemHandlerCtx, originalCtx)
Declaration
drawItemHandler(itemHandlerCtx: CanvasRenderingContext2D, originalCtx?: CanvasRenderingContext2D): void;
Parameters
| Type |
Name |
Description |
| CanvasRenderingContext2D |
itemHandlerCtx |
|
| CanvasRenderingContext2D |
originalCtx |
|
Returns
drawMaskedContent(ctx)
Declaration
drawMaskedContent(ctx: any): void;
Parameters
| Type |
Name |
Description |
| any |
ctx |
|
Returns
isVisible()
Declaration
Returns
quickUpdate()
Declaration
Returns
setRectangle(rectangle, suppressOnChanged)
Declaration
setRectangle(rectangle?: RotatedRectangleF, suppressOnChanged?: boolean): void;
Parameters
Returns
transformByMatrix(matrix, finished, newAngle)
Declaration
transformByMatrix(matrix: Matrix, finished: boolean, newAngle?: number): void;
Parameters
| Type |
Name |
Description |
| Matrix |
matrix |
|
| boolean |
finished |
|
| number |
newAngle |
|
Returns
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