type ClrScheme = 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: ClrScheme);override; public // attributes property property Name read ReadXmlAttrName write WriteXmlAttrName; function ReadXmlAttrName(); function WriteXmlAttrName(_value); // normal property property Dk1 read ReadXmlChildDk1; property Lt1 read ReadXmlChildLt1; property Dk2 read ReadXmlChildDk2; property Lt2 read ReadXmlChildLt2; property Accent1 read ReadXmlChildAccent1; property Accent2 read ReadXmlChildAccent2; property Accent3 read ReadXmlChildAccent3; property Accent4 read ReadXmlChildAccent4; property Accent5 read ReadXmlChildAccent5; property Accent6 read ReadXmlChildAccent6; property Hlink read ReadXmlChildHlink; property FolHlink read ReadXmlChildFolHlink; function ReadXmlChildDk1(); function ReadXmlChildLt1(); function ReadXmlChildDk2(); function ReadXmlChildLt2(); function ReadXmlChildAccent1(); function ReadXmlChildAccent2(); function ReadXmlChildAccent3(); function ReadXmlChildAccent4(); function ReadXmlChildAccent5(); function ReadXmlChildAccent6(); function ReadXmlChildHlink(); function ReadXmlChildFolHlink(); public // Attributes XmlAttrName: OpenXmlAttribute; // Children XmlChildDk1: Clr1; XmlChildLt1: Clr1; XmlChildDk2: Clr2; XmlChildLt2: Clr2; XmlChildAccent1: Clr2; XmlChildAccent2: Clr2; XmlChildAccent3: Clr2; XmlChildAccent4: Clr2; XmlChildAccent5: Clr2; XmlChildAccent6: Clr2; XmlChildHlink: Clr2; XmlChildFolHlink: Clr2; end; function ClrScheme.Create();overload; begin {self.}Create(nil, "a", "clrsCheme"); end; function ClrScheme.Create(_node: XmlNode);overload; begin class(OpenXmlElement).Create(_node: XmlNode); end; function ClrScheme.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 ClrScheme.Init();override; begin pre := {self.}Prefix ? {self.}Prefix + ":" : ""; attributes_ := array(); attributes_pf_ := array( "name": makeweakref(thisFunction(WriteXmlAttrName)), ); sorted_child_ := array( pre + "dk1": array(0, makeweakref(thisFunction(ReadXmlChildDk1))), pre + "lt1": array(1, makeweakref(thisFunction(ReadXmlChildLt1))), pre + "dk2": array(2, makeweakref(thisFunction(ReadXmlChildDk2))), pre + "lt2": array(3, makeweakref(thisFunction(ReadXmlChildLt2))), pre + "accent1": array(4, makeweakref(thisFunction(ReadXmlChildAccent1))), pre + "accent2": array(5, makeweakref(thisFunction(ReadXmlChildAccent2))), pre + "accent3": array(6, makeweakref(thisFunction(ReadXmlChildAccent3))), pre + "accent4": array(7, makeweakref(thisFunction(ReadXmlChildAccent4))), pre + "accent5": array(8, makeweakref(thisFunction(ReadXmlChildAccent5))), pre + "accent6": array(9, makeweakref(thisFunction(ReadXmlChildAccent6))), pre + "hlink": array(10, makeweakref(thisFunction(ReadXmlChildHlink))), pre + "folHlink": array(11, makeweakref(thisFunction(ReadXmlChildFolHlink))), ); container_ := new TSOfficeContainer(sorted_child_); end; function ClrScheme.Copy(_obj: ClrScheme);override; begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); if not ifnil(_obj.Name) then {self.}Name := _obj.Name; if not ifnil(_obj.XmlChildDk1) then {self.}Dk1.Copy(_obj.XmlChildDk1); if not ifnil(_obj.XmlChildLt1) then {self.}Lt1.Copy(_obj.XmlChildLt1); if not ifnil(_obj.XmlChildDk2) then {self.}Dk2.Copy(_obj.XmlChildDk2); if not ifnil(_obj.XmlChildLt2) then {self.}Lt2.Copy(_obj.XmlChildLt2); if not ifnil(_obj.XmlChildAccent1) then {self.}Accent1.Copy(_obj.XmlChildAccent1); if not ifnil(_obj.XmlChildAccent2) then {self.}Accent2.Copy(_obj.XmlChildAccent2); if not ifnil(_obj.XmlChildAccent3) then {self.}Accent3.Copy(_obj.XmlChildAccent3); if not ifnil(_obj.XmlChildAccent4) then {self.}Accent4.Copy(_obj.XmlChildAccent4); if not ifnil(_obj.XmlChildAccent5) then {self.}Accent5.Copy(_obj.XmlChildAccent5); if not ifnil(_obj.XmlChildAccent6) then {self.}Accent6.Copy(_obj.XmlChildAccent6); if not ifnil(_obj.XmlChildHlink) then {self.}Hlink.Copy(_obj.XmlChildHlink); if not ifnil(_obj.XmlChildFolHlink) then {self.}FolHlink.Copy(_obj.XmlChildFolHlink); tslassigning := tslassigning_backup; end; function ClrScheme.ReadXmlAttrName(); begin return {self.}XmlAttrName.Value; end; function ClrScheme.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 ClrScheme.ReadXmlChildDk1(); begin if tslassigning and ifnil({self.}XmlChildDk1) then begin {self.}XmlChildDk1 := new Clr1(self, {self.}Prefix, "dk1"); container_.Set({self.}XmlChildDk1); end return {self.}XmlChildDk1; end; function ClrScheme.ReadXmlChildLt1(); begin if tslassigning and ifnil({self.}XmlChildLt1) then begin {self.}XmlChildLt1 := new Clr1(self, {self.}Prefix, "lt1"); container_.Set({self.}XmlChildLt1); end return {self.}XmlChildLt1; end; function ClrScheme.ReadXmlChildDk2(); begin if tslassigning and ifnil({self.}XmlChildDk2) then begin {self.}XmlChildDk2 := new Clr2(self, {self.}Prefix, "dk2"); container_.Set({self.}XmlChildDk2); end return {self.}XmlChildDk2; end; function ClrScheme.ReadXmlChildLt2(); begin if tslassigning and ifnil({self.}XmlChildLt2) then begin {self.}XmlChildLt2 := new Clr2(self, {self.}Prefix, "lt2"); container_.Set({self.}XmlChildLt2); end return {self.}XmlChildLt2; end; function ClrScheme.ReadXmlChildAccent1(); begin if tslassigning and ifnil({self.}XmlChildAccent1) then begin {self.}XmlChildAccent1 := new Clr2(self, {self.}Prefix, "accent1"); container_.Set({self.}XmlChildAccent1); end return {self.}XmlChildAccent1; end; function ClrScheme.ReadXmlChildAccent2(); begin if tslassigning and ifnil({self.}XmlChildAccent2) then begin {self.}XmlChildAccent2 := new Clr2(self, {self.}Prefix, "accent2"); container_.Set({self.}XmlChildAccent2); end return {self.}XmlChildAccent2; end; function ClrScheme.ReadXmlChildAccent3(); begin if tslassigning and ifnil({self.}XmlChildAccent3) then begin {self.}XmlChildAccent3 := new Clr2(self, {self.}Prefix, "accent3"); container_.Set({self.}XmlChildAccent3); end return {self.}XmlChildAccent3; end; function ClrScheme.ReadXmlChildAccent4(); begin if tslassigning and ifnil({self.}XmlChildAccent4) then begin {self.}XmlChildAccent4 := new Clr2(self, {self.}Prefix, "accent4"); container_.Set({self.}XmlChildAccent4); end return {self.}XmlChildAccent4; end; function ClrScheme.ReadXmlChildAccent5(); begin if tslassigning and ifnil({self.}XmlChildAccent5) then begin {self.}XmlChildAccent5 := new Clr2(self, {self.}Prefix, "accent5"); container_.Set({self.}XmlChildAccent5); end return {self.}XmlChildAccent5; end; function ClrScheme.ReadXmlChildAccent6(); begin if tslassigning and ifnil({self.}XmlChildAccent6) then begin {self.}XmlChildAccent6 := new Clr2(self, {self.}Prefix, "accent6"); container_.Set({self.}XmlChildAccent6); end return {self.}XmlChildAccent6; end; function ClrScheme.ReadXmlChildHlink(); begin if tslassigning and ifnil({self.}XmlChildHlink) then begin {self.}XmlChildHlink := new Clr2(self, {self.}Prefix, "hlink"); container_.Set({self.}XmlChildHlink); end return {self.}XmlChildHlink; end; function ClrScheme.ReadXmlChildFolHlink(); begin if tslassigning and ifnil({self.}XmlChildFolHlink) then begin {self.}XmlChildFolHlink := new Clr2(self, {self.}Prefix, "folHlink"); container_.Set({self.}XmlChildFolHlink); end return {self.}XmlChildFolHlink; end;