@grapecity/gcpdfviewer
Version:
GcDocs PDF Viewer
82 lines (81 loc) • 4.2 kB
TypeScript
//@ts-ignore
import { DropdownItem } from "@grapecity/core-ui";
import { IGcDocumentContextMenuContext } from "./types";
import GcPdfViewer from "..";
import { GcSelectionPoint } from "../Models/GcMeasurementTypes";
/// <reference path="../vendor/i18next.d.ts" />
//@ts-ignore
import { i18n } from 'i18next';
import { AnnotationBase, MarkupAnnotation } from "../Annotations/AnnotationTypes";
import { IGcSelectionCopier } from "../Models/ViewerTypes";
export type GcContextMenuParams = {
mouseOverPageFlag: boolean;
keyboardEventFlag: boolean;
target?: HTMLElement;
event?: any;
doubleClick?: boolean;
};
export declare class GcDocumentContextMenu {
viewer: GcPdfViewer;
container: HTMLElement;
context: IGcDocumentContextMenuContext;
docViewer: any;
private _openParams;
private _targetAnnotationId;
private _opening;
private _opened;
private _prevAction?;
private _prevColor?;
in17n: i18n;
static register(viewer: GcPdfViewer, container: HTMLElement, context: IGcDocumentContextMenuContext, docViewer: any): GcDocumentContextMenu;
static unregister(container: HTMLElement): void;
mousePosition: GcSelectionPoint;
insertPosition: GcSelectionPoint;
private constructor();
onTextMarkupContextMenu(mousePos: GcSelectionPoint, selectionCopier: IGcSelectionCopier, params: GcContextMenuParams): boolean;
onCustomContextMenu(mousePos: GcSelectionPoint, selectionCopier: IGcSelectionCopier, params: GcContextMenuParams): boolean;
private open;
private openInternal;
private close;
private get contextMenuProvider();
private get useColoredIcons();
private getDropdownItems;
addShowCommentPanel(items: DropdownItem[], isMini?: boolean): void;
addPasteAction(items: DropdownItem[], isMini?: boolean): void;
addAnnotationMenuItems(items: DropdownItem[], annotationId: string, isMini?: boolean): void;
adjustRectForNewViewPort(annotation: AnnotationBase, prevPageIndex: number, newPageIndex: number, checkBoundsCollision?: boolean): void;
addSplitter(items: DropdownItem[]): void;
getDDColorValues(type: "highlight" | "underline" | "strikeout" | "squiggly"): {
value: string;
displayName: string;
}[];
renderColorItems(colors: {
value: string;
displayName: string;
}[], onClick: (colorHex: string) => void, lastSelectedColor?: string): DropdownItem[];
addHighlightFromSelection(items: DropdownItem[], selectionCopier: IGcSelectionCopier, isOverAnnotation: boolean, args: {
isMini?: boolean;
repeatAction?: boolean;
}): void;
addUnderlineFromSelection(items: DropdownItem[], selectionCopier: IGcSelectionCopier, isOverAnnotation: boolean, args: {
isMini?: boolean;
repeatAction?: boolean;
}): void;
makeTextMarkupFromSelection(markupType: "underline" | "highlight" | "strikeout" | "squiggly" | "replacetext", selectionCopier: IGcSelectionCopier, annotation?: MarkupAnnotation, colorHex?: string): Promise<boolean>;
addStrikeoutFromSelection(items: DropdownItem[], selectionCopier: IGcSelectionCopier, isOverAnnotation: boolean, args: {
isMini?: boolean;
repeatAction?: boolean;
}): void;
addSquigglyFromSelection(items: DropdownItem[], selectionCopier: IGcSelectionCopier, isOverAnnotation: boolean, args: {
isMini?: boolean;
repeatAction?: boolean;
}): void;
addCreateLinkAndTextMarkupItems(items: DropdownItem[], selectionCopier: IGcSelectionCopier, isOverAnnotation: boolean, isMini?: boolean): void;
addCopyText(items: DropdownItem[], selectionCopier: IGcSelectionCopier, isMini?: boolean): void;
addNoteToSelection(items: DropdownItem[], selectionCopier: IGcSelectionCopier, isMini?: boolean): void;
addPrint(items: DropdownItem[], selectionCopier: IGcSelectionCopier, isMini?: boolean): void;
addStickyNote(items: DropdownItem[], selectionCopier: IGcSelectionCopier, isMini?: boolean): void;
private _convertFromGlobalPoint;
private _findTargetAnnotationElement;
private _isTargetAllowsDefaultContextMenu;
}