198 lines
5.7 KiB
Plaintext
198 lines
5.7 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 Path read ReadXmlAttrPath write WriteXmlAttrPath;
|
|
function ReadXmlAttrAnchorId();
|
|
function WriteXmlAttrAnchorId(_value);
|
|
function ReadXmlAttrId();
|
|
function WriteXmlAttrId(_value);
|
|
function ReadXmlAttrCoordsize();
|
|
function WriteXmlAttrCoordsize(_value);
|
|
function ReadXmlAttrSpt();
|
|
function WriteXmlAttrSpt(_value);
|
|
function ReadXmlAttrPath();
|
|
function WriteXmlAttrPath(_value);
|
|
|
|
// normal property
|
|
property Stroke read ReadXmlChildStroke;
|
|
property Path read ReadXmlChildPath;
|
|
function ReadXmlChildStroke();
|
|
function ReadXmlChildPath();
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrAnchorId: OpenXmlAttribute;
|
|
XmlAttrId: OpenXmlAttribute;
|
|
XmlAttrCoordsize: OpenXmlAttribute;
|
|
XmlAttrSpt: OpenXmlAttribute;
|
|
XmlAttrPath: OpenXmlAttribute;
|
|
|
|
// Children
|
|
XmlChildStroke: Stroke;
|
|
XmlChildPath: Path;
|
|
|
|
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)),
|
|
"path": makeweakref(thisFunction(WriteXmlAttrPath)),
|
|
);
|
|
sorted_child_ := array(
|
|
pre + "stroke": array(0, makeweakref(thisFunction(ReadXmlChildStroke))),
|
|
pre + "path": array(1, makeweakref(thisFunction(ReadXmlChildPath))),
|
|
);
|
|
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.Path) then
|
|
{self.}Path := _obj.Path;
|
|
if not ifnil(_obj.XmlChildStroke) then
|
|
{self.}Stroke.Copy(_obj.XmlChildStroke);
|
|
if not ifnil(_obj.XmlChildPath) then
|
|
{self.}Path.Copy(_obj.XmlChildPath);
|
|
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.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.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.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;
|