devexpress-richedit
Version:
DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.
110 lines (109 loc) • 5.58 kB
TypeScript
import { EventDispatcher } from '../utils/event-dispatcher';
import { DocumentLayout } from '../layout/document-layout';
import { DocumentModel } from '../model/document-model';
import { SubDocument, SubDocumentInterval, SubDocumentIntervals } from '../model/sub-document';
import { Table } from '../model/tables/main-structures/table';
import { TableCell } from '../model/tables/main-structures/table-cell';
import { SelectedTableInfo } from './selected-cells-engine';
import { SelectedSpecialRunInfo } from './selected-special-run-info';
import { ISelectionBase } from './selection-base';
import { SelectionIntervalsInfo } from './selection-intervals-info';
import { BatchUpdatableObject } from '@devexpress/utils/lib/class/batch-updatable';
import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
import { ModelScrollManager } from '../scroll/model-scroll-manager';
import { IMisspelledSelectionChangesListener, ISearchSelectionChangesListener, ISelectionChangesListener } from './i-selection-changes-listener';
import { InputPosition } from './input-position';
import { SelectionFloatingState, SelectionState } from './selection-state';
import { SetSelectionParams } from './set-selection-params';
import { TableNavDirection } from './table-nav-direction';
export declare class SetSelectionStateOptions {
correctIntervalDueToFields: boolean;
correctIntervalDueToTables: boolean;
useFieldUiChecks: boolean;
isForceUpdate: boolean;
noFieldCorrect(): this;
noTablesCorrect(): this;
noFieldUiChecks(): this;
forceUpdate(): this;
}
type VerticalTableReentrySnapshot = {
subDocumentId: number;
tableStartPosition: number;
firstCellPosition: number;
lastCellPosition: number;
textSelectionAnchorPosition: number;
textSelectionActivePosition: number;
textSelectionEndOfLine: boolean;
};
export declare class Selection extends BatchUpdatableObject implements ISelectionBase {
private _prevState;
private _state;
private verticalTableReentrySnapshot;
get currState(): SelectionState;
get keepX(): number;
set keepX(val: number);
get forwardDirection(): boolean;
set forwardDirection(val: boolean);
get endOfLine(): boolean;
set endOfLine(val: boolean);
get pageIndex(): number;
set pageIndex(val: number);
get intervals(): FixedInterval[];
get activeSubDocument(): SubDocument;
get lastSelectedInterval(): FixedInterval;
get intervalsInfo(): SelectionIntervalsInfo;
get prevState(): SelectionState;
get multiselection(): boolean;
get anchorPosition(): number;
get reversedAnchorPosition(): number;
get tableSelectionAnchorCellPosition(): number;
get tableSelectionActiveCellPosition(): number;
get hasExplicitTableCellSelection(): boolean;
get tableSingleCellEntryDirection(): TableNavDirection;
get tableSingleCellShrinkDirection(): TableNavDirection;
get tableTextSelectionAnchorPosition(): number;
get tableTextSelectionActivePosition(): number;
get tableTextSelectionEndOfLine(): boolean;
isCollapsed(): boolean;
saveVerticalTableReentrySnapshot(table: Table, selectedCells: TableCell[][]): void;
getVerticalTableReentrySnapshot(table: Table): VerticalTableReentrySnapshot;
getTableForSelectionRestore(subDocument: SubDocument): Table;
clearVerticalTableReentrySnapshot(): void;
private updateVerticalTableReentrySnapshot;
getTableSelectionAnchorCell(): TableCell;
getTableSelectionActiveCell(): TableCell;
private getTableCellByPosition;
get subDocumentIntervals(): SubDocumentIntervals;
get subDocumentInterval(): SubDocumentInterval;
model: DocumentModel;
layout: DocumentLayout;
scrollManager: ModelScrollManager;
get specialRunInfo(): SelectedSpecialRunInfo;
searchIntervals: FixedInterval[];
misspelledIntervals: FixedInterval[];
onChanged: EventDispatcher<ISelectionChangesListener>;
onSearchChanged: EventDispatcher<ISearchSelectionChangesListener>;
onMisspelledSelectionChanged: EventDispatcher<IMisspelledSelectionChangesListener>;
inputPosition: InputPosition;
get tableInfo(): SelectedTableInfo;
constructor(model: DocumentModel, layout: DocumentLayout, activeSubDocument: SubDocument, scrollManager: ModelScrollManager);
dispose(): void;
setSelection(params: SetSelectionParams): void;
getState(): SelectionState;
changeState(changeState: (newState: SelectionState) => void, options?: SetSelectionStateOptions): boolean;
setState(newState: SelectionState, options?: SetSelectionStateOptions): boolean;
correctAfterTextBufferChanged(): void;
getFloatingState(): SelectionFloatingState;
restoreFloatingState(state: SelectionFloatingState): void;
setSearchSelectionIntervals(intervals: FixedInterval[]): void;
resetSearchSelection(): void;
onUpdateUnlocked(occurredEvents: number): void;
setMisspelledSelectionIntervals(intervals: FixedInterval[]): void;
raiseSelectionChanged(): void;
raiseSearchSelectionChanged(): void;
raiseMisspelledSelectionChanged(): void;
deprecatedSetSelection(firstPosition: number, secondPosition: number, endOfLine: boolean, keepX: number, _upd: boolean, correctIntervalDueToFields?: boolean, correctIntervalDueToTables?: boolean, visibleModelPosition?: number, useFieldUiChecks?: boolean): void;
shouldResetInputPosition(): boolean;
resetInputPositionIfNeeded(): void;
}
export {};