OfficeXml/autoclass/docx/OLEObject@DOCX.tsf

185 lines
5.5 KiB
Plaintext

type OLEObject = 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: OLEObject);override;
public
// attributes property
property Type read ReadXmlAttrType write WriteXmlAttrType;
property ProgID read ReadXmlAttrProgID write WriteXmlAttrProgID;
property ShapeID read ReadXmlAttrShapeID write WriteXmlAttrShapeID;
property DrawAspect read ReadXmlAttrDrawAspect write WriteXmlAttrDrawAspect;
property ObjectID read ReadXmlAttrObjectID write WriteXmlAttrObjectID;
property Id read ReadXmlAttrId write WriteXmlAttrId;
function ReadXmlAttrType();
function WriteXmlAttrType(_value);
function ReadXmlAttrProgID();
function WriteXmlAttrProgID(_value);
function ReadXmlAttrShapeID();
function WriteXmlAttrShapeID(_value);
function ReadXmlAttrDrawAspect();
function WriteXmlAttrDrawAspect(_value);
function ReadXmlAttrObjectID();
function WriteXmlAttrObjectID(_value);
function ReadXmlAttrId();
function WriteXmlAttrId(_value);
public
// Attributes
XmlAttrType: OpenXmlAttribute;
XmlAttrProgID: OpenXmlAttribute;
XmlAttrShapeID: OpenXmlAttribute;
XmlAttrDrawAspect: OpenXmlAttribute;
XmlAttrObjectID: OpenXmlAttribute;
XmlAttrId: OpenXmlAttribute;
end;
function OLEObject.Create();overload;
begin
{self.}Create(nil, "o", "OLEObject");
end;
function OLEObject.Create(_node: XmlNode);overload;
begin
class(OpenXmlElement).Create(_node: XmlNode);
end;
function OLEObject.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 OLEObject.Init();override;
begin
pre := {self.}Prefix ? {self.}Prefix + ":" : "";
attributes_ := array();
attributes_pf_ := array(
pre + "Type": makeweakref(thisFunction(WriteXmlAttrType)),
pre + "ProgID": makeweakref(thisFunction(WriteXmlAttrProgID)),
pre + "ShapeID": makeweakref(thisFunction(WriteXmlAttrShapeID)),
pre + "DrawAspect": makeweakref(thisFunction(WriteXmlAttrDrawAspect)),
pre + "DrawAspect": makeweakref(thisFunction(WriteXmlAttrObjectID)),
"r:id": makeweakref(thisFunction(WriteXmlAttrId)),
);
sorted_child_ := array(
);
container_ := new TSOfficeContainer(sorted_child_);
end;
function OLEObject.Copy(_obj: OLEObject);override;
begin
tslassigning_backup := tslassigning;
tslassigning := 1;
class(OpenXmlElement).Copy(_obj);
if not ifnil(_obj.Type) then
{self.}Type := _obj.Type;
if not ifnil(_obj.ProgID) then
{self.}ProgID := _obj.ProgID;
if not ifnil(_obj.ShapeID) then
{self.}ShapeID := _obj.ShapeID;
if not ifnil(_obj.DrawAspect) then
{self.}DrawAspect := _obj.DrawAspect;
if not ifnil(_obj.ObjectID) then
{self.}ObjectID := _obj.ObjectID;
if not ifnil(_obj.Id) then
{self.}Id := _obj.Id;
tslassigning := tslassigning_backup;
end;
function OLEObject.ReadXmlAttrType();
begin
return {self.}XmlAttrType.Value;
end;
function OLEObject.WriteXmlAttrType(_value);
begin
if ifnil({self.}XmlAttrType) then
begin
{self.}XmlAttrType := new OpenXmlAttribute({self.}Prefix, "Type", nil);
attributes_[length(attributes_)] := {self.}XmlAttrType;
end
{self.}XmlAttrType.Value := _value;
end;
function OLEObject.ReadXmlAttrProgID();
begin
return {self.}XmlAttrProgID.Value;
end;
function OLEObject.WriteXmlAttrProgID(_value);
begin
if ifnil({self.}XmlAttrProgID) then
begin
{self.}XmlAttrProgID := new OpenXmlAttribute({self.}Prefix, "ProgID", nil);
attributes_[length(attributes_)] := {self.}XmlAttrProgID;
end
{self.}XmlAttrProgID.Value := _value;
end;
function OLEObject.ReadXmlAttrShapeID();
begin
return {self.}XmlAttrShapeID.Value;
end;
function OLEObject.WriteXmlAttrShapeID(_value);
begin
if ifnil({self.}XmlAttrShapeID) then
begin
{self.}XmlAttrShapeID := new OpenXmlAttribute({self.}Prefix, "ShapeID", nil);
attributes_[length(attributes_)] := {self.}XmlAttrShapeID;
end
{self.}XmlAttrShapeID.Value := _value;
end;
function OLEObject.ReadXmlAttrDrawAspect();
begin
return {self.}XmlAttrDrawAspect.Value;
end;
function OLEObject.WriteXmlAttrDrawAspect(_value);
begin
if ifnil({self.}XmlAttrDrawAspect) then
begin
{self.}XmlAttrDrawAspect := new OpenXmlAttribute({self.}Prefix, "DrawAspect", nil);
attributes_[length(attributes_)] := {self.}XmlAttrDrawAspect;
end
{self.}XmlAttrDrawAspect.Value := _value;
end;
function OLEObject.ReadXmlAttrObjectID();
begin
return {self.}XmlAttrObjectID.Value;
end;
function OLEObject.WriteXmlAttrObjectID(_value);
begin
if ifnil({self.}XmlAttrObjectID) then
begin
{self.}XmlAttrObjectID := new OpenXmlAttribute({self.}Prefix, "DrawAspect", nil);
attributes_[length(attributes_)] := {self.}XmlAttrObjectID;
end
{self.}XmlAttrObjectID.Value := _value;
end;
function OLEObject.ReadXmlAttrId();
begin
return {self.}XmlAttrId.Value;
end;
function OLEObject.WriteXmlAttrId(_value);
begin
if ifnil({self.}XmlAttrId) then
begin
{self.}XmlAttrId := new OpenXmlAttribute("r", "id", nil);
attributes_[length(attributes_)] := {self.}XmlAttrId;
end
{self.}XmlAttrId.Value := _value;
end;