devexpress-richedit
Version:
DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.
133 lines (132 loc) • 8.25 kB
TypeScript
import { TableIterator } from '../../../../layout-formatter/box/generator/recursive-objects-iterators';
import { DocumentModel } from '../../../../model/document-model';
import { Paragraph } from '../../../../model/paragraph/paragraph';
import { ParagraphStyle } from '../../../../model/paragraph/paragraph-style';
import { RangePermission } from '../../../../model/range-permissions';
import { RunBase } from '../../../../model/runs/run-base';
import { Section } from '../../../../model/section/section';
import { SubDocument } from '../../../../model/sub-document';
import { FooterSubDocumentInfo, HeaderSubDocumentInfo } from '../../../../model/sub-document-infos';
import { ConditionalTableStyleFormatting } from '../../../../model/tables/secondary-structures/table-base-structures';
import { RtfExportHelper } from '../helpers/rtf-export-helper';
import { PieceTableNumberingListCountersManager } from '../piece-table-numbering-list-counters-manager';
import { RtfBuilder } from '../rtf-builder';
import { DocumentPropertyNames, RtfDocumentExporterOptions } from '../rtf-document-exporter-options';
import { RtfCharacterPropertiesExporter } from './rtf-character-properties-exporter';
import { RtfParagraphPropertiesExporter } from './rtf-paragraph-properties-exporter';
import { RtfSectionPropertiesExporter } from './rtf-section-properties-exporter';
export type RunHandler = (run: RunBase, runText: string, absolutePosition: number) => void;
export declare class RtfContentExporter {
documentModel: DocumentModel;
subDocument: SubDocument;
currentSection: Section;
static readonly verticalAlignmentTypes: Record<number, string>;
static readonly sectionStartTypes: Record<number, string>;
static readonly chapterSeparatorTypes: Record<string, string>;
static readonly pageNumberingTypes: Record<number, string>;
static readonly sectionFootNoteNumberingTypes: Record<number, string>;
static readonly sectionEndNoteNumberingTypes: Record<number, string>;
static readonly footNoteNumberingTypes: Record<number, string>;
static readonly endNoteNumberingTypes: Record<number, string>;
static readonly borderLineStyles: Record<number, string>;
static readonly conditionalStylesTypes: Record<number, string>;
static readonly predefinedUserGroups: Record<number, string>;
rtfExportHelper: RtfExportHelper;
rtfBuilder: RtfBuilder;
paragraphPropertiesExporter: RtfParagraphPropertiesExporter;
characterPropertiesExporter: RtfCharacterPropertiesExporter;
sectionPropertiesExporter: RtfSectionPropertiesExporter;
pieceTableNumberingListCounters: PieceTableNumberingListCountersManager;
options: RtfDocumentExporterOptions;
keepFieldCodeViewState: boolean;
get shouldExportHiddenText(): boolean;
protected runHandlerMap: Record<number, RunHandler>;
private bookmarksIterator;
private permissionsIterator;
tableIterator: TableIterator;
private startSectionParagraphIndex;
private shouldFourceUpdateIterators;
constructor(documentModel: DocumentModel, options: RtfDocumentExporterOptions, rtfExportHelper: RtfExportHelper);
createRtfBuilder(): RtfBuilder;
export(): void;
shouldSplitRuns(): boolean;
splitRuns(): void;
splitRun(position: number): void;
initializeSubDocument(startSectionParagraphIndex: number): void;
updateIterators(position: number): void;
forceUpdateIterators(position: number): void;
exportSubDocument(subDocument: SubDocument, pieceTableExporter: () => void): void;
private createPermissionsIterator;
private createBookmarkIterator;
exportDefaultCharacterProperties(): void;
exportDefaultParagraphProperties(): void;
exportStyleTable(): void;
exportNumberingListTable(): void;
calculateFirstExportedNumberingListsIndexForStyles(paragraphStyleCollection: ParagraphStyle[]): number;
populateUserTable(): void;
populateUserList(pieceTable: SubDocument, users: string[]): void;
exportDocumentInformation(): void;
exportDocumentProtectionPasswordHash(): void;
exportDocumentProtectionPasswordHashWord2007(): void;
getDocumentProtectionPasswordHashWord2007Bytes(): Uint8Array;
exportDocumentProtectionPasswordHashWord2003(): void;
shouldExportDocumentProtectionPasswordHashInWord2007Format(): boolean;
shouldExportDocumentInformation(): boolean;
shouldExportDocumentProperties(): boolean;
shouldExportDocumentProtectionPasswordHash(): boolean;
exportDocumentSettings(): void;
exportFormattingFlags(): void;
exportDocumentProtectionProperties(): void;
exportPageBackground(): void;
exportCompatibilitySettings(): void;
exportDocumentProperties(): void;
writeStringDocumentProperty(value: string, command: string, flag: DocumentPropertyNames): void;
writeANSIStringProperty(value: string, command: string): void;
writeUnicodeStringProperty(value: string, command: string): void;
writeStringProperty(value: string, command: string): void;
writeDateTimeDocumentProperty(value: Date, command: string, flag: DocumentPropertyNames): void;
exportDocument(this: RtfContentExporter): void;
exportSectionFiltered(section: Section): void;
shouldExportSection(_section: Section): boolean;
exportSection(section: Section): void;
startNewSection(section: Section): void;
exportParagraphs(paragraphs: Paragraph[]): void;
exportParagraphFiltered(paragraph: Paragraph, paragraphIndex: number): number;
exportParagraph(paragraph: Paragraph, paragraphIndex: number): number;
exportSingleParagraph(paragraph: Paragraph): void;
private finishParagraph;
supressExportLastParagraph(_paragraph: Paragraph): boolean;
exportParagraphCore(paragraph: Paragraph, tableNestingLevel: number, _condTypes: ConditionalTableStyleFormatting, _tableStyleIndex: number): void;
startNewParagraph(paragraph: Paragraph, tableNestingLevel: number): void;
startNewInnerParagraph(paragraph: Paragraph, tableNestingLevel: number): void;
writeAlternativeText(paragraph: Paragraph): void;
exportParagraphCharacterProperties(paragraph: Paragraph): void;
exportParagraphRuns(paragraph: Paragraph): void;
private exportRun;
private exportTextRun;
private exportBookmark;
private exportRangePermission;
generateRangePermissionData(rangePermission: RangePermission): string;
private intToShortString;
private fieldCodeStartRunHandler;
private fieldCodeEndRunHandler;
private fieldResultEndRunHandler;
private inlinePictureRunHandler;
private inlineTextBoxRunHandler;
private anchoredPictureRunHandler;
private anchoredTextBoxRunHandler;
exportSectionHeadersFootersCore(section: Section): void;
protected exportFirstPageHeader(sectionHeader: HeaderSubDocumentInfo, linkedToPrevious: boolean): void;
protected exportOddPageHeader(sectionHeader: HeaderSubDocumentInfo, linkedToPrevious: boolean): void;
protected exportEvenPageHeader(sectionHeader: HeaderSubDocumentInfo, linkedToPrevious: boolean): void;
protected exportFirstPageFooter(sectionFooter: FooterSubDocumentInfo, linkedToPrevious: boolean): void;
protected exportOddPageFooter(sectionFooter: FooterSubDocumentInfo, linkedToPrevious: boolean): void;
protected exportEvenPageFooter(sectionFooter: FooterSubDocumentInfo, linkedToPrevious: boolean): void;
protected exportFirstPageHeaderCore(sectionHeader: HeaderSubDocumentInfo, _linkedToPrevious: boolean): void;
protected exportOddPageHeaderCore(sectionHeader: HeaderSubDocumentInfo, _linkedToPrevious: boolean): void;
protected exportEvenPageHeaderCore(sectionHeader: HeaderSubDocumentInfo, _linkedToPrevious: boolean): void;
protected exportFirstPageFooterCore(sectionFooter: FooterSubDocumentInfo, _linkedToPrevious: boolean): void;
protected exportOddPageFooterCore(sectionFooter: FooterSubDocumentInfo, _linkedToPrevious: boolean): void;
protected exportEvenPageFooterCore(sectionFooter: FooterSubDocumentInfo, _linkedToPrevious: boolean): void;
exportPieceTable(this: RtfContentExporter): void;
}