OfficeXml/autoclass/docx/OuterShdw@DOCX.tsf

190 lines
5.3 KiB
Plaintext

type OuterShdw = 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 InitAttributes();override;
function InitChildren();override;
function InitNode(_node: XmlNode);override;
function Copy(_obj: OuterShdw);override;
property BlurRad read ReadXmlAttrBlurRad write WriteXmlAttrBlurRad;
property Dist read ReadXmlAttrDist write WriteXmlAttrDist;
property Dir read ReadXmlAttrDir write WriteXmlAttrDir;
property Algn read ReadXmlAttrAlgn write WriteXmlAttrAlgn;
property RotWithShape read ReadXmlAttrRotWithShape write WriteXmlAttrRotWithShape;
function ReadXmlAttrBlurRad();
function WriteXmlAttrBlurRad(_value);
function ReadXmlAttrDist();
function WriteXmlAttrDist(_value);
function ReadXmlAttrDir();
function WriteXmlAttrDir(_value);
function ReadXmlAttrAlgn();
function WriteXmlAttrAlgn(_value);
function ReadXmlAttrRotWithShape();
function WriteXmlAttrRotWithShape(_value);
public
// Attributes
XmlAttrBlurRad: OpenXmlAttribute;
XmlAttrDist: OpenXmlAttribute;
XmlAttrDir: OpenXmlAttribute;
XmlAttrAlgn: OpenXmlAttribute;
XmlAttrRotWithShape: OpenXmlAttribute;
// Children
SrgbClr: SrgbClr;
end;
function OuterShdw.Create();overload;
begin
{self.}Create(nil, "a", "outerShdw");
end;
function OuterShdw.Create(_node: XmlNode);overload;
begin
class(OpenXmlElement).Create(_node: XmlNode);
end;
function OuterShdw.Create(_parent: tslobj; _prefix: string; _local_name: string);overload;
begin
class(OpenXmlElement).Create(_parent, _prefix, _local_name);
end;
function OuterShdw.Init();override;
begin
{self.}XmlAttrBlurRad := new OpenXmlAttribute(nil, "blurRad", nil);
{self.}XmlAttrDist := new OpenXmlAttribute(nil, "dist", nil);
{self.}XmlAttrDir := new OpenXmlAttribute(nil, "dir", nil);
{self.}XmlAttrAlgn := new OpenXmlAttribute(nil, "algn", nil);
{self.}XmlAttrRotWithShape := new OpenXmlAttribute(nil, "rotWithShape", nil);
{self.}SrgbClr := new SrgbClr(self, {self.}Prefix, "srgbClr");
end;
function OuterShdw.InitAttributes();override;
begin
attributes_ := array(
{self.}XmlAttrBlurRad,
{self.}XmlAttrDist,
{self.}XmlAttrDir,
{self.}XmlAttrAlgn,
{self.}XmlAttrRotWithShape,
);
end;
function OuterShdw.InitChildren();override;
begin
child_elements_ := array(
0: {self.}SrgbClr,
);
sorted_child_ := array(
"": -1,
{self.}SrgbClr.ElementName: 0,
);
end;
function OuterShdw.InitNode(_node: XmlNode);override;
begin
if ifObj({self.}XmlNode) then
for k,v in child_elements_ do v.InitNode(nil);
{self.}XmlNode := ifObj(_node) ? _node : nil;
node := ifObj(_node) ? _node.FirstChild() : nil;
flag := false;
if ifnil(child_elements_[0]) and length(child_elements_) > 0 then
begin
flag := true;
arr := child_elements_;
child_elements_ := array();
end
pre := ifString({self.}Prefix) ? {self.}Prefix + ":" : "";
while ifObj(node) do
begin
node_name := node.GetName();
pos := sorted_child_[node_name];
if ifnil(pos) or pos = -1 then
begin
obj := nil;
case node_name of
end;
if ifObj(obj) then obj.InitNode(node);
end
else if flag then
begin
obj := arr[pos];
obj.InitNode(node);
child_elements_[length(child_elements_)] := obj;
end
else begin
child_elements_[pos].InitNode(node);
end
node := node.NextElement();
end
end;
function OuterShdw.Copy(_obj: OuterShdw);override;
begin
if not ifnil(_obj.XmlAttrBlurRad.Value) then
{self.}XmlAttrBlurRad.Value := _obj.XmlAttrBlurRad.Value;
if not ifnil(_obj.XmlAttrDist.Value) then
{self.}XmlAttrDist.Value := _obj.XmlAttrDist.Value;
if not ifnil(_obj.XmlAttrDir.Value) then
{self.}XmlAttrDir.Value := _obj.XmlAttrDir.Value;
if not ifnil(_obj.XmlAttrAlgn.Value) then
{self.}XmlAttrAlgn.Value := _obj.XmlAttrAlgn.Value;
if not ifnil(_obj.XmlAttrRotWithShape.Value) then
{self.}XmlAttrRotWithShape.Value := _obj.XmlAttrRotWithShape.Value;
{self.}SrgbClr.Copy(_obj.SrgbClr);
end;
function OuterShdw.ReadXmlAttrBlurRad();
begin
return {self.}XmlAttrBlurRad.Value;
end;
function OuterShdw.WriteXmlAttrBlurRad(_value);
begin
{self.}XmlAttrBlurRad.Value := _value;
end;
function OuterShdw.ReadXmlAttrDist();
begin
return {self.}XmlAttrDist.Value;
end;
function OuterShdw.WriteXmlAttrDist(_value);
begin
{self.}XmlAttrDist.Value := _value;
end;
function OuterShdw.ReadXmlAttrDir();
begin
return {self.}XmlAttrDir.Value;
end;
function OuterShdw.WriteXmlAttrDir(_value);
begin
{self.}XmlAttrDir.Value := _value;
end;
function OuterShdw.ReadXmlAttrAlgn();
begin
return {self.}XmlAttrAlgn.Value;
end;
function OuterShdw.WriteXmlAttrAlgn(_value);
begin
{self.}XmlAttrAlgn.Value := _value;
end;
function OuterShdw.ReadXmlAttrRotWithShape();
begin
return {self.}XmlAttrRotWithShape.Value;
end;
function OuterShdw.WriteXmlAttrRotWithShape(_value);
begin
{self.}XmlAttrRotWithShape.Value := _value;
end;