1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #ifndef INCLUDED_SC_SOURCE_FILTER_XML_CELLTEXTPARACONTEXT_HXX
11 #define INCLUDED_SC_SOURCE_FILTER_XML_CELLTEXTPARACONTEXT_HXX
13 #include "importcontext.hxx"
16 class ScXMLTableRowCellContext
;
19 * This context handles <text:p> element inside <table:table-cell>.
21 class ScXMLCellTextParaContext
: public ScXMLImportContext
23 ScXMLTableRowCellContext
& mrParentCxt
;
26 ScXMLCellTextParaContext(ScXMLImport
& rImport
, sal_uInt16 nPrefix
, const OUString
& rLName
, ScXMLTableRowCellContext
& rParent
);
28 virtual void StartElement(const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
29 virtual void EndElement() SAL_OVERRIDE
;
30 virtual void Characters(const OUString
& rChars
) SAL_OVERRIDE
;
31 virtual SvXMLImportContext
* CreateChildContext(
32 sal_uInt16 nPrefix
, const OUString
& rLocalName
, const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
34 void PushSpan(const OUString
& rSpan
, const OUString
& rStyleName
);
35 void PushFieldSheetName(const OUString
& rStyleName
);
36 void PushFieldDate(const OUString
& rStyleName
);
37 void PushFieldTitle(const OUString
& rStyleName
);
38 void PushFieldURL(const OUString
& rURL
, const OUString
& rRep
, const OUString
& rStyleName
);
42 * This context handles <text:span> element inside <text:p>.
44 class ScXMLCellTextSpanContext
: public ScXMLImportContext
46 ScXMLCellTextParaContext
& mrParentCxt
;
50 ScXMLCellTextSpanContext(ScXMLImport
& rImport
, sal_uInt16 nPrefix
, const OUString
& rLName
, ScXMLCellTextParaContext
& rParent
);
52 virtual void StartElement(const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
53 virtual void EndElement() SAL_OVERRIDE
;
54 virtual void Characters(const OUString
& rChars
) SAL_OVERRIDE
;
55 virtual SvXMLImportContext
* CreateChildContext(
56 sal_uInt16 nPrefix
, const OUString
& rLocalName
, const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
60 * This context handles <text:sheet-name> element inside <text:p>.
62 class ScXMLCellFieldSheetNameContext
: public ScXMLImportContext
64 ScXMLCellTextParaContext
& mrParentCxt
;
67 ScXMLCellFieldSheetNameContext(ScXMLImport
& rImport
, sal_uInt16 nPrefix
, const OUString
& rLName
, ScXMLCellTextParaContext
& rParent
);
69 void SetStyleName(const OUString
& rStyleName
);
71 virtual void StartElement(const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
72 virtual void EndElement() SAL_OVERRIDE
;
73 virtual void Characters(const OUString
& rChars
) SAL_OVERRIDE
;
74 virtual SvXMLImportContext
* CreateChildContext(
75 sal_uInt16 nPrefix
, const OUString
& rLocalName
, const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
79 * This context handles <text:date> element inside <text:p>.
81 class ScXMLCellFieldDateContext
: public ScXMLImportContext
83 ScXMLCellTextParaContext
& mrParentCxt
;
86 ScXMLCellFieldDateContext(ScXMLImport
& rImport
, sal_uInt16 nPrefix
, const OUString
& rLName
, ScXMLCellTextParaContext
& rParent
);
88 void SetStyleName(const OUString
& rStyleName
);
90 virtual void StartElement(const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
91 virtual void EndElement() SAL_OVERRIDE
;
92 virtual void Characters(const OUString
& rChars
) SAL_OVERRIDE
;
93 virtual SvXMLImportContext
* CreateChildContext(
94 sal_uInt16 nPrefix
, const OUString
& rLocalName
, const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
98 * This context handles <text:title> element inside <text:p>.
100 class ScXMLCellFieldTitleContext
: public ScXMLImportContext
102 ScXMLCellTextParaContext
& mrParentCxt
;
103 OUString maStyleName
;
105 ScXMLCellFieldTitleContext(ScXMLImport
& rImport
, sal_uInt16 nPrefix
, const OUString
& rLName
, ScXMLCellTextParaContext
& rParent
);
107 void SetStyleName(const OUString
& rStyleName
);
109 virtual void StartElement(const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
110 virtual void EndElement() SAL_OVERRIDE
;
111 virtual void Characters(const OUString
& rChars
) SAL_OVERRIDE
;
112 virtual SvXMLImportContext
* CreateChildContext(
113 sal_uInt16 nPrefix
, const OUString
& rLocalName
, const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
117 * This context handles <text:a> element inside <text:p> or <text:span>.
119 class ScXMLCellFieldURLContext
: public ScXMLImportContext
121 ScXMLCellTextParaContext
& mrParentCxt
;
122 OUString maStyleName
;
126 ScXMLCellFieldURLContext(ScXMLImport
& rImport
, sal_uInt16 nPrefix
, const OUString
& rLName
, ScXMLCellTextParaContext
& rParent
);
128 void SetStyleName(const OUString
& rStyleName
);
130 virtual void StartElement(const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
131 virtual void EndElement() SAL_OVERRIDE
;
132 virtual void Characters(const OUString
& rChars
) SAL_OVERRIDE
;
133 virtual SvXMLImportContext
* CreateChildContext(
134 sal_uInt16 nPrefix
, const OUString
& rLocalName
, const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
138 * This context handles <text:s> element inside <text:p> or <text:span>.
140 class ScXMLCellFieldSContext
: public ScXMLImportContext
142 ScXMLCellTextParaContext
& mrParentCxt
;
143 OUString maStyleName
;
148 ScXMLCellFieldSContext(ScXMLImport
& rImport
, sal_uInt16 nPrefix
, const OUString
& rLName
, ScXMLCellTextParaContext
& rParent
);
150 void SetStyleName(const OUString
& rStyleName
);
152 virtual void StartElement(const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
153 virtual void EndElement() SAL_OVERRIDE
;
154 virtual SvXMLImportContext
* CreateChildContext(
155 sal_uInt16 nPrefix
, const OUString
& rLocalName
, const com::sun::star::uno::Reference
<com::sun::star::xml::sax::XAttributeList
>& xAttrList
) SAL_OVERRIDE
;
160 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */