OfficeXml/autoclass/docx/EndnotePr@DOCX.tsf

128 lines
3.6 KiB
Plaintext

type EndnotePr = 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: EndnotePr);override;
public
// normal property
property Pos read ReadXmlChildPos;
property NumFmt read ReadXmlChildNumFmt;
property NumStart read ReadXmlChildNumStart;
function ReadXmlChildPos();
function ReadXmlChildNumFmt();
function ReadXmlChildNumStart();
// multi property
property Endnotes read ReadEndnotes;
function ReadEndnotes(_index);
function AddEndnote(): Endnote;
function AppendEndnote(): Endnote;
public
// Children
XmlChildPos: PureWVal;
XmlChildNumFmt: PureWVal;
XmlChildNumStart: PureWVal;
end;
function EndnotePr.Create();overload;
begin
{self.}Create(nil, "w", "endnotePr");
end;
function EndnotePr.Create(_node: XmlNode);overload;
begin
class(OpenXmlElement).Create(_node: XmlNode);
end;
function EndnotePr.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 EndnotePr.Init();override;
begin
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
attributes_ := array();
attributes_pf_ := array(
);
sorted_child_ := array(
pre + "pos": array(0, makeweakref(thisFunction(ReadXmlChildPos))),
pre + "numFmt": array(1, makeweakref(thisFunction(ReadXmlChildNumFmt))),
pre + "numStart": array(2, makeweakref(thisFunction(ReadXmlChildNumStart))),
pre + "endnote": array(3, makeweakref(thisFunction(AppendEndnote))),
);
container_ := new TSOfficeContainer(sorted_child_);
end;
function EndnotePr.Copy(_obj: EndnotePr);override;
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.XmlChildPos) then
{self.}Pos.Copy(_obj.XmlChildPos);
if not ifnil(_obj.XmlChildNumFmt) then
{self.}NumFmt.Copy(_obj.XmlChildNumFmt);
if not ifnil(_obj.XmlChildNumStart) then
{self.}NumStart.Copy(_obj.XmlChildNumStart);
tslassigning := tslassigning_backup;
end;
function EndnotePr.ReadXmlChildPos();
begin
if tslassigning and ifnil({self.}XmlChildPos) then
begin
{self.}XmlChildPos := new PureWVal(self, {self.}Prefix, "pos");
container_.Set({self.}XmlChildPos);
end
return {self.}XmlChildPos;
end;
function EndnotePr.ReadXmlChildNumFmt();
begin
if tslassigning and ifnil({self.}XmlChildNumFmt) then
begin
{self.}XmlChildNumFmt := new PureWVal(self, {self.}Prefix, "numFmt");
container_.Set({self.}XmlChildNumFmt);
end
return {self.}XmlChildNumFmt;
end;
function EndnotePr.ReadXmlChildNumStart();
begin
if tslassigning and ifnil({self.}XmlChildNumStart) then
begin
{self.}XmlChildNumStart := new PureWVal(self, {self.}Prefix, "numStart");
container_.Set({self.}XmlChildNumStart);
end
return {self.}XmlChildNumStart;
end;
function EndnotePr.ReadEndnotes(_index);
begin
ind := ifnil(_index) ? -2 : _index;
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
return container_.Get(pre + "endnote", ind);
end;
function EndnotePr.AddEndnote(): Endnote;
begin
obj := new Endnote(self, {self.}Prefix, "endnote");
container_.Insert(obj);
return obj;
end;
function EndnotePr.AppendEndnote(): Endnote;
begin
obj := new Endnote(self, {self.}Prefix, "endnote");
container_.Append(obj);
return obj;
end;