380 lines
12 KiB
Plaintext
380 lines
12 KiB
Plaintext
type Styles = 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: Styles);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property XmlnsMc read ReadXmlAttrXmlnsMc write WriteXmlAttrXmlnsMc;
|
|
property XmlnsR read ReadXmlAttrXmlnsR write WriteXmlAttrXmlnsR;
|
|
property XmlnsW read ReadXmlAttrXmlnsW write WriteXmlAttrXmlnsW;
|
|
property XmlnsW14 read ReadXmlAttrXmlnsW14 write WriteXmlAttrXmlnsW14;
|
|
property XmlnsW15 read ReadXmlAttrXmlnsW15 write WriteXmlAttrXmlnsW15;
|
|
property XmlnsW16Cex read ReadXmlAttrXmlnsW16Cex write WriteXmlAttrXmlnsW16Cex;
|
|
property XmlnsW16Cid read ReadXmlAttrXmlnsW16Cid write WriteXmlAttrXmlnsW16Cid;
|
|
property XmlnsW16 read ReadXmlAttrXmlnsW16 write WriteXmlAttrXmlnsW16;
|
|
property XmlnsW16Du read ReadXmlAttrXmlnsW16Du write WriteXmlAttrXmlnsW16Du;
|
|
property XmlnsW16sdtdh read ReadXmlAttrXmlnsW16sdtdh write WriteXmlAttrXmlnsW16sdtdh;
|
|
property XmlnsW16se read ReadXmlAttrXmlnsW16se write WriteXmlAttrXmlnsW16se;
|
|
property McIgnorable read ReadXmlAttrMcIgnorable write WriteXmlAttrMcIgnorable;
|
|
function ReadXmlAttrXmlnsMc();
|
|
function WriteXmlAttrXmlnsMc(_value);
|
|
function ReadXmlAttrXmlnsR();
|
|
function WriteXmlAttrXmlnsR(_value);
|
|
function ReadXmlAttrXmlnsW();
|
|
function WriteXmlAttrXmlnsW(_value);
|
|
function ReadXmlAttrXmlnsW14();
|
|
function WriteXmlAttrXmlnsW14(_value);
|
|
function ReadXmlAttrXmlnsW15();
|
|
function WriteXmlAttrXmlnsW15(_value);
|
|
function ReadXmlAttrXmlnsW16Cex();
|
|
function WriteXmlAttrXmlnsW16Cex(_value);
|
|
function ReadXmlAttrXmlnsW16Cid();
|
|
function WriteXmlAttrXmlnsW16Cid(_value);
|
|
function ReadXmlAttrXmlnsW16();
|
|
function WriteXmlAttrXmlnsW16(_value);
|
|
function ReadXmlAttrXmlnsW16Du();
|
|
function WriteXmlAttrXmlnsW16Du(_value);
|
|
function ReadXmlAttrXmlnsW16sdtdh();
|
|
function WriteXmlAttrXmlnsW16sdtdh(_value);
|
|
function ReadXmlAttrXmlnsW16se();
|
|
function WriteXmlAttrXmlnsW16se(_value);
|
|
function ReadXmlAttrMcIgnorable();
|
|
function WriteXmlAttrMcIgnorable(_value);
|
|
|
|
// normal property
|
|
property DocDefaults read ReadXmlChildDocDefaults;
|
|
property LatenStyles read ReadXmlChildLatenStyles;
|
|
function ReadXmlChildDocDefaults();
|
|
function ReadXmlChildLatenStyles();
|
|
|
|
// multi property
|
|
property Styles read ReadStyles;
|
|
function ReadStyles(_index);
|
|
function AddStyle(): Style;
|
|
function AppendStyle(): Style;
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrXmlnsMc: OpenXmlAttribute;
|
|
XmlAttrXmlnsR: OpenXmlAttribute;
|
|
XmlAttrXmlnsW: OpenXmlAttribute;
|
|
XmlAttrXmlnsW14: OpenXmlAttribute;
|
|
XmlAttrXmlnsW15: OpenXmlAttribute;
|
|
XmlAttrXmlnsW16Cex: OpenXmlAttribute;
|
|
XmlAttrXmlnsW16Cid: OpenXmlAttribute;
|
|
XmlAttrXmlnsW16: OpenXmlAttribute;
|
|
XmlAttrXmlnsW16Du: OpenXmlAttribute;
|
|
XmlAttrXmlnsW16sdtdh: OpenXmlAttribute;
|
|
XmlAttrXmlnsW16se: OpenXmlAttribute;
|
|
XmlAttrMcIgnorable: OpenXmlAttribute;
|
|
|
|
// Children
|
|
XmlChildDocDefaults: DocDefaults;
|
|
XmlChildLatenStyles: LatenStyles;
|
|
|
|
end;
|
|
|
|
function Styles.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "w", "styles");
|
|
end;
|
|
|
|
function Styles.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function Styles.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 Styles.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
"xmlns:mc": makeweakref(thisFunction(WriteXmlAttrXmlnsMc)),
|
|
"xmlns:r": makeweakref(thisFunction(WriteXmlAttrXmlnsR)),
|
|
"xmlns:w": makeweakref(thisFunction(WriteXmlAttrXmlnsW)),
|
|
"xmlns:w14": makeweakref(thisFunction(WriteXmlAttrXmlnsW14)),
|
|
"xmlns:w15": makeweakref(thisFunction(WriteXmlAttrXmlnsW15)),
|
|
"xmlns:w16cex": makeweakref(thisFunction(WriteXmlAttrXmlnsW16Cex)),
|
|
"xmlns:w16cid": makeweakref(thisFunction(WriteXmlAttrXmlnsW16Cid)),
|
|
"xmlns:w16": makeweakref(thisFunction(WriteXmlAttrXmlnsW16)),
|
|
"xmlns:w16du": makeweakref(thisFunction(WriteXmlAttrXmlnsW16Du)),
|
|
"xmlns:w16sdtdh": makeweakref(thisFunction(WriteXmlAttrXmlnsW16sdtdh)),
|
|
"xmlns:w16se": makeweakref(thisFunction(WriteXmlAttrXmlnsW16se)),
|
|
"mc:Ignorable": makeweakref(thisFunction(WriteXmlAttrMcIgnorable)),
|
|
);
|
|
sorted_child_ := array(
|
|
pre + "docDefaults": array(0, makeweakref(thisFunction(ReadXmlChildDocDefaults))),
|
|
pre + "latenStyles": array(1, makeweakref(thisFunction(ReadXmlChildLatenStyles))),
|
|
pre + "style": array(2, makeweakref(thisFunction(AppendStyle))),
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function Styles.Copy(_obj: Styles);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.XmlnsMc) then
|
|
{self.}XmlnsMc := _obj.XmlnsMc;
|
|
if not ifnil(_obj.XmlnsR) then
|
|
{self.}XmlnsR := _obj.XmlnsR;
|
|
if not ifnil(_obj.XmlnsW) then
|
|
{self.}XmlnsW := _obj.XmlnsW;
|
|
if not ifnil(_obj.XmlnsW14) then
|
|
{self.}XmlnsW14 := _obj.XmlnsW14;
|
|
if not ifnil(_obj.XmlnsW15) then
|
|
{self.}XmlnsW15 := _obj.XmlnsW15;
|
|
if not ifnil(_obj.XmlnsW16Cex) then
|
|
{self.}XmlnsW16Cex := _obj.XmlnsW16Cex;
|
|
if not ifnil(_obj.XmlnsW16Cid) then
|
|
{self.}XmlnsW16Cid := _obj.XmlnsW16Cid;
|
|
if not ifnil(_obj.XmlnsW16) then
|
|
{self.}XmlnsW16 := _obj.XmlnsW16;
|
|
if not ifnil(_obj.XmlnsW16Du) then
|
|
{self.}XmlnsW16Du := _obj.XmlnsW16Du;
|
|
if not ifnil(_obj.XmlnsW16sdtdh) then
|
|
{self.}XmlnsW16sdtdh := _obj.XmlnsW16sdtdh;
|
|
if not ifnil(_obj.XmlnsW16se) then
|
|
{self.}XmlnsW16se := _obj.XmlnsW16se;
|
|
if not ifnil(_obj.McIgnorable) then
|
|
{self.}McIgnorable := _obj.McIgnorable;
|
|
if not ifnil(_obj.XmlChildDocDefaults) then
|
|
{self.}DocDefaults.Copy(_obj.XmlChildDocDefaults);
|
|
if not ifnil(_obj.XmlChildLatenStyles) then
|
|
{self.}LatenStyles.Copy(_obj.XmlChildLatenStyles);
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function Styles.ReadXmlAttrXmlnsMc();
|
|
begin
|
|
return {self.}XmlAttrXmlnsMc.Value;
|
|
end;
|
|
|
|
function Styles.WriteXmlAttrXmlnsMc(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlnsMc) then
|
|
begin
|
|
{self.}XmlAttrXmlnsMc := new OpenXmlAttribute("xmlns", "mc", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsMc;
|
|
end
|
|
{self.}XmlAttrXmlnsMc.Value := _value;
|
|
end;
|
|
|
|
function Styles.ReadXmlAttrXmlnsR();
|
|
begin
|
|
return {self.}XmlAttrXmlnsR.Value;
|
|
end;
|
|
|
|
function Styles.WriteXmlAttrXmlnsR(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlnsR) then
|
|
begin
|
|
{self.}XmlAttrXmlnsR := new OpenXmlAttribute("xmlns", "r", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsR;
|
|
end
|
|
{self.}XmlAttrXmlnsR.Value := _value;
|
|
end;
|
|
|
|
function Styles.ReadXmlAttrXmlnsW();
|
|
begin
|
|
return {self.}XmlAttrXmlnsW.Value;
|
|
end;
|
|
|
|
function Styles.WriteXmlAttrXmlnsW(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlnsW) then
|
|
begin
|
|
{self.}XmlAttrXmlnsW := new OpenXmlAttribute("xmlns", "w", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW;
|
|
end
|
|
{self.}XmlAttrXmlnsW.Value := _value;
|
|
end;
|
|
|
|
function Styles.ReadXmlAttrXmlnsW14();
|
|
begin
|
|
return {self.}XmlAttrXmlnsW14.Value;
|
|
end;
|
|
|
|
function Styles.WriteXmlAttrXmlnsW14(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlnsW14) then
|
|
begin
|
|
{self.}XmlAttrXmlnsW14 := new OpenXmlAttribute("xmlns", "w14", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW14;
|
|
end
|
|
{self.}XmlAttrXmlnsW14.Value := _value;
|
|
end;
|
|
|
|
function Styles.ReadXmlAttrXmlnsW15();
|
|
begin
|
|
return {self.}XmlAttrXmlnsW15.Value;
|
|
end;
|
|
|
|
function Styles.WriteXmlAttrXmlnsW15(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlnsW15) then
|
|
begin
|
|
{self.}XmlAttrXmlnsW15 := new OpenXmlAttribute("xmlns", "w15", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW15;
|
|
end
|
|
{self.}XmlAttrXmlnsW15.Value := _value;
|
|
end;
|
|
|
|
function Styles.ReadXmlAttrXmlnsW16Cex();
|
|
begin
|
|
return {self.}XmlAttrXmlnsW16Cex.Value;
|
|
end;
|
|
|
|
function Styles.WriteXmlAttrXmlnsW16Cex(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlnsW16Cex) then
|
|
begin
|
|
{self.}XmlAttrXmlnsW16Cex := new OpenXmlAttribute("xmlns", "w16cex", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW16Cex;
|
|
end
|
|
{self.}XmlAttrXmlnsW16Cex.Value := _value;
|
|
end;
|
|
|
|
function Styles.ReadXmlAttrXmlnsW16Cid();
|
|
begin
|
|
return {self.}XmlAttrXmlnsW16Cid.Value;
|
|
end;
|
|
|
|
function Styles.WriteXmlAttrXmlnsW16Cid(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlnsW16Cid) then
|
|
begin
|
|
{self.}XmlAttrXmlnsW16Cid := new OpenXmlAttribute("xmlns", "w16cid", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW16Cid;
|
|
end
|
|
{self.}XmlAttrXmlnsW16Cid.Value := _value;
|
|
end;
|
|
|
|
function Styles.ReadXmlAttrXmlnsW16();
|
|
begin
|
|
return {self.}XmlAttrXmlnsW16.Value;
|
|
end;
|
|
|
|
function Styles.WriteXmlAttrXmlnsW16(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlnsW16) then
|
|
begin
|
|
{self.}XmlAttrXmlnsW16 := new OpenXmlAttribute("xmlns", "w16", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW16;
|
|
end
|
|
{self.}XmlAttrXmlnsW16.Value := _value;
|
|
end;
|
|
|
|
function Styles.ReadXmlAttrXmlnsW16Du();
|
|
begin
|
|
return {self.}XmlAttrXmlnsW16Du.Value;
|
|
end;
|
|
|
|
function Styles.WriteXmlAttrXmlnsW16Du(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlnsW16Du) then
|
|
begin
|
|
{self.}XmlAttrXmlnsW16Du := new OpenXmlAttribute("xmlns", "w16du", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW16Du;
|
|
end
|
|
{self.}XmlAttrXmlnsW16Du.Value := _value;
|
|
end;
|
|
|
|
function Styles.ReadXmlAttrXmlnsW16sdtdh();
|
|
begin
|
|
return {self.}XmlAttrXmlnsW16sdtdh.Value;
|
|
end;
|
|
|
|
function Styles.WriteXmlAttrXmlnsW16sdtdh(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlnsW16sdtdh) then
|
|
begin
|
|
{self.}XmlAttrXmlnsW16sdtdh := new OpenXmlAttribute("xmlns", "w16sdtdh", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW16sdtdh;
|
|
end
|
|
{self.}XmlAttrXmlnsW16sdtdh.Value := _value;
|
|
end;
|
|
|
|
function Styles.ReadXmlAttrXmlnsW16se();
|
|
begin
|
|
return {self.}XmlAttrXmlnsW16se.Value;
|
|
end;
|
|
|
|
function Styles.WriteXmlAttrXmlnsW16se(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlnsW16se) then
|
|
begin
|
|
{self.}XmlAttrXmlnsW16se := new OpenXmlAttribute("xmlns", "w16se", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW16se;
|
|
end
|
|
{self.}XmlAttrXmlnsW16se.Value := _value;
|
|
end;
|
|
|
|
function Styles.ReadXmlAttrMcIgnorable();
|
|
begin
|
|
return {self.}XmlAttrMcIgnorable.Value;
|
|
end;
|
|
|
|
function Styles.WriteXmlAttrMcIgnorable(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrMcIgnorable) then
|
|
begin
|
|
{self.}XmlAttrMcIgnorable := new OpenXmlAttribute("mc", "Ignorable", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrMcIgnorable;
|
|
end
|
|
{self.}XmlAttrMcIgnorable.Value := _value;
|
|
end;
|
|
|
|
function Styles.ReadXmlChildDocDefaults();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildDocDefaults) then
|
|
begin
|
|
{self.}XmlChildDocDefaults := new DocDefaults(self, {self.}Prefix, "docDefaults");
|
|
container_.Set({self.}XmlChildDocDefaults);
|
|
end
|
|
return {self.}XmlChildDocDefaults;
|
|
end;
|
|
|
|
function Styles.ReadXmlChildLatenStyles();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildLatenStyles) then
|
|
begin
|
|
{self.}XmlChildLatenStyles := new LatenStyles(self, {self.}Prefix, "latenStyles");
|
|
container_.Set({self.}XmlChildLatenStyles);
|
|
end
|
|
return {self.}XmlChildLatenStyles;
|
|
end;
|
|
|
|
function Styles.ReadStyles(_index);
|
|
begin
|
|
ind := ifnil(_index) ? -2 : _index;
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
return container_.Get(pre + "style", ind);
|
|
end;
|
|
|
|
function Styles.AddStyle(): Style;
|
|
begin
|
|
obj := new Style(self, {self.}Prefix, "style");
|
|
container_.Insert(obj);
|
|
return obj;
|
|
end;
|
|
|
|
function Styles.AppendStyle(): Style;
|
|
begin
|
|
obj := new Style(self, {self.}Prefix, "style");
|
|
container_.Append(obj);
|
|
return obj;
|
|
end;
|