OfficeXml/autoclass/docx/CoreProperties@DOCX.tsf

326 lines
11 KiB
Plaintext

type CoreProperties = 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: CoreProperties);override;
public
// attributes property
property XmlnsCp read ReadXmlAttrXmlnsCp write WriteXmlAttrXmlnsCp;
property XmlnsDc read ReadXmlAttrXmlnsDc write WriteXmlAttrXmlnsDc;
property XmlnsDcterms read ReadXmlAttrXmlnsDcterms write WriteXmlAttrXmlnsDcterms;
property XmlnsDcmitype read ReadXmlAttrXmlnsDcmitype write WriteXmlAttrXmlnsDcmitype;
property XmlnsXsi read ReadXmlAttrXmlnsXsi write WriteXmlAttrXmlnsXsi;
function ReadXmlAttrXmlnsCp();
function WriteXmlAttrXmlnsCp(_value);
function ReadXmlAttrXmlnsDc();
function WriteXmlAttrXmlnsDc(_value);
function ReadXmlAttrXmlnsDcterms();
function WriteXmlAttrXmlnsDcterms(_value);
function ReadXmlAttrXmlnsDcmitype();
function WriteXmlAttrXmlnsDcmitype(_value);
function ReadXmlAttrXmlnsXsi();
function WriteXmlAttrXmlnsXsi(_value);
// pcdata property
property Title read ReadXmlChildTitle;
property Subject read ReadXmlChildSubject;
property Creator read ReadXmlChildCreator;
property Keywords read ReadXmlChildKeywords;
property Description read ReadXmlChildDescription;
property LastModifiedBy read ReadXmlChildLastModifiedBy;
property Revision read ReadXmlChildRevision;
property LastPrinted read ReadXmlChildLastPrinted;
property Created read ReadXmlChildCreated;
property Modified read ReadXmlChildModified;
function ReadXmlChildTitle();
function ReadXmlChildSubject();
function ReadXmlChildCreator();
function ReadXmlChildKeywords();
function ReadXmlChildDescription();
function ReadXmlChildLastModifiedBy();
function ReadXmlChildRevision();
function ReadXmlChildLastPrinted();
function ReadXmlChildCreated();
function ReadXmlChildModified();
public
// Attributes
XmlAttrXmlnsCp: OpenXmlAttribute;
XmlAttrXmlnsDc: OpenXmlAttribute;
XmlAttrXmlnsDcterms: OpenXmlAttribute;
XmlAttrXmlnsDcmitype: OpenXmlAttribute;
XmlAttrXmlnsXsi: OpenXmlAttribute;
// Children
XmlChildTitle: OpenXmlPcdata;
XmlChildSubject: OpenXmlPcdata;
XmlChildCreator: OpenXmlPcdata;
XmlChildKeywords: OpenXmlPcdata;
XmlChildDescription: OpenXmlPcdata;
XmlChildLastModifiedBy: OpenXmlPcdata;
XmlChildRevision: OpenXmlPcdata;
XmlChildLastPrinted: OpenXmlPcdata;
XmlChildCreated: Created;
XmlChildModified: Modified;
end;
function CoreProperties.Create();overload;
begin
{self.}Create(nil, "cp", "coreProperties");
end;
function CoreProperties.Create(_node: XmlNode);overload;
begin
class(OpenXmlElement).Create(_node: XmlNode);
end;
function CoreProperties.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 CoreProperties.Init();override;
begin
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
attributes_ := array();
attributes_pf_ := array(
"xmlns:cp": makeweakref(thisFunction(WriteXmlAttrXmlnsCp)),
"xmlns:dc": makeweakref(thisFunction(WriteXmlAttrXmlnsDc)),
"xmlns:dcterms": makeweakref(thisFunction(WriteXmlAttrXmlnsDcterms)),
"xmlns:dcmitype": makeweakref(thisFunction(WriteXmlAttrXmlnsDcmitype)),
"xmlns:xsi": makeweakref(thisFunction(WriteXmlAttrXmlnsXsi)),
);
sorted_child_ := array(
"dc:title": array(0, makeweakref(thisFunction(ReadXmlChildTitle))),
"dc:subject": array(1, makeweakref(thisFunction(ReadXmlChildSubject))),
"dc:creator": array(2, makeweakref(thisFunction(ReadXmlChildCreator))),
"cp:keywords": array(3, makeweakref(thisFunction(ReadXmlChildKeywords))),
"cp:description": array(4, makeweakref(thisFunction(ReadXmlChildDescription))),
"cp:lastModifiedBy": array(5, makeweakref(thisFunction(ReadXmlChildLastModifiedBy))),
"cp:revision": array(6, makeweakref(thisFunction(ReadXmlChildRevision))),
"cp:lastPrinted": array(7, makeweakref(thisFunction(ReadXmlChildLastPrinted))),
"dcterms:created": array(8, makeweakref(thisFunction(ReadXmlChildCreated))),
"dcterms:modified": array(9, makeweakref(thisFunction(ReadXmlChildModified))),
);
container_ := new TSOfficeContainer(sorted_child_);
end;
function CoreProperties.Copy(_obj: CoreProperties);override;
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.XmlnsCp) then
{self.}XmlnsCp := _obj.XmlnsCp;
if not ifnil(_obj.XmlnsDc) then
{self.}XmlnsDc := _obj.XmlnsDc;
if not ifnil(_obj.XmlnsDcterms) then
{self.}XmlnsDcterms := _obj.XmlnsDcterms;
if not ifnil(_obj.XmlnsDcmitype) then
{self.}XmlnsDcmitype := _obj.XmlnsDcmitype;
if not ifnil(_obj.XmlnsXsi) then
{self.}XmlnsXsi := _obj.XmlnsXsi;
if not ifnil(_obj.XmlChildTitle) then
{self.}Title.Copy(_obj.XmlChildTitle);
if not ifnil(_obj.XmlChildSubject) then
{self.}Subject.Copy(_obj.XmlChildSubject);
if not ifnil(_obj.XmlChildCreator) then
{self.}Creator.Copy(_obj.XmlChildCreator);
if not ifnil(_obj.XmlChildKeywords) then
{self.}Keywords.Copy(_obj.XmlChildKeywords);
if not ifnil(_obj.XmlChildDescription) then
{self.}Description.Copy(_obj.XmlChildDescription);
if not ifnil(_obj.XmlChildLastModifiedBy) then
{self.}LastModifiedBy.Copy(_obj.XmlChildLastModifiedBy);
if not ifnil(_obj.XmlChildRevision) then
{self.}Revision.Copy(_obj.XmlChildRevision);
if not ifnil(_obj.XmlChildLastPrinted) then
{self.}LastPrinted.Copy(_obj.XmlChildLastPrinted);
if not ifnil(_obj.XmlChildCreated) then
{self.}Created.Copy(_obj.XmlChildCreated);
if not ifnil(_obj.XmlChildModified) then
{self.}Modified.Copy(_obj.XmlChildModified);
tslassigning := tslassigning_backup;
end;
function CoreProperties.ReadXmlAttrXmlnsCp();
begin
return {self.}XmlAttrXmlnsCp.Value;
end;
function CoreProperties.WriteXmlAttrXmlnsCp(_value);
begin
if ifnil({self.}XmlAttrXmlnsCp) then
begin
{self.}XmlAttrXmlnsCp := new OpenXmlAttribute("xmlns", "cp", nil);
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsCp;
end
{self.}XmlAttrXmlnsCp.Value := _value;
end;
function CoreProperties.ReadXmlAttrXmlnsDc();
begin
return {self.}XmlAttrXmlnsDc.Value;
end;
function CoreProperties.WriteXmlAttrXmlnsDc(_value);
begin
if ifnil({self.}XmlAttrXmlnsDc) then
begin
{self.}XmlAttrXmlnsDc := new OpenXmlAttribute("xmlns", "dc", nil);
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsDc;
end
{self.}XmlAttrXmlnsDc.Value := _value;
end;
function CoreProperties.ReadXmlAttrXmlnsDcterms();
begin
return {self.}XmlAttrXmlnsDcterms.Value;
end;
function CoreProperties.WriteXmlAttrXmlnsDcterms(_value);
begin
if ifnil({self.}XmlAttrXmlnsDcterms) then
begin
{self.}XmlAttrXmlnsDcterms := new OpenXmlAttribute("xmlns", "dcterms", nil);
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsDcterms;
end
{self.}XmlAttrXmlnsDcterms.Value := _value;
end;
function CoreProperties.ReadXmlAttrXmlnsDcmitype();
begin
return {self.}XmlAttrXmlnsDcmitype.Value;
end;
function CoreProperties.WriteXmlAttrXmlnsDcmitype(_value);
begin
if ifnil({self.}XmlAttrXmlnsDcmitype) then
begin
{self.}XmlAttrXmlnsDcmitype := new OpenXmlAttribute("xmlns", "dcmitype", nil);
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsDcmitype;
end
{self.}XmlAttrXmlnsDcmitype.Value := _value;
end;
function CoreProperties.ReadXmlAttrXmlnsXsi();
begin
return {self.}XmlAttrXmlnsXsi.Value;
end;
function CoreProperties.WriteXmlAttrXmlnsXsi(_value);
begin
if ifnil({self.}XmlAttrXmlnsXsi) then
begin
{self.}XmlAttrXmlnsXsi := new OpenXmlAttribute("xmlns", "xsi", nil);
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsXsi;
end
{self.}XmlAttrXmlnsXsi.Value := _value;
end;
function CoreProperties.ReadXmlChildTitle();
begin
if tslassigning and ifnil({self.}XmlChildTitle) then
begin
{self.}XmlChildTitle := new OpenXmlPcdata(self, "dc", "title");
container_.Set({self.}XmlChildTitle);
end
return {self.}XmlChildTitle;
end;
function CoreProperties.ReadXmlChildSubject();
begin
if tslassigning and ifnil({self.}XmlChildSubject) then
begin
{self.}XmlChildSubject := new OpenXmlPcdata(self, "dc", "subject");
container_.Set({self.}XmlChildSubject);
end
return {self.}XmlChildSubject;
end;
function CoreProperties.ReadXmlChildCreator();
begin
if tslassigning and ifnil({self.}XmlChildCreator) then
begin
{self.}XmlChildCreator := new OpenXmlPcdata(self, "dc", "creator");
container_.Set({self.}XmlChildCreator);
end
return {self.}XmlChildCreator;
end;
function CoreProperties.ReadXmlChildKeywords();
begin
if tslassigning and ifnil({self.}XmlChildKeywords) then
begin
{self.}XmlChildKeywords := new OpenXmlPcdata(self, "cp", "keywords");
container_.Set({self.}XmlChildKeywords);
end
return {self.}XmlChildKeywords;
end;
function CoreProperties.ReadXmlChildDescription();
begin
if tslassigning and ifnil({self.}XmlChildDescription) then
begin
{self.}XmlChildDescription := new OpenXmlPcdata(self, "cp", "description");
container_.Set({self.}XmlChildDescription);
end
return {self.}XmlChildDescription;
end;
function CoreProperties.ReadXmlChildLastModifiedBy();
begin
if tslassigning and ifnil({self.}XmlChildLastModifiedBy) then
begin
{self.}XmlChildLastModifiedBy := new OpenXmlPcdata(self, "cp", "lastModifiedBy");
container_.Set({self.}XmlChildLastModifiedBy);
end
return {self.}XmlChildLastModifiedBy;
end;
function CoreProperties.ReadXmlChildRevision();
begin
if tslassigning and ifnil({self.}XmlChildRevision) then
begin
{self.}XmlChildRevision := new OpenXmlPcdata(self, "cp", "revision");
container_.Set({self.}XmlChildRevision);
end
return {self.}XmlChildRevision;
end;
function CoreProperties.ReadXmlChildLastPrinted();
begin
if tslassigning and ifnil({self.}XmlChildLastPrinted) then
begin
{self.}XmlChildLastPrinted := new OpenXmlPcdata(self, "cp", "lastPrinted");
container_.Set({self.}XmlChildLastPrinted);
end
return {self.}XmlChildLastPrinted;
end;
function CoreProperties.ReadXmlChildCreated();
begin
if tslassigning and ifnil({self.}XmlChildCreated) then
begin
{self.}XmlChildCreated := new Created(self, "dcterms", "created");
container_.Set({self.}XmlChildCreated);
end
return {self.}XmlChildCreated;
end;
function CoreProperties.ReadXmlChildModified();
begin
if tslassigning and ifnil({self.}XmlChildModified) then
begin
{self.}XmlChildModified := new Modified(self, "dcterms", "modified");
container_.Set({self.}XmlChildModified);
end
return {self.}XmlChildModified;
end;