OfficeXml/autoclass/docx/Default@DOCX.tsf

97 lines
2.7 KiB
Plaintext

type Default = 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: Default);override;
public
// attributes property
property Extension read ReadXmlAttrExtension write WriteXmlAttrExtension;
property ContentType read ReadXmlAttrContentType write WriteXmlAttrContentType;
function ReadXmlAttrExtension();
function WriteXmlAttrExtension(_value);
function ReadXmlAttrContentType();
function WriteXmlAttrContentType(_value);
public
// Attributes
XmlAttrExtension: OpenXmlAttribute;
XmlAttrContentType: OpenXmlAttribute;
end;
function Default.Create();overload;
begin
{self.}Create(nil, "", "Default");
end;
function Default.Create(_node: XmlNode);overload;
begin
class(OpenXmlElement).Create(_node: XmlNode);
end;
function Default.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 Default.Init();override;
begin
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
attributes_ := array();
attributes_pf_ := array(
"Extension": makeweakref(thisFunction(WriteXmlAttrExtension)),
"ContentType": makeweakref(thisFunction(WriteXmlAttrContentType)),
);
sorted_child_ := array(
);
container_ := new TSOfficeContainer(sorted_child_);
end;
function Default.Copy(_obj: Default);override;
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.Extension) then
{self.}Extension := _obj.Extension;
if not ifnil(_obj.ContentType) then
{self.}ContentType := _obj.ContentType;
tslassigning := tslassigning_backup;
end;
function Default.ReadXmlAttrExtension();
begin
return {self.}XmlAttrExtension.Value;
end;
function Default.WriteXmlAttrExtension(_value);
begin
if ifnil({self.}XmlAttrExtension) then
begin
{self.}XmlAttrExtension := new OpenXmlAttribute("", "Extension", nil);
attributes_[length(attributes_)] := {self.}XmlAttrExtension;
end
{self.}XmlAttrExtension.Value := _value;
end;
function Default.ReadXmlAttrContentType();
begin
return {self.}XmlAttrContentType.Value;
end;
function Default.WriteXmlAttrContentType(_value);
begin
if ifnil({self.}XmlAttrContentType) then
begin
{self.}XmlAttrContentType := new OpenXmlAttribute("", "ContentType", nil);
attributes_[length(attributes_)] := {self.}XmlAttrContentType;
end
{self.}XmlAttrContentType.Value := _value;
end;