126 lines
3.6 KiB
Plaintext
126 lines
3.6 KiB
Plaintext
type Pic = 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: Pic);override;
|
|
|
|
public
|
|
|
|
// attributes property
|
|
property XmlnsPic read ReadXmlAttrXmlnsPic write WriteXmlAttrXmlnsPic;
|
|
function ReadXmlAttrXmlnsPic();
|
|
function WriteXmlAttrXmlnsPic(_value);
|
|
|
|
// normal property
|
|
property NvPicPr read ReadXmlChildNvPicPr;
|
|
property BlipFill read ReadXmlChildBlipFill;
|
|
property SpPr read ReadXmlChildSpPr;
|
|
function ReadXmlChildNvPicPr();
|
|
function ReadXmlChildBlipFill();
|
|
function ReadXmlChildSpPr();
|
|
|
|
public
|
|
// Attributes
|
|
XmlAttrXmlnsPic: OpenXmlAttribute;
|
|
|
|
// Children
|
|
XmlChildNvPicPr: NvPicPr;
|
|
XmlChildBlipFill: BlipFill;
|
|
XmlChildSpPr: SpPr;
|
|
|
|
end;
|
|
|
|
function Pic.Create();overload;
|
|
begin
|
|
{self.}Create(nil, "pic", "pic");
|
|
end;
|
|
|
|
function Pic.Create(_node: XmlNode);overload;
|
|
begin
|
|
class(OpenXmlElement).Create(_node: XmlNode);
|
|
end;
|
|
|
|
function Pic.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 Pic.Init();override;
|
|
begin
|
|
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
|
|
attributes_ := array();
|
|
attributes_pf_ := array(
|
|
"xmlns:pic": makeweakref(thisFunction(WriteXmlAttrXmlnsPic)),
|
|
);
|
|
sorted_child_ := array(
|
|
pre + "nvPicPr": array(0, makeweakref(thisFunction(ReadXmlChildNvPicPr))),
|
|
pre + "blipFill": array(1, makeweakref(thisFunction(ReadXmlChildBlipFill))),
|
|
pre + "spPr": array(2, makeweakref(thisFunction(ReadXmlChildSpPr))),
|
|
);
|
|
container_ := new TSOfficeContainer(sorted_child_);
|
|
end;
|
|
|
|
function Pic.Copy(_obj: Pic);override;
|
|
begin
|
|
tslassigning_backup := tslassigning;
|
|
tslassigning := 1;
|
|
class(OpenXmlElement).Copy(_obj);
|
|
if not ifnil(_obj.XmlnsPic) then
|
|
{self.}XmlnsPic := _obj.XmlnsPic;
|
|
if not ifnil(_obj.XmlChildNvPicPr) then
|
|
{self.}NvPicPr.Copy(_obj.XmlChildNvPicPr);
|
|
if not ifnil(_obj.XmlChildBlipFill) then
|
|
{self.}BlipFill.Copy(_obj.XmlChildBlipFill);
|
|
if not ifnil(_obj.XmlChildSpPr) then
|
|
{self.}SpPr.Copy(_obj.XmlChildSpPr);
|
|
tslassigning := tslassigning_backup;
|
|
end;
|
|
|
|
function Pic.ReadXmlAttrXmlnsPic();
|
|
begin
|
|
return {self.}XmlAttrXmlnsPic.Value;
|
|
end;
|
|
|
|
function Pic.WriteXmlAttrXmlnsPic(_value);
|
|
begin
|
|
if ifnil({self.}XmlAttrXmlnsPic) then
|
|
begin
|
|
{self.}XmlAttrXmlnsPic := new OpenXmlAttribute("xmlns", "pic", nil);
|
|
attributes_[length(attributes_)] := {self.}XmlAttrXmlnsPic;
|
|
end
|
|
{self.}XmlAttrXmlnsPic.Value := _value;
|
|
end;
|
|
|
|
function Pic.ReadXmlChildNvPicPr();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildNvPicPr) then
|
|
begin
|
|
{self.}XmlChildNvPicPr := new NvPicPr(self, {self.}Prefix, "nvPicPr");
|
|
container_.Set({self.}XmlChildNvPicPr);
|
|
end
|
|
return {self.}XmlChildNvPicPr;
|
|
end;
|
|
|
|
function Pic.ReadXmlChildBlipFill();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildBlipFill) then
|
|
begin
|
|
{self.}XmlChildBlipFill := new BlipFill(self, {self.}Prefix, "blipFill");
|
|
container_.Set({self.}XmlChildBlipFill);
|
|
end
|
|
return {self.}XmlChildBlipFill;
|
|
end;
|
|
|
|
function Pic.ReadXmlChildSpPr();
|
|
begin
|
|
if tslassigning and ifnil({self.}XmlChildSpPr) then
|
|
begin
|
|
{self.}XmlChildSpPr := new SpPr(self, {self.}Prefix, "spPr");
|
|
container_.Set({self.}XmlChildSpPr);
|
|
end
|
|
return {self.}XmlChildSpPr;
|
|
end;
|