190 lines
6.4 KiB
Plaintext
190 lines
6.4 KiB
Plaintext
type Theme = 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: Theme);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property XmlnsA read ReadXmlAttrXmlnsA write WriteXmlAttrXmlnsA;
|
|
property Name read ReadXmlAttrName write WriteXmlAttrName;
|
|
function ReadXmlAttrXmlnsA();
|
|
function WriteXmlAttrXmlnsA(_value);
|
|
function ReadXmlAttrName();
|
|
function WriteXmlAttrName(_value);
|
|
|
|
// empty property
|
|
property ObjectDefaults read ReadXmlChildObjectDefaults write WriteXmlChildObjectDefaults;
|
|
property ExtraClrSchemeLst read ReadXmlChildExtraClrSchemeLst write WriteXmlChildExtraClrSchemeLst;
|
|
function ReadXmlChildObjectDefaults();
|
|
function WriteXmlChildObjectDefaults(_value);
|
|
function ReadXmlChildExtraClrSchemeLst();
|
|
function WriteXmlChildExtraClrSchemeLst(_value);
|
|
|
|
// normal property
|
|
property ThemeElements read ReadXmlChildThemeElements;
|
|
property ExtLst read ReadXmlChildExtLst;
|
|
function ReadXmlChildThemeElements();
|
|
function ReadXmlChildExtLst();
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrXmlnsA: OpenXmlAttribute;
|
|
XmlAttrName: OpenXmlAttribute;
|
|
|
|
// Children
|
|
XmlChildThemeElements: ThemeElements;
|
|
XmlChildObjectDefaults: OpenXmlEmpty;
|
|
XmlChildExtraClrSchemeLst: OpenXmlEmpty;
|
|
XmlChildExtLst: ExtLst;
|
|
|
|
end;
|
|
|
|
function Theme.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "a", "theme");
|
|
end;
|
|
|
|
function Theme.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function Theme.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 Theme.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
"xmlns:a": makeweakref(thisFunction(WriteXmlAttrXmlnsA)),
|
|
"name": makeweakref(thisFunction(WriteXmlAttrName)),
|
|
);
|
|
sorted_child_ := array(
|
|
pre + "themeElements": array(0, makeweakref(thisFunction(ReadXmlChildThemeElements))),
|
|
pre + "objectDefaults": array(1, makeweakref(thisFunction(ReadXmlChildObjectDefaults))),
|
|
pre + "extraClrSchemeLst": array(2, makeweakref(thisFunction(ReadXmlChildExtraClrSchemeLst))),
|
|
pre + "extLst": array(3, makeweakref(thisFunction(ReadXmlChildExtLst))),
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function Theme.Copy(_obj: Theme);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.XmlnsA) then
|
|
{self.}XmlnsA := _obj.XmlnsA;
|
|
if not ifnil(_obj.Name) then
|
|
{self.}Name := _obj.Name;
|
|
if not ifnil(_obj.XmlChildThemeElements) then
|
|
{self.}ThemeElements.Copy(_obj.XmlChildThemeElements);
|
|
if not ifnil(_obj.XmlChildObjectDefaults) then
|
|
ifnil({self.}XmlChildObjectDefaults) ? {self.}ObjectDefaults.Copy(_obj.XmlChildObjectDefaults) : {self.}XmlChildObjectDefaults.Copy(_obj.XmlChildObjectDefaults);
|
|
if not ifnil(_obj.XmlChildExtraClrSchemeLst) then
|
|
ifnil({self.}XmlChildExtraClrSchemeLst) ? {self.}ExtraClrSchemeLst.Copy(_obj.XmlChildExtraClrSchemeLst) : {self.}XmlChildExtraClrSchemeLst.Copy(_obj.XmlChildExtraClrSchemeLst);
|
|
if not ifnil(_obj.XmlChildExtLst) then
|
|
{self.}ExtLst.Copy(_obj.XmlChildExtLst);
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function Theme.ReadXmlAttrXmlnsA();
|
|
begin
|
|
return {self.}XmlAttrXmlnsA.Value;
|
|
end;
|
|
|
|
function Theme.WriteXmlAttrXmlnsA(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlnsA) then
|
|
begin
|
|
{self.}XmlAttrXmlnsA := new OpenXmlAttribute("xmlns", "a", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsA;
|
|
end
|
|
{self.}XmlAttrXmlnsA.Value := _value;
|
|
end;
|
|
|
|
function Theme.ReadXmlAttrName();
|
|
begin
|
|
return {self.}XmlAttrName.Value;
|
|
end;
|
|
|
|
function Theme.WriteXmlAttrName(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrName) then
|
|
begin
|
|
{self.}XmlAttrName := new OpenXmlAttribute("", "name", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrName;
|
|
end
|
|
{self.}XmlAttrName.Value := _value;
|
|
end;
|
|
|
|
function Theme.ReadXmlChildObjectDefaults();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildObjectDefaults) then
|
|
begin
|
|
{self.}XmlChildObjectDefaults := new OpenXmlEmpty(self, {self.}Prefix, "objectDefaults");
|
|
container_.Set({self.}XmlChildObjectDefaults);
|
|
return {self.}XmlChildObjectDefaults;
|
|
end
|
|
return {self.}XmlChildObjectDefaults.BoolValue();
|
|
end;
|
|
|
|
function Theme.WriteXmlChildObjectDefaults(_value);
|
|
begin
|
|
if ifnil({self.}XmlChildObjectDefaults) then
|
|
begin
|
|
{self.}XmlChildObjectDefaults := new OpenXmlEmpty(self, {self.}Prefix, "objectDefaults");
|
|
container_.Set({self.}XmlChildObjectDefaults);
|
|
end
|
|
{self.}XmlChildObjectDefaults.Value := _value;
|
|
end;
|
|
|
|
function Theme.ReadXmlChildExtraClrSchemeLst();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildExtraClrSchemeLst) then
|
|
begin
|
|
{self.}XmlChildExtraClrSchemeLst := new OpenXmlEmpty(self, {self.}Prefix, "extraClrSchemeLst");
|
|
container_.Set({self.}XmlChildExtraClrSchemeLst);
|
|
return {self.}XmlChildExtraClrSchemeLst;
|
|
end
|
|
return {self.}XmlChildExtraClrSchemeLst.BoolValue();
|
|
end;
|
|
|
|
function Theme.WriteXmlChildExtraClrSchemeLst(_value);
|
|
begin
|
|
if ifnil({self.}XmlChildExtraClrSchemeLst) then
|
|
begin
|
|
{self.}XmlChildExtraClrSchemeLst := new OpenXmlEmpty(self, {self.}Prefix, "extraClrSchemeLst");
|
|
container_.Set({self.}XmlChildExtraClrSchemeLst);
|
|
end
|
|
{self.}XmlChildExtraClrSchemeLst.Value := _value;
|
|
end;
|
|
|
|
function Theme.ReadXmlChildThemeElements();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildThemeElements) then
|
|
begin
|
|
{self.}XmlChildThemeElements := new ThemeElements(self, {self.}Prefix, "themeElements");
|
|
container_.Set({self.}XmlChildThemeElements);
|
|
end
|
|
return {self.}XmlChildThemeElements;
|
|
end;
|
|
|
|
function Theme.ReadXmlChildExtLst();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildExtLst) then
|
|
begin
|
|
{self.}XmlChildExtLst := new ExtLst(self, {self.}Prefix, "extLst");
|
|
container_.Set({self.}XmlChildExtLst);
|
|
end
|
|
return {self.}XmlChildExtLst;
|
|
end;
|