OfficeXml/autoclass/docx/SectPr@DOCX.tsf

296 lines
9.4 KiB
Plaintext

type SectPr = class(OpenXmlElement)
public
function Create();overload;
function Create(_node: XmlNode);overload;
function Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
function Init();override;
function Copy(_obj: SectPr);override;
public
// attributes property
property WRsidR read ReadXmlAttrWRsidR write WriteXmlAttrWRsidR;
property WRsidSect read ReadXmlAttrWRsidSect write WriteXmlAttrWRsidSect;
function ReadXmlAttrWRsidR();
function WriteXmlAttrWRsidR(_value);
function ReadXmlAttrWRsidSect();
function WriteXmlAttrWRsidSect(_value);
// empty property
property TitlePg read ReadXmlChildTitlePg write WriteXmlChildTitlePg;
function ReadXmlChildTitlePg();
function WriteXmlChildTitlePg(_value);
// normal property
property FootnotePr read ReadXmlChildFootnotePr;
property Type read ReadXmlChildType;
property PgSz read ReadXmlChildPgSz;
property PgMar read ReadXmlChildPgMar;
property PgNumType read ReadXmlChildPgNumType;
property Cols read ReadXmlChildCols;
property DocGrid read ReadXmlChildDocGrid;
function ReadXmlChildFootnotePr();
function ReadXmlChildType();
function ReadXmlChildPgSz();
function ReadXmlChildPgMar();
function ReadXmlChildPgNumType();
function ReadXmlChildCols();
function ReadXmlChildDocGrid();
// multi property
property HeaderReferences read ReadHeaderReferences;
property FooterReferences read ReadFooterReferences;
function ReadHeaderReferences(_index);
function ReadFooterReferences(_index);
function AddHeaderReference(): Reference;
function AddFooterReference(): Reference;
function AppendHeaderReference(): Reference;
function AppendFooterReference(): Reference;
public
// Attributes
XmlAttrWRsidR: OpenXmlAttribute;
XmlAttrWRsidSect: OpenXmlAttribute;
// Children
XmlChildFootnotePr: FootnotePr;
XmlChildType: PureWVal;
XmlChildPgSz: PgSz;
XmlChildPgMar: PgMar;
XmlChildPgNumType: PgNumType;
XmlChildCols: Cols;
XmlChildTitlePg: OpenXmlEmpty;
XmlChildDocGrid: docGrid;
end;
function SectPr.Create();overload;
begin
{self.}Create(nil, "w", "sectPr");
end;
function SectPr.Create(_node: XmlNode);overload;
begin
class(OpenXmlElement).Create(_node: XmlNode);
end;
function SectPr.Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
begin
setsysparam(pn_calcctrlword(), getsysparam(pn_calcctrlword()) .| 0x200);
class(OpenXmlElement).Create(_parent, _prefix, _local_name);
end;
function SectPr.Init();override;
begin
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
attributes_ := array();
attributes_pf_ := array(
pre + "rsidR": makeweakref(thisFunction(WriteXmlAttrWRsidR)),
pre + "rsidSect": makeweakref(thisFunction(WriteXmlAttrWRsidSect)),
);
sorted_child_ := array(
pre + "headerReference": array(0, makeweakref(thisFunction(AppendHeaderReference))),
pre + "footerReference": array(1, makeweakref(thisFunction(AppendFooterReference))),
pre + "footnotePr": array(2, makeweakref(thisFunction(ReadXmlChildFootnotePr))),
pre + "type": array(3, makeweakref(thisFunction(ReadXmlChildType))),
pre + "pgSz": array(4, makeweakref(thisFunction(ReadXmlChildPgSz))),
pre + "pgMar": array(5, makeweakref(thisFunction(ReadXmlChildPgMar))),
pre + "pgNumType": array(6, makeweakref(thisFunction(ReadXmlChildPgNumType))),
pre + "cols": array(7, makeweakref(thisFunction(ReadXmlChildCols))),
pre + "titlePg": array(8, makeweakref(thisFunction(ReadXmlChildTitlePg))),
pre + "docGrid": array(9, makeweakref(thisFunction(ReadXmlChildDocGrid))),
);
container_ := new TSOfficeContainer(sorted_child_);
end;
function SectPr.Copy(_obj: SectPr);override;
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.WRsidR) then
{self.}WRsidR := _obj.WRsidR;
if not ifnil(_obj.WRsidSect) then
{self.}WRsidSect := _obj.WRsidSect;
if not ifnil(_obj.XmlChildFootnotePr) then
{self.}FootnotePr.Copy(_obj.XmlChildFootnotePr);
if not ifnil(_obj.XmlChildType) then
{self.}Type.Copy(_obj.XmlChildType);
if not ifnil(_obj.XmlChildPgSz) then
{self.}PgSz.Copy(_obj.XmlChildPgSz);
if not ifnil(_obj.XmlChildPgMar) then
{self.}PgMar.Copy(_obj.XmlChildPgMar);
if not ifnil(_obj.XmlChildPgNumType) then
{self.}PgNumType.Copy(_obj.XmlChildPgNumType);
if not ifnil(_obj.XmlChildCols) then
{self.}Cols.Copy(_obj.XmlChildCols);
if not ifnil(_obj.XmlChildTitlePg) then
ifnil({self.}XmlChildTitlePg) ? {self.}TitlePg.Copy(_obj.XmlChildTitlePg) : {self.}XmlChildTitlePg.Copy(_obj.XmlChildTitlePg);
if not ifnil(_obj.XmlChildDocGrid) then
{self.}DocGrid.Copy(_obj.XmlChildDocGrid);
tslassigning := tslassigning_backup;
end;
function SectPr.ReadXmlAttrWRsidR();
begin
return {self.}XmlAttrWRsidR.Value;
end;
function SectPr.WriteXmlAttrWRsidR(_value);
begin
if ifnil({self.}XmlAttrWRsidR) then
begin
{self.}XmlAttrWRsidR := new OpenXmlAttribute({self.}Prefix, "rsidR", nil);
attributes_[length(attributes_)] := {self.}XmlAttrWRsidR;
end
{self.}XmlAttrWRsidR.Value := _value;
end;
function SectPr.ReadXmlAttrWRsidSect();
begin
return {self.}XmlAttrWRsidSect.Value;
end;
function SectPr.WriteXmlAttrWRsidSect(_value);
begin
if ifnil({self.}XmlAttrWRsidSect) then
begin
{self.}XmlAttrWRsidSect := new OpenXmlAttribute({self.}Prefix, "rsidSect", nil);
attributes_[length(attributes_)] := {self.}XmlAttrWRsidSect;
end
{self.}XmlAttrWRsidSect.Value := _value;
end;
function SectPr.ReadXmlChildTitlePg();
begin
if tslassigning and ifnil({self.}XmlChildTitlePg) then
begin
{self.}XmlChildTitlePg := new OpenXmlEmpty(self, {self.}Prefix, "titlePg");
container_.Set({self.}XmlChildTitlePg);
return {self.}XmlChildTitlePg;
end
return ifnil({self.}XmlChildTitlePg) ? false : {self.}XmlChildTitlePg.BoolValue();
end;
function SectPr.WriteXmlChildTitlePg(_value);
begin
if ifnil({self.}XmlChildTitlePg) then
begin
{self.}XmlChildTitlePg := new OpenXmlEmpty(self, {self.}Prefix, "titlePg");
container_.Set({self.}XmlChildTitlePg);
end
{self.}XmlChildTitlePg.Value := _value;
end;
function SectPr.ReadXmlChildFootnotePr();
begin
if tslassigning and ifnil({self.}XmlChildFootnotePr) then
begin
{self.}XmlChildFootnotePr := new FootnotePr(self, {self.}Prefix, "footnotePr");
container_.Set({self.}XmlChildFootnotePr);
end
return {self.}XmlChildFootnotePr;
end;
function SectPr.ReadXmlChildType();
begin
if tslassigning and ifnil({self.}XmlChildType) then
begin
{self.}XmlChildType := new PureWVal(self, {self.}Prefix, "type");
container_.Set({self.}XmlChildType);
end
return {self.}XmlChildType;
end;
function SectPr.ReadXmlChildPgSz();
begin
if tslassigning and ifnil({self.}XmlChildPgSz) then
begin
{self.}XmlChildPgSz := new PgSz(self, {self.}Prefix, "pgSz");
container_.Set({self.}XmlChildPgSz);
end
return {self.}XmlChildPgSz;
end;
function SectPr.ReadXmlChildPgMar();
begin
if tslassigning and ifnil({self.}XmlChildPgMar) then
begin
{self.}XmlChildPgMar := new PgMar(self, {self.}Prefix, "pgMar");
container_.Set({self.}XmlChildPgMar);
end
return {self.}XmlChildPgMar;
end;
function SectPr.ReadXmlChildPgNumType();
begin
if tslassigning and ifnil({self.}XmlChildPgNumType) then
begin
{self.}XmlChildPgNumType := new PgNumType(self, {self.}Prefix, "pgNumType");
container_.Set({self.}XmlChildPgNumType);
end
return {self.}XmlChildPgNumType;
end;
function SectPr.ReadXmlChildCols();
begin
if tslassigning and ifnil({self.}XmlChildCols) then
begin
{self.}XmlChildCols := new Cols(self, {self.}Prefix, "cols");
container_.Set({self.}XmlChildCols);
end
return {self.}XmlChildCols;
end;
function SectPr.ReadXmlChildDocGrid();
begin
if tslassigning and ifnil({self.}XmlChildDocGrid) then
begin
{self.}XmlChildDocGrid := new docGrid(self, {self.}Prefix, "docGrid");
container_.Set({self.}XmlChildDocGrid);
end
return {self.}XmlChildDocGrid;
end;
function SectPr.ReadHeaderReferences(_index);
begin
ind := ifnil(_index) ? -2 : _index;
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
return container_.Get(pre + "headerReference", ind);
end;
function SectPr.ReadFooterReferences(_index);
begin
ind := ifnil(_index) ? -2 : _index;
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
return container_.Get(pre + "footerReference", ind);
end;
function SectPr.AddHeaderReference(): Reference;
begin
obj := new Reference(self, {self.}Prefix, "headerReference");
container_.Insert(obj);
return obj;
end;
function SectPr.AddFooterReference(): Reference;
begin
obj := new Reference(self, {self.}Prefix, "footerReference");
container_.Insert(obj);
return obj;
end;
function SectPr.AppendHeaderReference(): Reference;
begin
obj := new Reference(self, {self.}Prefix, "headerReference");
container_.Append(obj);
return obj;
end;
function SectPr.AppendFooterReference(): Reference;
begin
obj := new Reference(self, {self.}Prefix, "footerReference");
container_.Append(obj);
return obj;
end;