356 lines
12 KiB
Plaintext
356 lines
12 KiB
Plaintext
type Properties = 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: Properties);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property Xmlns read ReadXmlAttrXmlns write WriteXmlAttrXmlns;
|
|
property XmlnsVt read ReadXmlAttrXmlnsVt write WriteXmlAttrXmlnsVt;
|
|
function ReadXmlAttrXmlns();
|
|
function WriteXmlAttrXmlns(_value);
|
|
function ReadXmlAttrXmlnsVt();
|
|
function WriteXmlAttrXmlnsVt(_value);
|
|
|
|
// pcdata property
|
|
property Template read ReadXmlChildTemplate;
|
|
property TotalTime read ReadXmlChildTotalTime;
|
|
property Pages read ReadXmlChildPages;
|
|
property Words read ReadXmlChildWords;
|
|
property Characters read ReadXmlChildCharacters;
|
|
property Application read ReadXmlChildApplication;
|
|
property DocSecurity read ReadXmlChildDocSecurity;
|
|
property Lines read ReadXmlChildLines;
|
|
property Paragraphs read ReadXmlChildParagraphs;
|
|
property ScaleCrop read ReadXmlChildScaleCrop;
|
|
property Company read ReadXmlChildCompany;
|
|
property LinksUpToDate read ReadXmlChildLinksUpToDate;
|
|
property CharactersWithSpaces read ReadXmlChildCharactersWithSpaces;
|
|
property SharedDoc read ReadXmlChildSharedDoc;
|
|
property HyperlinksChanged read ReadXmlChildHyperlinksChanged;
|
|
property AppVersion read ReadXmlChildAppVersion;
|
|
function ReadXmlChildTemplate();
|
|
function ReadXmlChildTotalTime();
|
|
function ReadXmlChildPages();
|
|
function ReadXmlChildWords();
|
|
function ReadXmlChildCharacters();
|
|
function ReadXmlChildApplication();
|
|
function ReadXmlChildDocSecurity();
|
|
function ReadXmlChildLines();
|
|
function ReadXmlChildParagraphs();
|
|
function ReadXmlChildScaleCrop();
|
|
function ReadXmlChildCompany();
|
|
function ReadXmlChildLinksUpToDate();
|
|
function ReadXmlChildCharactersWithSpaces();
|
|
function ReadXmlChildSharedDoc();
|
|
function ReadXmlChildHyperlinksChanged();
|
|
function ReadXmlChildAppVersion();
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrXmlns: OpenXmlAttribute;
|
|
XmlAttrXmlnsVt: OpenXmlAttribute;
|
|
|
|
// Children
|
|
XmlChildTemplate: OpenXmlPcdata;
|
|
XmlChildTotalTime: OpenXmlPcdata;
|
|
XmlChildPages: OpenXmlPcdata;
|
|
XmlChildWords: OpenXmlPcdata;
|
|
XmlChildCharacters: OpenXmlPcdata;
|
|
XmlChildApplication: OpenXmlPcdata;
|
|
XmlChildDocSecurity: OpenXmlPcdata;
|
|
XmlChildLines: OpenXmlPcdata;
|
|
XmlChildParagraphs: OpenXmlPcdata;
|
|
XmlChildScaleCrop: OpenXmlPcdata;
|
|
XmlChildCompany: OpenXmlPcdata;
|
|
XmlChildLinksUpToDate: OpenXmlPcdata;
|
|
XmlChildCharactersWithSpaces: OpenXmlPcdata;
|
|
XmlChildSharedDoc: OpenXmlPcdata;
|
|
XmlChildHyperlinksChanged: OpenXmlPcdata;
|
|
XmlChildAppVersion: OpenXmlPcdata;
|
|
|
|
end;
|
|
|
|
function Properties.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "", "Properties");
|
|
end;
|
|
|
|
function Properties.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function Properties.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 Properties.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
"xmlns": makeweakref(thisFunction(WriteXmlAttrXmlns)),
|
|
"xmlns:vt": makeweakref(thisFunction(WriteXmlAttrXmlnsVt)),
|
|
);
|
|
sorted_child_ := array(
|
|
"Template": array(0, makeweakref(thisFunction(ReadXmlChildTemplate))),
|
|
"TotalTime": array(1, makeweakref(thisFunction(ReadXmlChildTotalTime))),
|
|
"Pages": array(2, makeweakref(thisFunction(ReadXmlChildPages))),
|
|
"Words": array(3, makeweakref(thisFunction(ReadXmlChildWords))),
|
|
"Characters": array(4, makeweakref(thisFunction(ReadXmlChildCharacters))),
|
|
"Application": array(5, makeweakref(thisFunction(ReadXmlChildApplication))),
|
|
"DocSecurity": array(6, makeweakref(thisFunction(ReadXmlChildDocSecurity))),
|
|
"Lines": array(7, makeweakref(thisFunction(ReadXmlChildLines))),
|
|
"Paragraphs": array(8, makeweakref(thisFunction(ReadXmlChildParagraphs))),
|
|
"ScaleCrop": array(9, makeweakref(thisFunction(ReadXmlChildScaleCrop))),
|
|
"Company": array(10, makeweakref(thisFunction(ReadXmlChildCompany))),
|
|
"LinksUpToDate": array(11, makeweakref(thisFunction(ReadXmlChildLinksUpToDate))),
|
|
"charactersWithSpaces": array(12, makeweakref(thisFunction(ReadXmlChildCharactersWithSpaces))),
|
|
"SharedDoc": array(13, makeweakref(thisFunction(ReadXmlChildSharedDoc))),
|
|
"HyperlinksChanged": array(14, makeweakref(thisFunction(ReadXmlChildHyperlinksChanged))),
|
|
"AppVersion": array(15, makeweakref(thisFunction(ReadXmlChildAppVersion))),
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function Properties.Copy(_obj: Properties);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.Xmlns) then
|
|
{self.}Xmlns := _obj.Xmlns;
|
|
if not ifnil(_obj.XmlnsVt) then
|
|
{self.}XmlnsVt := _obj.XmlnsVt;
|
|
if not ifnil(_obj.XmlChildTemplate) then
|
|
{self.}Template.Copy(_obj.XmlChildTemplate);
|
|
if not ifnil(_obj.XmlChildTotalTime) then
|
|
{self.}TotalTime.Copy(_obj.XmlChildTotalTime);
|
|
if not ifnil(_obj.XmlChildPages) then
|
|
{self.}Pages.Copy(_obj.XmlChildPages);
|
|
if not ifnil(_obj.XmlChildWords) then
|
|
{self.}Words.Copy(_obj.XmlChildWords);
|
|
if not ifnil(_obj.XmlChildCharacters) then
|
|
{self.}Characters.Copy(_obj.XmlChildCharacters);
|
|
if not ifnil(_obj.XmlChildApplication) then
|
|
{self.}Application.Copy(_obj.XmlChildApplication);
|
|
if not ifnil(_obj.XmlChildDocSecurity) then
|
|
{self.}DocSecurity.Copy(_obj.XmlChildDocSecurity);
|
|
if not ifnil(_obj.XmlChildLines) then
|
|
{self.}Lines.Copy(_obj.XmlChildLines);
|
|
if not ifnil(_obj.XmlChildParagraphs) then
|
|
{self.}Paragraphs.Copy(_obj.XmlChildParagraphs);
|
|
if not ifnil(_obj.XmlChildScaleCrop) then
|
|
{self.}ScaleCrop.Copy(_obj.XmlChildScaleCrop);
|
|
if not ifnil(_obj.XmlChildCompany) then
|
|
{self.}Company.Copy(_obj.XmlChildCompany);
|
|
if not ifnil(_obj.XmlChildLinksUpToDate) then
|
|
{self.}LinksUpToDate.Copy(_obj.XmlChildLinksUpToDate);
|
|
if not ifnil(_obj.XmlChildCharactersWithSpaces) then
|
|
{self.}CharactersWithSpaces.Copy(_obj.XmlChildCharactersWithSpaces);
|
|
if not ifnil(_obj.XmlChildSharedDoc) then
|
|
{self.}SharedDoc.Copy(_obj.XmlChildSharedDoc);
|
|
if not ifnil(_obj.XmlChildHyperlinksChanged) then
|
|
{self.}HyperlinksChanged.Copy(_obj.XmlChildHyperlinksChanged);
|
|
if not ifnil(_obj.XmlChildAppVersion) then
|
|
{self.}AppVersion.Copy(_obj.XmlChildAppVersion);
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function Properties.ReadXmlAttrXmlns();
|
|
begin
|
|
return {self.}XmlAttrXmlns.Value;
|
|
end;
|
|
|
|
function Properties.WriteXmlAttrXmlns(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlns) then
|
|
begin
|
|
{self.}XmlAttrXmlns := new OpenXmlAttribute("", "xmlns", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlns;
|
|
end
|
|
{self.}XmlAttrXmlns.Value := _value;
|
|
end;
|
|
|
|
function Properties.ReadXmlAttrXmlnsVt();
|
|
begin
|
|
return {self.}XmlAttrXmlnsVt.Value;
|
|
end;
|
|
|
|
function Properties.WriteXmlAttrXmlnsVt(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlnsVt) then
|
|
begin
|
|
{self.}XmlAttrXmlnsVt := new OpenXmlAttribute("xmlns", "vt", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsVt;
|
|
end
|
|
{self.}XmlAttrXmlnsVt.Value := _value;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildTemplate();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildTemplate) then
|
|
begin
|
|
{self.}XmlChildTemplate := new OpenXmlPcdata(self, "", "Template");
|
|
container_.Set({self.}XmlChildTemplate);
|
|
end
|
|
return {self.}XmlChildTemplate;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildTotalTime();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildTotalTime) then
|
|
begin
|
|
{self.}XmlChildTotalTime := new OpenXmlPcdata(self, "", "TotalTime");
|
|
container_.Set({self.}XmlChildTotalTime);
|
|
end
|
|
return {self.}XmlChildTotalTime;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildPages();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildPages) then
|
|
begin
|
|
{self.}XmlChildPages := new OpenXmlPcdata(self, "", "Pages");
|
|
container_.Set({self.}XmlChildPages);
|
|
end
|
|
return {self.}XmlChildPages;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildWords();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildWords) then
|
|
begin
|
|
{self.}XmlChildWords := new OpenXmlPcdata(self, "", "Words");
|
|
container_.Set({self.}XmlChildWords);
|
|
end
|
|
return {self.}XmlChildWords;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildCharacters();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildCharacters) then
|
|
begin
|
|
{self.}XmlChildCharacters := new OpenXmlPcdata(self, "", "Characters");
|
|
container_.Set({self.}XmlChildCharacters);
|
|
end
|
|
return {self.}XmlChildCharacters;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildApplication();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildApplication) then
|
|
begin
|
|
{self.}XmlChildApplication := new OpenXmlPcdata(self, "", "Application");
|
|
container_.Set({self.}XmlChildApplication);
|
|
end
|
|
return {self.}XmlChildApplication;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildDocSecurity();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildDocSecurity) then
|
|
begin
|
|
{self.}XmlChildDocSecurity := new OpenXmlPcdata(self, "", "DocSecurity");
|
|
container_.Set({self.}XmlChildDocSecurity);
|
|
end
|
|
return {self.}XmlChildDocSecurity;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildLines();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildLines) then
|
|
begin
|
|
{self.}XmlChildLines := new OpenXmlPcdata(self, "", "Lines");
|
|
container_.Set({self.}XmlChildLines);
|
|
end
|
|
return {self.}XmlChildLines;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildParagraphs();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildParagraphs) then
|
|
begin
|
|
{self.}XmlChildParagraphs := new OpenXmlPcdata(self, "", "Paragraphs");
|
|
container_.Set({self.}XmlChildParagraphs);
|
|
end
|
|
return {self.}XmlChildParagraphs;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildScaleCrop();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildScaleCrop) then
|
|
begin
|
|
{self.}XmlChildScaleCrop := new OpenXmlPcdata(self, "", "ScaleCrop");
|
|
container_.Set({self.}XmlChildScaleCrop);
|
|
end
|
|
return {self.}XmlChildScaleCrop;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildCompany();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildCompany) then
|
|
begin
|
|
{self.}XmlChildCompany := new OpenXmlPcdata(self, "", "Company");
|
|
container_.Set({self.}XmlChildCompany);
|
|
end
|
|
return {self.}XmlChildCompany;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildLinksUpToDate();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildLinksUpToDate) then
|
|
begin
|
|
{self.}XmlChildLinksUpToDate := new OpenXmlPcdata(self, "", "LinksUpToDate");
|
|
container_.Set({self.}XmlChildLinksUpToDate);
|
|
end
|
|
return {self.}XmlChildLinksUpToDate;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildCharactersWithSpaces();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildCharactersWithSpaces) then
|
|
begin
|
|
{self.}XmlChildCharactersWithSpaces := new OpenXmlPcdata(self, "", "charactersWithSpaces");
|
|
container_.Set({self.}XmlChildCharactersWithSpaces);
|
|
end
|
|
return {self.}XmlChildCharactersWithSpaces;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildSharedDoc();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildSharedDoc) then
|
|
begin
|
|
{self.}XmlChildSharedDoc := new OpenXmlPcdata(self, "", "SharedDoc");
|
|
container_.Set({self.}XmlChildSharedDoc);
|
|
end
|
|
return {self.}XmlChildSharedDoc;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildHyperlinksChanged();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildHyperlinksChanged) then
|
|
begin
|
|
{self.}XmlChildHyperlinksChanged := new OpenXmlPcdata(self, "", "HyperlinksChanged");
|
|
container_.Set({self.}XmlChildHyperlinksChanged);
|
|
end
|
|
return {self.}XmlChildHyperlinksChanged;
|
|
end;
|
|
|
|
function Properties.ReadXmlChildAppVersion();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildAppVersion) then
|
|
begin
|
|
{self.}XmlChildAppVersion := new OpenXmlPcdata(self, "", "AppVersion");
|
|
container_.Set({self.}XmlChildAppVersion);
|
|
end
|
|
return {self.}XmlChildAppVersion;
|
|
end;
|