1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XMLDDELinksContext.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_XMLDDELINKSCONTEXT_HXX
32 #define SC_XMLDDELINKSCONTEXT_HXX
34 #include <xmloff/xmlictxt.hxx>
40 class ScXMLDDELinksContext
: public SvXMLImportContext
42 const ScXMLImport
& GetScImport() const { return (const ScXMLImport
&)GetImport(); }
43 ScXMLImport
& GetScImport() { return (ScXMLImport
&)GetImport(); }
45 ScXMLDDELinksContext( ScXMLImport
& rImport
, USHORT nPrfx
,
46 const ::rtl::OUString
& rLName
,
47 const ::com::sun::star::uno::Reference
<
48 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
50 virtual ~ScXMLDDELinksContext();
52 virtual SvXMLImportContext
*CreateChildContext( USHORT nPrefix
,
53 const ::rtl::OUString
& rLocalName
,
54 const ::com::sun::star::uno::Reference
<
55 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
57 virtual void EndElement();
68 typedef std::list
<ScDDELinkCell
> ScDDELinkCells
;
70 class ScXMLDDELinkContext
: public SvXMLImportContext
72 ScDDELinkCells aDDELinkTable
;
73 ScDDELinkCells aDDELinkRow
;
74 rtl::OUString sApplication
;
82 const ScXMLImport
& GetScImport() const { return (const ScXMLImport
&)GetImport(); }
83 ScXMLImport
& GetScImport() { return (ScXMLImport
&)GetImport(); }
85 ScXMLDDELinkContext( ScXMLImport
& rImport
, USHORT nPrfx
,
86 const ::rtl::OUString
& rLName
,
87 const ::com::sun::star::uno::Reference
<
88 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
90 virtual ~ScXMLDDELinkContext();
92 virtual SvXMLImportContext
*CreateChildContext( USHORT nPrefix
,
93 const ::rtl::OUString
& rLocalName
,
94 const ::com::sun::star::uno::Reference
<
95 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
97 void SetApplication(const rtl::OUString
& sValue
) { sApplication
= sValue
; }
98 void SetTopic(const rtl::OUString
& sValue
) { sTopic
= sValue
; }
99 void SetItem(const rtl::OUString
& sValue
) { sItem
= sValue
; }
100 void SetMode(const sal_uInt8 nValue
) { nMode
= nValue
; }
101 void CreateDDELink();
102 void AddColumns(const sal_Int32 nValue
) { nColumns
+= nValue
; }
103 void AddRows(const sal_Int32 nValue
) { nRows
+= nValue
; }
104 void AddCellToRow(const ScDDELinkCell
& aCell
);
105 void AddRowsToTable(const sal_Int32 nRows
);
107 virtual void EndElement();
110 class ScXMLDDESourceContext
: public SvXMLImportContext
112 ScXMLDDELinkContext
* pDDELink
;
114 const ScXMLImport
& GetScImport() const { return (const ScXMLImport
&)GetImport(); }
115 ScXMLImport
& GetScImport() { return (ScXMLImport
&)GetImport(); }
117 ScXMLDDESourceContext( ScXMLImport
& rImport
, USHORT nPrfx
,
118 const ::rtl::OUString
& rLName
,
119 const ::com::sun::star::uno::Reference
<
120 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
,
121 ScXMLDDELinkContext
* pDDELink
);
123 virtual ~ScXMLDDESourceContext();
125 virtual SvXMLImportContext
*CreateChildContext( USHORT nPrefix
,
126 const ::rtl::OUString
& rLocalName
,
127 const ::com::sun::star::uno::Reference
<
128 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
130 virtual void EndElement();
133 class ScXMLDDETableContext
: public SvXMLImportContext
135 ScXMLDDELinkContext
* pDDELink
;
137 const ScXMLImport
& GetScImport() const { return (const ScXMLImport
&)GetImport(); }
138 ScXMLImport
& GetScImport() { return (ScXMLImport
&)GetImport(); }
140 ScXMLDDETableContext( ScXMLImport
& rImport
, USHORT nPrfx
,
141 const ::rtl::OUString
& rLName
,
142 const ::com::sun::star::uno::Reference
<
143 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
,
144 ScXMLDDELinkContext
* pDDELink
);
146 virtual ~ScXMLDDETableContext();
148 virtual SvXMLImportContext
*CreateChildContext( USHORT nPrefix
,
149 const ::rtl::OUString
& rLocalName
,
150 const ::com::sun::star::uno::Reference
<
151 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
153 virtual void EndElement();
156 class ScXMLDDEColumnContext
: public SvXMLImportContext
158 ScXMLDDELinkContext
* pDDELink
;
160 const ScXMLImport
& GetScImport() const { return (const ScXMLImport
&)GetImport(); }
161 ScXMLImport
& GetScImport() { return (ScXMLImport
&)GetImport(); }
163 ScXMLDDEColumnContext( ScXMLImport
& rImport
, USHORT nPrfx
,
164 const ::rtl::OUString
& rLName
,
165 const ::com::sun::star::uno::Reference
<
166 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
,
167 ScXMLDDELinkContext
* pDDELink
);
169 virtual ~ScXMLDDEColumnContext();
171 virtual SvXMLImportContext
*CreateChildContext( USHORT nPrefix
,
172 const ::rtl::OUString
& rLocalName
,
173 const ::com::sun::star::uno::Reference
<
174 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
176 virtual void EndElement();
179 class ScXMLDDERowContext
: public SvXMLImportContext
181 ScXMLDDELinkContext
* pDDELink
;
184 const ScXMLImport
& GetScImport() const { return (const ScXMLImport
&)GetImport(); }
185 ScXMLImport
& GetScImport() { return (ScXMLImport
&)GetImport(); }
187 ScXMLDDERowContext( ScXMLImport
& rImport
, USHORT nPrfx
,
188 const ::rtl::OUString
& rLName
,
189 const ::com::sun::star::uno::Reference
<
190 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
,
191 ScXMLDDELinkContext
* pDDELink
);
193 virtual ~ScXMLDDERowContext();
195 virtual SvXMLImportContext
*CreateChildContext( USHORT nPrefix
,
196 const ::rtl::OUString
& rLocalName
,
197 const ::com::sun::star::uno::Reference
<
198 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
200 virtual void EndElement();
203 class ScXMLDDECellContext
: public SvXMLImportContext
205 rtl::OUString sValue
;
212 ScXMLDDELinkContext
* pDDELink
;
214 const ScXMLImport
& GetScImport() const { return (const ScXMLImport
&)GetImport(); }
215 ScXMLImport
& GetScImport() { return (ScXMLImport
&)GetImport(); }
217 ScXMLDDECellContext( ScXMLImport
& rImport
, USHORT nPrfx
,
218 const ::rtl::OUString
& rLName
,
219 const ::com::sun::star::uno::Reference
<
220 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
,
221 ScXMLDDELinkContext
* pDDELink
);
223 virtual ~ScXMLDDECellContext();
225 virtual SvXMLImportContext
*CreateChildContext( USHORT nPrefix
,
226 const ::rtl::OUString
& rLocalName
,
227 const ::com::sun::star::uno::Reference
<
228 ::com::sun::star::xml::sax::XAttributeList
>& xAttrList
);
230 virtual void EndElement();