OfficeXml/autoclass/docx/Shapetype@DOCX.tsf

296 lines
9.1 KiB
Plaintext

type Shapetype = 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: Shapetype);override;
public
// attributes property
property AnchorId read ReadXmlAttrAnchorId write WriteXmlAttrAnchorId;
property Id read ReadXmlAttrId write WriteXmlAttrId;
property Coordsize read ReadXmlAttrCoordsize write WriteXmlAttrCoordsize;
property Spt read ReadXmlAttrSpt write WriteXmlAttrSpt;
property Preferrelative read ReadXmlAttrPreferrelative write WriteXmlAttrPreferrelative;
property Path read ReadXmlAttrPath write WriteXmlAttrPath;
property Filled read ReadXmlAttrFilled write WriteXmlAttrFilled;
property Stroked read ReadXmlAttrStroked write WriteXmlAttrStroked;
function ReadXmlAttrAnchorId();
function WriteXmlAttrAnchorId(_value);
function ReadXmlAttrId();
function WriteXmlAttrId(_value);
function ReadXmlAttrCoordsize();
function WriteXmlAttrCoordsize(_value);
function ReadXmlAttrSpt();
function WriteXmlAttrSpt(_value);
function ReadXmlAttrPreferrelative();
function WriteXmlAttrPreferrelative(_value);
function ReadXmlAttrPath();
function WriteXmlAttrPath(_value);
function ReadXmlAttrFilled();
function WriteXmlAttrFilled(_value);
function ReadXmlAttrStroked();
function WriteXmlAttrStroked(_value);
// normal property
property Stroke read ReadXmlChildStroke;
property Formulas read ReadXmlChildFormulas;
property Path read ReadXmlChildPath;
property Lock read ReadXmlChildLock;
function ReadXmlChildStroke();
function ReadXmlChildFormulas();
function ReadXmlChildPath();
function ReadXmlChildLock();
public
// Attributes
XmlAttrAnchorId: OpenXmlAttribute;
XmlAttrId: OpenXmlAttribute;
XmlAttrCoordsize: OpenXmlAttribute;
XmlAttrSpt: OpenXmlAttribute;
XmlAttrPreferrelative: OpenXmlAttribute;
XmlAttrPath: OpenXmlAttribute;
XmlAttrFilled: OpenXmlAttribute;
XmlAttrStroked: OpenXmlAttribute;
// Children
XmlChildStroke: Stroke;
XmlChildFormulas: formulas;
XmlChildPath: Path;
XmlChildLock: Lock;
end;
function Shapetype.Create();overload;
begin
{self.}Create(nil, "v", "shapetype");
end;
function Shapetype.Create(_node: XmlNode);overload;
begin
class(OpenXmlElement).Create(_node: XmlNode);
end;
function Shapetype.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 Shapetype.Init();override;
begin
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
attributes_ := array();
attributes_pf_ := array(
"w14:anchorId": makeweakref(thisFunction(WriteXmlAttrAnchorId)),
"id": makeweakref(thisFunction(WriteXmlAttrId)),
"coordsize": makeweakref(thisFunction(WriteXmlAttrCoordsize)),
"o:spt": makeweakref(thisFunction(WriteXmlAttrSpt)),
"preferrelative": makeweakref(thisFunction(WriteXmlAttrPreferrelative)),
"path": makeweakref(thisFunction(WriteXmlAttrPath)),
"filled": makeweakref(thisFunction(WriteXmlAttrFilled)),
"stroked": makeweakref(thisFunction(WriteXmlAttrStroked)),
);
sorted_child_ := array(
pre + "stroke": array(0, makeweakref(thisFunction(ReadXmlChildStroke))),
pre + "formulas": array(1, makeweakref(thisFunction(ReadXmlChildFormulas))),
pre + "path": array(2, makeweakref(thisFunction(ReadXmlChildPath))),
"o:lock": array(3, makeweakref(thisFunction(ReadXmlChildLock))),
);
container_ := new TSOfficeContainer(sorted_child_);
end;
function Shapetype.Copy(_obj: Shapetype);override;
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.AnchorId) then
{self.}AnchorId := _obj.AnchorId;
if not ifnil(_obj.Id) then
{self.}Id := _obj.Id;
if not ifnil(_obj.Coordsize) then
{self.}Coordsize := _obj.Coordsize;
if not ifnil(_obj.Spt) then
{self.}Spt := _obj.Spt;
if not ifnil(_obj.Preferrelative) then
{self.}Preferrelative := _obj.Preferrelative;
if not ifnil(_obj.Path) then
{self.}Path := _obj.Path;
if not ifnil(_obj.Filled) then
{self.}Filled := _obj.Filled;
if not ifnil(_obj.Stroked) then
{self.}Stroked := _obj.Stroked;
if not ifnil(_obj.XmlChildStroke) then
{self.}Stroke.Copy(_obj.XmlChildStroke);
if not ifnil(_obj.XmlChildFormulas) then
{self.}Formulas.Copy(_obj.XmlChildFormulas);
if not ifnil(_obj.XmlChildPath) then
{self.}Path.Copy(_obj.XmlChildPath);
if not ifnil(_obj.XmlChildLock) then
{self.}Lock.Copy(_obj.XmlChildLock);
tslassigning := tslassigning_backup;
end;
function Shapetype.ReadXmlAttrAnchorId();
begin
return {self.}XmlAttrAnchorId.Value;
end;
function Shapetype.WriteXmlAttrAnchorId(_value);
begin
if ifnil({self.}XmlAttrAnchorId) then
begin
{self.}XmlAttrAnchorId := new OpenXmlAttribute("w14", "anchorId", nil);
attributes_[length(attributes_)] := {self.}XmlAttrAnchorId;
end
{self.}XmlAttrAnchorId.Value := _value;
end;
function Shapetype.ReadXmlAttrId();
begin
return {self.}XmlAttrId.Value;
end;
function Shapetype.WriteXmlAttrId(_value);
begin
if ifnil({self.}XmlAttrId) then
begin
{self.}XmlAttrId := new OpenXmlAttribute("", "id", nil);
attributes_[length(attributes_)] := {self.}XmlAttrId;
end
{self.}XmlAttrId.Value := _value;
end;
function Shapetype.ReadXmlAttrCoordsize();
begin
return {self.}XmlAttrCoordsize.Value;
end;
function Shapetype.WriteXmlAttrCoordsize(_value);
begin
if ifnil({self.}XmlAttrCoordsize) then
begin
{self.}XmlAttrCoordsize := new OpenXmlAttribute("", "coordsize", nil);
attributes_[length(attributes_)] := {self.}XmlAttrCoordsize;
end
{self.}XmlAttrCoordsize.Value := _value;
end;
function Shapetype.ReadXmlAttrSpt();
begin
return {self.}XmlAttrSpt.Value;
end;
function Shapetype.WriteXmlAttrSpt(_value);
begin
if ifnil({self.}XmlAttrSpt) then
begin
{self.}XmlAttrSpt := new OpenXmlAttribute("o", "spt", nil);
attributes_[length(attributes_)] := {self.}XmlAttrSpt;
end
{self.}XmlAttrSpt.Value := _value;
end;
function Shapetype.ReadXmlAttrPreferrelative();
begin
return {self.}XmlAttrPreferrelative.Value;
end;
function Shapetype.WriteXmlAttrPreferrelative(_value);
begin
if ifnil({self.}XmlAttrPreferrelative) then
begin
{self.}XmlAttrPreferrelative := new OpenXmlAttribute("", "preferrelative", nil);
attributes_[length(attributes_)] := {self.}XmlAttrPreferrelative;
end
{self.}XmlAttrPreferrelative.Value := _value;
end;
function Shapetype.ReadXmlAttrPath();
begin
return {self.}XmlAttrPath.Value;
end;
function Shapetype.WriteXmlAttrPath(_value);
begin
if ifnil({self.}XmlAttrPath) then
begin
{self.}XmlAttrPath := new OpenXmlAttribute("", "path", nil);
attributes_[length(attributes_)] := {self.}XmlAttrPath;
end
{self.}XmlAttrPath.Value := _value;
end;
function Shapetype.ReadXmlAttrFilled();
begin
return {self.}XmlAttrFilled.Value;
end;
function Shapetype.WriteXmlAttrFilled(_value);
begin
if ifnil({self.}XmlAttrFilled) then
begin
{self.}XmlAttrFilled := new OpenXmlAttribute("", "filled", nil);
attributes_[length(attributes_)] := {self.}XmlAttrFilled;
end
{self.}XmlAttrFilled.Value := _value;
end;
function Shapetype.ReadXmlAttrStroked();
begin
return {self.}XmlAttrStroked.Value;
end;
function Shapetype.WriteXmlAttrStroked(_value);
begin
if ifnil({self.}XmlAttrStroked) then
begin
{self.}XmlAttrStroked := new OpenXmlAttribute("", "stroked", nil);
attributes_[length(attributes_)] := {self.}XmlAttrStroked;
end
{self.}XmlAttrStroked.Value := _value;
end;
function Shapetype.ReadXmlChildStroke();
begin
if tslassigning and ifnil({self.}XmlChildStroke) then
begin
{self.}XmlChildStroke := new Stroke(self, {self.}Prefix, "stroke");
container_.Set({self.}XmlChildStroke);
end
return {self.}XmlChildStroke;
end;
function Shapetype.ReadXmlChildFormulas();
begin
if tslassigning and ifnil({self.}XmlChildFormulas) then
begin
{self.}XmlChildFormulas := new formulas(self, {self.}Prefix, "formulas");
container_.Set({self.}XmlChildFormulas);
end
return {self.}XmlChildFormulas;
end;
function Shapetype.ReadXmlChildPath();
begin
if tslassigning and ifnil({self.}XmlChildPath) then
begin
{self.}XmlChildPath := new Path(self, {self.}Prefix, "path");
container_.Set({self.}XmlChildPath);
end
return {self.}XmlChildPath;
end;
function Shapetype.ReadXmlChildLock();
begin
if tslassigning and ifnil({self.}XmlChildLock) then
begin
{self.}XmlChildLock := new Lock(self, "o", "lock");
container_.Set({self.}XmlChildLock);
end
return {self.}XmlChildLock;
end;