devexpress-richedit
Version:
DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.
299 lines (298 loc) • 9.86 kB
JavaScript
import { Equals } from '@devexpress/utils/lib/utils/comparers';
import { SectionColumnCountHistoryItem, SectionColumnsInfoHistoryItem, SectionDifferentFirstPageHistoryItem, SectionEqualWidthColumnsHistoryItem, SectionFooterOffsetHistoryItem, SectionHeaderOffsetHistoryItem, SectionLandscapeHistoryItem, SectionMarginBottomHistoryItem, SectionMarginLeftHistoryItem, SectionMarginRightHistoryItem, SectionMarginTopHistoryItem, SectionPageHeightHistoryItem, SectionPageWidthHistoryItem, SectionPaperKindHistoryItem, SectionSpaceHistoryItem, SectionStartTypeHistoryItem } from '../history/items/section-properties-history-items';
import { JSONSectionProperty } from '../json/enums/json-section-enums';
import { SectionStartType } from './enums';
import { PaperKind } from './paper-kind';
import { SectionColumnProperties } from './section-column-properties';
export class SectionPropertiesMarginLeftDescriptor {
setProp(props, newValue) {
props.marginLeft = newValue;
}
getProp(props) {
return props.marginLeft;
}
getHistoryItemConstructor() {
return SectionMarginLeftHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.MarginLeft;
}
binaryEquals = Equals.simpleType;
defaultValue = 1440;
}
export class SectionPropertiesMarginTopDescriptor {
setProp(props, newValue) {
props.marginTop = newValue;
}
getProp(props) {
return props.marginTop;
}
getHistoryItemConstructor() {
return SectionMarginTopHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.MarginTop;
}
binaryEquals = Equals.simpleType;
defaultValue = 1440;
}
export class SectionPropertiesMarginRightDescriptor {
setProp(props, newValue) {
props.marginRight = newValue;
}
getProp(props) {
return props.marginRight;
}
getHistoryItemConstructor() {
return SectionMarginRightHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.MarginRight;
}
binaryEquals = Equals.simpleType;
defaultValue = 1440;
}
export class SectionPropertiesMarginBottomDescriptor {
setProp(props, newValue) {
props.marginBottom = newValue;
}
getProp(props) {
return props.marginBottom;
}
getHistoryItemConstructor() {
return SectionMarginBottomHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.MarginBottom;
}
binaryEquals = Equals.simpleType;
defaultValue = 1440;
}
export class SectionPropertiesFooterOffsetDescriptor {
setProp(props, newValue) {
props.footerOffset = newValue;
}
getProp(props) {
return props.footerOffset;
}
getHistoryItemConstructor() {
return SectionFooterOffsetHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.FooterOffset;
}
binaryEquals = Equals.simpleType;
defaultValue = 720;
}
export class SectionPropertiesHeaderOffsetDescriptor {
setProp(props, newValue) {
props.headerOffset = newValue;
}
getProp(props) {
return props.headerOffset;
}
getHistoryItemConstructor() {
return SectionHeaderOffsetHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.HeaderOffset;
}
binaryEquals = Equals.simpleType;
defaultValue = 720;
}
export class SectionPropertiesColumnCountDescriptor {
setProp(props, newValue) {
props.columnCount = newValue;
}
getProp(props) {
return props.columnCount;
}
getHistoryItemConstructor() {
return SectionColumnCountHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.ColumnCount;
}
binaryEquals = Equals.simpleType;
defaultValue = 1;
}
export class SectionPropertiesSpaceDescriptor {
setProp(props, newValue) {
props.space = newValue;
}
getProp(props) {
return props.space;
}
getHistoryItemConstructor() {
return SectionSpaceHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.Space;
}
binaryEquals = Equals.simpleType;
defaultValue = 720;
}
export class SectionPropertiesEqualWidthColumnsDescriptor {
setProp(props, newValue) {
props.equalWidthColumns = newValue;
}
getProp(props) {
return props.equalWidthColumns;
}
getHistoryItemConstructor() {
return SectionEqualWidthColumnsHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.EqualWidthColumns;
}
binaryEquals = Equals.simpleType;
defaultValue = true;
}
export class SectionPropertiesColumnsInfoDescriptor {
setProp(props, newValue) {
props.columnsInfo = newValue;
}
getProp(props) {
return props.columnsInfo;
}
getHistoryItemConstructor() {
return SectionColumnsInfoHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.ColumnsInfo;
}
binaryEquals = SectionColumnProperties.equalsColumnsInfoBinary;
defaultValue = [];
}
export class SectionPropertiesPageWidthDescriptor {
setProp(props, newValue) {
props.pageWidth = newValue;
}
getProp(props) {
return props.pageWidth;
}
getHistoryItemConstructor() {
return SectionPageWidthHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.PageWidth;
}
binaryEquals = Equals.simpleType;
defaultValue = 11906;
}
export class SectionPropertiesPageHeightDescriptor {
setProp(props, newValue) {
props.pageHeight = newValue;
}
getProp(props) {
return props.pageHeight;
}
getHistoryItemConstructor() {
return SectionPageHeightHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.PageHeight;
}
binaryEquals = Equals.simpleType;
defaultValue = 16838;
}
export class SectionPropertiesStartTypeDescriptor {
setProp(props, newValue) {
props.startType = newValue;
}
getProp(props) {
return props.startType;
}
getHistoryItemConstructor() {
return SectionStartTypeHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.StartType;
}
binaryEquals = Equals.simpleType;
defaultValue = SectionStartType.NextPage;
}
export class SectionPropertiesLandscapeDescriptor {
setProp(props, newValue) {
props.landscape = newValue;
}
getProp(props) {
return props.landscape;
}
getHistoryItemConstructor() {
return SectionLandscapeHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.Landscape;
}
binaryEquals = Equals.simpleType;
defaultValue = false;
}
export class SectionPropertiesDifferentFirstPageDescriptor {
setProp(props, newValue) {
props.differentFirstPage = newValue;
}
getProp(props) {
return props.differentFirstPage;
}
getHistoryItemConstructor() {
return SectionDifferentFirstPageHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.DifferentFirstPage;
}
binaryEquals = Equals.simpleType;
defaultValue = false;
}
export class SectionPropertiesPaperKindDescriptor {
setProp(props, newValue) {
props.paperKind = newValue;
}
getProp(props) {
return props.paperKind;
}
getHistoryItemConstructor() {
return SectionPaperKindHistoryItem;
}
getJSONProperty() {
return JSONSectionProperty.PaperKind;
}
binaryEquals = Equals.simpleType;
defaultValue = PaperKind.Letter;
}
export class SectionPropertyDescriptor {
static marginLeft = new SectionPropertiesMarginLeftDescriptor();
static marginTop = new SectionPropertiesMarginTopDescriptor();
static marginRight = new SectionPropertiesMarginRightDescriptor();
static marginBottom = new SectionPropertiesMarginBottomDescriptor();
static footerOffset = new SectionPropertiesFooterOffsetDescriptor();
static headerOffset = new SectionPropertiesHeaderOffsetDescriptor();
static columnCount = new SectionPropertiesColumnCountDescriptor();
static space = new SectionPropertiesSpaceDescriptor();
static equalWidthColumns = new SectionPropertiesEqualWidthColumnsDescriptor();
static columnsInfo = new SectionPropertiesColumnsInfoDescriptor();
static pageWidth = new SectionPropertiesPageWidthDescriptor();
static pageHeight = new SectionPropertiesPageHeightDescriptor();
static startType = new SectionPropertiesStartTypeDescriptor();
static landscape = new SectionPropertiesLandscapeDescriptor();
static differentFirstPage = new SectionPropertiesDifferentFirstPageDescriptor();
static paperKind = new SectionPropertiesPaperKindDescriptor();
static ALL_FIELDS = [
SectionPropertyDescriptor.marginLeft,
SectionPropertyDescriptor.marginTop,
SectionPropertyDescriptor.marginRight,
SectionPropertyDescriptor.marginBottom,
SectionPropertyDescriptor.footerOffset,
SectionPropertyDescriptor.headerOffset,
SectionPropertyDescriptor.columnCount,
SectionPropertyDescriptor.space,
SectionPropertyDescriptor.equalWidthColumns,
SectionPropertyDescriptor.columnsInfo,
SectionPropertyDescriptor.pageWidth,
SectionPropertyDescriptor.pageHeight,
SectionPropertyDescriptor.startType,
SectionPropertyDescriptor.landscape,
SectionPropertyDescriptor.differentFirstPage,
SectionPropertyDescriptor.paperKind
];
}