OfficeXml/autoclass/docx/Legend@DOCX.tsf

130 lines
4.0 KiB
Plaintext

type Legend = 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: Legend);override;
public
// empty property
property Layout read ReadXmlChildLayout write WriteXmlChildLayout;
function ReadXmlChildLayout();
function WriteXmlChildLayout(_value);
// normal property
property LegendPos read ReadXmlChildLegendPos;
property Overlay read ReadXmlChildOverlay;
property TxPr read ReadXmlChildTxPr;
function ReadXmlChildLegendPos();
function ReadXmlChildOverlay();
function ReadXmlChildTxPr();
public
// Children
XmlChildLegendPos: PureVal;
XmlChildLayout: OpenXmlEmpty;
XmlChildOverlay: PureVal;
XmlChildTxPr: TxPr;
end;
function Legend.Create();overload;
begin
{self.}Create(nil, "c", "legend");
end;
function Legend.Create(_node: XmlNode);overload;
begin
class(OpenXmlElement).Create(_node: XmlNode);
end;
function Legend.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 Legend.Init();override;
begin
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
attributes_ := array();
attributes_pf_ := array(
);
sorted_child_ := array(
pre + "legendPos": array(0, makeweakref(thisFunction(ReadXmlChildLegendPos))),
pre + "layout": array(1, makeweakref(thisFunction(ReadXmlChildLayout))),
pre + "overlay": array(2, makeweakref(thisFunction(ReadXmlChildOverlay))),
pre + "txPr": array(3, makeweakref(thisFunction(ReadXmlChildTxPr))),
);
container_ := new TSOfficeContainer(sorted_child_);
end;
function Legend.Copy(_obj: Legend);override;
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.XmlChildLegendPos) then
{self.}LegendPos.Copy(_obj.XmlChildLegendPos);
if not ifnil(_obj.XmlChildLayout) then
ifnil({self.}XmlChildLayout) ? {self.}Layout.Copy(_obj.XmlChildLayout) : {self.}XmlChildLayout.Copy(_obj.XmlChildLayout);
if not ifnil(_obj.XmlChildOverlay) then
{self.}Overlay.Copy(_obj.XmlChildOverlay);
if not ifnil(_obj.XmlChildTxPr) then
{self.}TxPr.Copy(_obj.XmlChildTxPr);
tslassigning := tslassigning_backup;
end;
function Legend.ReadXmlChildLayout();
begin
if tslassigning and ifnil({self.}XmlChildLayout) then
begin
{self.}XmlChildLayout := new OpenXmlEmpty(self, {self.}Prefix, "layout");
container_.Set({self.}XmlChildLayout);
return {self.}XmlChildLayout;
end
return ifnil({self.}XmlChildLayout) ? false : {self.}XmlChildLayout.BoolValue();
end;
function Legend.WriteXmlChildLayout(_value);
begin
if ifnil({self.}XmlChildLayout) then
begin
{self.}XmlChildLayout := new OpenXmlEmpty(self, {self.}Prefix, "layout");
container_.Set({self.}XmlChildLayout);
end
{self.}XmlChildLayout.Value := _value;
end;
function Legend.ReadXmlChildLegendPos();
begin
if tslassigning and ifnil({self.}XmlChildLegendPos) then
begin
{self.}XmlChildLegendPos := new PureVal(self, {self.}Prefix, "legendPos");
container_.Set({self.}XmlChildLegendPos);
end
return {self.}XmlChildLegendPos;
end;
function Legend.ReadXmlChildOverlay();
begin
if tslassigning and ifnil({self.}XmlChildOverlay) then
begin
{self.}XmlChildOverlay := new PureVal(self, {self.}Prefix, "overlay");
container_.Set({self.}XmlChildOverlay);
end
return {self.}XmlChildOverlay;
end;
function Legend.ReadXmlChildTxPr();
begin
if tslassigning and ifnil({self.}XmlChildTxPr) then
begin
{self.}XmlChildTxPr := new TxPr(self, {self.}Prefix, "txPr");
container_.Set({self.}XmlChildTxPr);
end
return {self.}XmlChildTxPr;
end;