373 lines
7.4 KiB
Plaintext
373 lines
7.4 KiB
Plaintext
unit DocxMLAdapter;
|
|
interface
|
|
|
|
type TabsAdapter = class
|
|
public
|
|
function Create(_obj: Tabs);
|
|
function Init();
|
|
|
|
function GetTabByVal(_key: string);
|
|
function SetTabByVal(_key: string; _value: tslobj);
|
|
|
|
private
|
|
object_: Tabs;
|
|
tab_hash_: tableArray;
|
|
end;
|
|
|
|
type SectPrAdapter = class
|
|
public
|
|
function Create(_obj: SectPr);
|
|
function Init();
|
|
|
|
function GetHeaderReferenceByType(_key: string);
|
|
function SetHeaderReferenceByType(_key: string; _value: tslobj);
|
|
function GetFooterReferenceByType(_key: string);
|
|
function SetFooterReferenceByType(_key: string; _value: tslobj);
|
|
|
|
private
|
|
object_: SectPr;
|
|
headerreference_hash_: tableArray;
|
|
footerreference_hash_: tableArray;
|
|
end;
|
|
|
|
type EndnotesAdapter = class
|
|
public
|
|
function Create(_obj: Endnotes);
|
|
function Init();
|
|
|
|
function GetEndnoteById(_key: string);
|
|
function SetEndnoteById(_key: string; _value: tslobj);
|
|
|
|
private
|
|
object_: Endnotes;
|
|
endnote_hash_: tableArray;
|
|
end;
|
|
|
|
type FootnotesAdapter = class
|
|
public
|
|
function Create(_obj: Footnotes);
|
|
function Init();
|
|
|
|
function GetFootnoteById(_key: string);
|
|
function SetFootnoteById(_key: string; _value: tslobj);
|
|
|
|
private
|
|
object_: Footnotes;
|
|
footnote_hash_: tableArray;
|
|
end;
|
|
|
|
type FootnotePrAdapter = class
|
|
public
|
|
function Create(_obj: FootnotePr);
|
|
function Init();
|
|
|
|
function GetFootnoteById(_key: string);
|
|
function SetFootnoteById(_key: string; _value: tslobj);
|
|
|
|
private
|
|
object_: FootnotePr;
|
|
footnote_hash_: tableArray;
|
|
end;
|
|
|
|
type EndnotePrAdapter = class
|
|
public
|
|
function Create(_obj: EndnotePr);
|
|
function Init();
|
|
|
|
function GetEndnoteById(_key: string);
|
|
function SetEndnoteById(_key: string; _value: tslobj);
|
|
|
|
private
|
|
object_: EndnotePr;
|
|
endnote_hash_: tableArray;
|
|
end;
|
|
|
|
type StylesAdapter = class
|
|
public
|
|
function Create(_obj: Styles);
|
|
function Init();
|
|
|
|
function GetStyleByStyleId(_key: string);
|
|
function SetStyleByStyleId(_key: string; _value: tslobj);
|
|
|
|
private
|
|
object_: Styles;
|
|
style_hash_: tableArray;
|
|
end;
|
|
|
|
type StyleAdapter = class
|
|
public
|
|
function Create(_obj: Style);
|
|
function Init();
|
|
|
|
function GetTblStylePrByType(_key: string);
|
|
function SetTblStylePrByType(_key: string; _value: tslobj);
|
|
|
|
private
|
|
object_: Style;
|
|
tblstylepr_hash_: tableArray;
|
|
end;
|
|
|
|
type NumberingAdapter = class
|
|
public
|
|
function Create(_obj: Numbering);
|
|
function Init();
|
|
|
|
function GetAbstractNumByAbstractNumId(_key: string);
|
|
function SetAbstractNumByAbstractNumId(_key: string; _value: tslobj);
|
|
function GetNumByNumId(_key: string);
|
|
function SetNumByNumId(_key: string; _value: tslobj);
|
|
|
|
private
|
|
object_: Numbering;
|
|
abstractnum_hash_: tableArray;
|
|
num_hash_: tableArray;
|
|
end;
|
|
|
|
implementation
|
|
|
|
function TabsAdapter.Create(_obj: Tabs);
|
|
begin
|
|
object_ := _obj;
|
|
tab_hash_ := array();
|
|
{self.}Init();
|
|
end;
|
|
|
|
function TabsAdapter.Init();
|
|
begin
|
|
elements := object_.Tabs();
|
|
for k,v in elements do
|
|
tab_hash_[v.Val] := v;
|
|
end;
|
|
|
|
function TabsAdapter.GetTabByVal(_key: string);
|
|
begin
|
|
return tab_hash_[_key];
|
|
end;
|
|
|
|
function TabsAdapter.SetTabByVal(_key: string; _value: tslobj);
|
|
begin
|
|
tab_hash_[_key] := _value;
|
|
end;
|
|
|
|
function SectPrAdapter.Create(_obj: SectPr);
|
|
begin
|
|
object_ := _obj;
|
|
headerreference_hash_ := array();
|
|
footerreference_hash_ := array();
|
|
{self.}Init();
|
|
end;
|
|
|
|
function SectPrAdapter.Init();
|
|
begin
|
|
elements := object_.HeaderReferences();
|
|
for k,v in elements do
|
|
headerreference_hash_[v.Type] := v;
|
|
elements := object_.FooterReferences();
|
|
for k,v in elements do
|
|
footerreference_hash_[v.Type] := v;
|
|
end;
|
|
|
|
function SectPrAdapter.GetHeaderReferenceByType(_key: string);
|
|
begin
|
|
return headerreference_hash_[_key];
|
|
end;
|
|
|
|
function SectPrAdapter.SetHeaderReferenceByType(_key: string; _value: tslobj);
|
|
begin
|
|
headerreference_hash_[_key] := _value;
|
|
end;
|
|
|
|
function SectPrAdapter.GetFooterReferenceByType(_key: string);
|
|
begin
|
|
return footerreference_hash_[_key];
|
|
end;
|
|
|
|
function SectPrAdapter.SetFooterReferenceByType(_key: string; _value: tslobj);
|
|
begin
|
|
footerreference_hash_[_key] := _value;
|
|
end;
|
|
|
|
function EndnotesAdapter.Create(_obj: Endnotes);
|
|
begin
|
|
object_ := _obj;
|
|
endnote_hash_ := array();
|
|
{self.}Init();
|
|
end;
|
|
|
|
function EndnotesAdapter.Init();
|
|
begin
|
|
elements := object_.Endnotes();
|
|
for k,v in elements do
|
|
endnote_hash_[v.Id] := v;
|
|
end;
|
|
|
|
function EndnotesAdapter.GetEndnoteById(_key: string);
|
|
begin
|
|
return endnote_hash_[_key];
|
|
end;
|
|
|
|
function EndnotesAdapter.SetEndnoteById(_key: string; _value: tslobj);
|
|
begin
|
|
endnote_hash_[_key] := _value;
|
|
end;
|
|
|
|
function FootnotesAdapter.Create(_obj: Footnotes);
|
|
begin
|
|
object_ := _obj;
|
|
footnote_hash_ := array();
|
|
{self.}Init();
|
|
end;
|
|
|
|
function FootnotesAdapter.Init();
|
|
begin
|
|
elements := object_.Footnotes();
|
|
for k,v in elements do
|
|
footnote_hash_[v.Id] := v;
|
|
end;
|
|
|
|
function FootnotesAdapter.GetFootnoteById(_key: string);
|
|
begin
|
|
return footnote_hash_[_key];
|
|
end;
|
|
|
|
function FootnotesAdapter.SetFootnoteById(_key: string; _value: tslobj);
|
|
begin
|
|
footnote_hash_[_key] := _value;
|
|
end;
|
|
|
|
function FootnotePrAdapter.Create(_obj: FootnotePr);
|
|
begin
|
|
object_ := _obj;
|
|
footnote_hash_ := array();
|
|
{self.}Init();
|
|
end;
|
|
|
|
function FootnotePrAdapter.Init();
|
|
begin
|
|
elements := object_.Footnotes();
|
|
for k,v in elements do
|
|
footnote_hash_[v.Id] := v;
|
|
end;
|
|
|
|
function FootnotePrAdapter.GetFootnoteById(_key: string);
|
|
begin
|
|
return footnote_hash_[_key];
|
|
end;
|
|
|
|
function FootnotePrAdapter.SetFootnoteById(_key: string; _value: tslobj);
|
|
begin
|
|
footnote_hash_[_key] := _value;
|
|
end;
|
|
|
|
function EndnotePrAdapter.Create(_obj: EndnotePr);
|
|
begin
|
|
object_ := _obj;
|
|
endnote_hash_ := array();
|
|
{self.}Init();
|
|
end;
|
|
|
|
function EndnotePrAdapter.Init();
|
|
begin
|
|
elements := object_.Endnotes();
|
|
for k,v in elements do
|
|
endnote_hash_[v.Id] := v;
|
|
end;
|
|
|
|
function EndnotePrAdapter.GetEndnoteById(_key: string);
|
|
begin
|
|
return endnote_hash_[_key];
|
|
end;
|
|
|
|
function EndnotePrAdapter.SetEndnoteById(_key: string; _value: tslobj);
|
|
begin
|
|
endnote_hash_[_key] := _value;
|
|
end;
|
|
|
|
function StylesAdapter.Create(_obj: Styles);
|
|
begin
|
|
object_ := _obj;
|
|
style_hash_ := array();
|
|
{self.}Init();
|
|
end;
|
|
|
|
function StylesAdapter.Init();
|
|
begin
|
|
elements := object_.Styles();
|
|
for k,v in elements do
|
|
style_hash_[v.StyleId] := v;
|
|
end;
|
|
|
|
function StylesAdapter.GetStyleByStyleId(_key: string);
|
|
begin
|
|
return style_hash_[_key];
|
|
end;
|
|
|
|
function StylesAdapter.SetStyleByStyleId(_key: string; _value: tslobj);
|
|
begin
|
|
style_hash_[_key] := _value;
|
|
end;
|
|
|
|
function StyleAdapter.Create(_obj: Style);
|
|
begin
|
|
object_ := _obj;
|
|
tblstylepr_hash_ := array();
|
|
{self.}Init();
|
|
end;
|
|
|
|
function StyleAdapter.Init();
|
|
begin
|
|
elements := object_.TblStylePrs();
|
|
for k,v in elements do
|
|
tblstylepr_hash_[v.Type] := v;
|
|
end;
|
|
|
|
function StyleAdapter.GetTblStylePrByType(_key: string);
|
|
begin
|
|
return tblstylepr_hash_[_key];
|
|
end;
|
|
|
|
function StyleAdapter.SetTblStylePrByType(_key: string; _value: tslobj);
|
|
begin
|
|
tblstylepr_hash_[_key] := _value;
|
|
end;
|
|
|
|
function NumberingAdapter.Create(_obj: Numbering);
|
|
begin
|
|
object_ := _obj;
|
|
abstractnum_hash_ := array();
|
|
num_hash_ := array();
|
|
{self.}Init();
|
|
end;
|
|
|
|
function NumberingAdapter.Init();
|
|
begin
|
|
elements := object_.AbstractNums();
|
|
for k,v in elements do
|
|
abstractnum_hash_[v.AbstractNumId] := v;
|
|
elements := object_.Nums();
|
|
for k,v in elements do
|
|
num_hash_[v.NumId] := v;
|
|
end;
|
|
|
|
function NumberingAdapter.GetAbstractNumByAbstractNumId(_key: string);
|
|
begin
|
|
return abstractnum_hash_[_key];
|
|
end;
|
|
|
|
function NumberingAdapter.SetAbstractNumByAbstractNumId(_key: string; _value: tslobj);
|
|
begin
|
|
abstractnum_hash_[_key] := _value;
|
|
end;
|
|
|
|
function NumberingAdapter.GetNumByNumId(_key: string);
|
|
begin
|
|
return num_hash_[_key];
|
|
end;
|
|
|
|
function NumberingAdapter.SetNumByNumId(_key: string; _value: tslobj);
|
|
begin
|
|
num_hash_[_key] := _value;
|
|
end;
|
|
|
|
end. |