UNPKG

devexpress-richedit

Version:

DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.

521 lines (520 loc) 16.1 kB
import { Errors } from '@devexpress/utils/lib/errors'; import { Equals } from '@devexpress/utils/lib/utils/comparers'; import { BorderInfo } from '../borders/border-info'; import { ParagraphAfterAutoSpacingHistoryItem, ParagraphAlignmentHistoryItem, ParagraphBeforeAutoSpacingHistoryItem, ParagraphContextualSpacingHistoryItem, ParagraphDivIdHistoryItem, ParagraphFirstLineIndentHistoryItem, ParagraphFirstLineIndentTypeHistoryItem, ParagraphKeepLinesTogetherHistoryItem, ParagraphKeepWithNextHistoryItem, ParagraphLeftIndentHistoryItem, ParagraphLineSpacingHistoryItem, ParagraphLineSpacingTypeHistoryItem, ParagraphOutlineLevelHistoryItem, ParagraphPageBreakBeforeHistoryItem, ParagraphRightIndentHistoryItem, ParagraphRightToLeftHistoryItem, ParagraphShadingInfoIndexHistoryItem, ParagraphSpacingAfterHistoryItem, ParagraphSpacingBeforeHistoryItem, ParagraphSuppressHyphenationHistoryItem, ParagraphSuppressLineNumbersHistoryItem, ParagraphWidowOrphanControlHistoryItem } from '../history/items/paragraph-properties-history-items'; import { JSONParagraphFormattingProperty } from '../json/enums/json-paragraph-enums'; import { ShadingInfo } from '../shadings/shading-info'; import { ParagraphAlignment, ParagraphFirstLineIndent, ParagraphLineSpacingType, ParagraphPropertiesMask } from './paragraph-properties'; export class ParagraphPropertiesFirstLineIndentDescriptor { setProp(props, newValue) { props.firstLineIndent = newValue; } getProp(props) { return props.firstLineIndent; } maskValue() { return ParagraphPropertiesMask.UseFirstLineIndent; } getHistoryItemConstructor() { return ParagraphFirstLineIndentHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.FirstLineIndent; } binaryEquals = Equals.simpleType; defaultValue = 0; } export class ParagraphPropertiesWidowOrphanControlDescriptor { setProp(props, newValue) { props.widowOrphanControl = newValue; } getProp(props) { return props.widowOrphanControl; } maskValue() { return ParagraphPropertiesMask.UseWidowOrphanControl; } getHistoryItemConstructor() { return ParagraphWidowOrphanControlHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.WidowOrphanControl; } binaryEquals = Equals.simpleType; defaultValue = true; } export class ParagraphPropertiesFirstLineIndentTypeDescriptor { setProp(props, newValue) { props.firstLineIndentType = newValue; } getProp(props) { return props.firstLineIndentType; } maskValue() { return ParagraphPropertiesMask.UseFirstLineIndent; } getHistoryItemConstructor() { return ParagraphFirstLineIndentTypeHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.FirstLineIndentType; } binaryEquals = Equals.simpleType; defaultValue = ParagraphFirstLineIndent.None; } export class ParagraphPropertiesAfterAutoSpacingDescriptor { setProp(props, newValue) { props.afterAutoSpacing = newValue; } getProp(props) { return props.afterAutoSpacing; } maskValue() { return ParagraphPropertiesMask.UseAfterAutoSpacing; } getHistoryItemConstructor() { return ParagraphAfterAutoSpacingHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.AfterAutoSpacing; } binaryEquals = Equals.simpleType; defaultValue = false; } export class ParagraphPropertiesOutlineLevelDescriptor { setProp(props, newValue) { props.outlineLevel = newValue; } getProp(props) { return props.outlineLevel; } maskValue() { return ParagraphPropertiesMask.UseOutlineLevel; } getHistoryItemConstructor() { return ParagraphOutlineLevelHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.OutlineLevel; } binaryEquals = Equals.simpleType; defaultValue = 0; } export class ParagraphPropertiesBeforeAutoSpacingDescriptor { setProp(props, newValue) { props.beforeAutoSpacing = newValue; } getProp(props) { return props.beforeAutoSpacing; } maskValue() { return ParagraphPropertiesMask.UseBeforeAutoSpacing; } getHistoryItemConstructor() { return ParagraphBeforeAutoSpacingHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.BeforeAutoSpacing; } binaryEquals = Equals.simpleType; defaultValue = false; } export class ParagraphPropertiesPageBreakBeforeDescriptor { setProp(props, newValue) { props.pageBreakBefore = newValue; } getProp(props) { return props.pageBreakBefore; } maskValue() { return ParagraphPropertiesMask.UsePageBreakBefore; } getHistoryItemConstructor() { return ParagraphPageBreakBeforeHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.PageBreakBefore; } binaryEquals = Equals.simpleType; defaultValue = false; } export class ParagraphPropertiesRightIndentDescriptor { setProp(props, newValue) { props.rightIndent = newValue; } getProp(props) { return props.rightIndent; } maskValue() { return ParagraphPropertiesMask.UseRightIndent; } getHistoryItemConstructor() { return ParagraphRightIndentHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.RightIndent; } binaryEquals = Equals.simpleType; defaultValue = 0; } export class ParagraphPropertiesSuppressHyphenationDescriptor { setProp(props, newValue) { props.suppressHyphenation = newValue; } getProp(props) { return props.suppressHyphenation; } maskValue() { return ParagraphPropertiesMask.UseSuppressHyphenation; } getHistoryItemConstructor() { return ParagraphSuppressHyphenationHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.SuppressHyphenation; } binaryEquals = Equals.simpleType; defaultValue = false; } export class ParagraphPropertiesLineSpacingDescriptor { setProp(props, newValue) { props.lineSpacing = newValue; } getProp(props) { return props.lineSpacing; } maskValue() { return ParagraphPropertiesMask.UseLineSpacing; } getHistoryItemConstructor() { return ParagraphLineSpacingHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.LineSpacing; } binaryEquals = Equals.simpleType; defaultValue = 0; } export class ParagraphPropertiesSuppressLineNumbersDescriptor { setProp(props, newValue) { props.suppressLineNumbers = newValue; } getProp(props) { return props.suppressLineNumbers; } maskValue() { return ParagraphPropertiesMask.UseSuppressLineNumbers; } getHistoryItemConstructor() { return ParagraphSuppressLineNumbersHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.SuppressLineNumbers; } binaryEquals = Equals.simpleType; defaultValue = false; } export class ParagraphPropertiesKeepLinesTogetherDescriptor { setProp(props, newValue) { props.keepLinesTogether = newValue; } getProp(props) { return props.keepLinesTogether; } maskValue() { return ParagraphPropertiesMask.UseKeepLinesTogether; } getHistoryItemConstructor() { return ParagraphKeepLinesTogetherHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.KeepLinesTogether; } binaryEquals = Equals.simpleType; defaultValue = false; } export class ParagraphPropertiesKeepWithNextDescriptor { setProp(props, newValue) { props.keepWithNext = newValue; } getProp(props) { return props.keepWithNext; } maskValue() { return ParagraphPropertiesMask.UseKeepWithNext; } getHistoryItemConstructor() { return ParagraphKeepWithNextHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.KeepWithNext; } binaryEquals = Equals.simpleType; defaultValue = false; } export class ParagraphPropertiesShadingInfoIndexDescriptor { setProp(props, newValue) { props.shadingInfo = newValue; } getProp(props) { return props.shadingInfo; } maskValue() { return ParagraphPropertiesMask.UseShadingInfoIndex; } getHistoryItemConstructor() { return ParagraphShadingInfoIndexHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.ShadingInfo; } binaryEquals = Equals.object; defaultValue = ShadingInfo.noColor; } export class ParagraphPropertiesLeftIndentDescriptor { setProp(props, newValue) { props.leftIndent = newValue; } getProp(props) { return props.leftIndent; } maskValue() { return ParagraphPropertiesMask.UseLeftIndent; } getHistoryItemConstructor() { return ParagraphLeftIndentHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.LeftIndent; } binaryEquals = Equals.simpleType; defaultValue = 0; } export class ParagraphPropertiesLineSpacingTypeDescriptor { setProp(props, newValue) { props.lineSpacingType = newValue; } getProp(props) { return props.lineSpacingType; } maskValue() { return ParagraphPropertiesMask.UseLineSpacing; } getHistoryItemConstructor() { return ParagraphLineSpacingTypeHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.LineSpacingType; } binaryEquals = Equals.simpleType; defaultValue = ParagraphLineSpacingType.Single; } export class ParagraphPropertiesAlignmentDescriptor { setProp(props, newValue) { props.alignment = newValue; } getProp(props) { return props.alignment; } maskValue() { return ParagraphPropertiesMask.UseAlignment; } getHistoryItemConstructor() { return ParagraphAlignmentHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.Alignment; } binaryEquals = Equals.simpleType; defaultValue = ParagraphAlignment.Left; } export class ParagraphPropertiesContextualSpacingDescriptor { setProp(props, newValue) { props.contextualSpacing = newValue; } getProp(props) { return props.contextualSpacing; } maskValue() { return ParagraphPropertiesMask.UseContextualSpacing; } getHistoryItemConstructor() { return ParagraphContextualSpacingHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.ContextualSpacing; } binaryEquals = Equals.simpleType; defaultValue = false; } export class ParagraphPropertiesSpacingBeforeDescriptor { setProp(props, newValue) { props.spacingBefore = newValue; } getProp(props) { return props.spacingBefore; } maskValue() { return ParagraphPropertiesMask.UseSpacingBefore; } getHistoryItemConstructor() { return ParagraphSpacingBeforeHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.SpacingBefore; } binaryEquals = Equals.simpleType; defaultValue = 0; } export class ParagraphPropertiesSpacingAfterDescriptor { setProp(props, newValue) { props.spacingAfter = newValue; } getProp(props) { return props.spacingAfter; } maskValue() { return ParagraphPropertiesMask.UseSpacingAfter; } getHistoryItemConstructor() { return ParagraphSpacingAfterHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.SpacingAfter; } binaryEquals = Equals.simpleType; defaultValue = 0; } export class ParagraphPropertiesRightToLeftDescriptor { setProp(props, newValue) { props.rightToLeft = newValue; } getProp(props) { return props.rightToLeft; } maskValue() { return ParagraphPropertiesMask.UseRightToLeft; } getHistoryItemConstructor() { return ParagraphRightToLeftHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.RightToLeft; } binaryEquals = Equals.simpleType; defaultValue = false; } export class ParagraphPropertiesLeftBorderDescriptor { setProp(props, newValue) { props.leftBorder = newValue; } getProp(props) { return props.leftBorder; } maskValue() { return ParagraphPropertiesMask.UseLeftBorder; } getHistoryItemConstructor() { throw Error(Errors.NotImplemented); } getJSONProperty() { throw Error(Errors.NotImplemented); } binaryEquals = Equals.object; defaultValue = new BorderInfo(); } export class ParagraphPropertiesRightBorderDescriptor { setProp(props, newValue) { props.rightBorder = newValue; } getProp(props) { return props.rightBorder; } maskValue() { return ParagraphPropertiesMask.UseRightBorder; } getHistoryItemConstructor() { throw Error(Errors.NotImplemented); } getJSONProperty() { throw Error(Errors.NotImplemented); } binaryEquals = Equals.object; defaultValue = new BorderInfo(); } export class ParagraphPropertiesTopBorderDescriptor { setProp(props, newValue) { props.topBorder = newValue; } getProp(props) { return props.topBorder; } maskValue() { return ParagraphPropertiesMask.UseTopBorder; } getHistoryItemConstructor() { throw Error(Errors.NotImplemented); } getJSONProperty() { throw Error(Errors.NotImplemented); } binaryEquals = Equals.object; defaultValue = new BorderInfo(); } export class ParagraphPropertiesBottomBorderDescriptor { setProp(props, newValue) { props.bottomBorder = newValue; } getProp(props) { return props.bottomBorder; } maskValue() { return ParagraphPropertiesMask.UseBottomBorder; } getHistoryItemConstructor() { throw Error(Errors.NotImplemented); } getJSONProperty() { throw Error(Errors.NotImplemented); } binaryEquals = Equals.object; defaultValue = new BorderInfo(); } export class ParagraphPropertiesBetweenBorderDescriptor { setProp(props, newValue) { props.betweenBorder = newValue; } getProp(props) { return props.betweenBorder; } maskValue() { return ParagraphPropertiesMask.UseBetweenBorder; } getHistoryItemConstructor() { throw Error(Errors.NotImplemented); } getJSONProperty() { throw Error(Errors.NotImplemented); } binaryEquals = Equals.object; defaultValue = new BorderInfo(); } export class ParagraphPropertiesDivIdDescriptor { setProp(props, newValue) { props.divId = newValue; } getProp(props) { return props.divId; } maskValue() { return ParagraphPropertiesMask.UseDivId; } getHistoryItemConstructor() { return ParagraphDivIdHistoryItem; } getJSONProperty() { return JSONParagraphFormattingProperty.DivId; } binaryEquals = Equals.simpleType; defaultValue = 0; }