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
, ScXMLTableRowCellContext
& rParent
);
28 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
29 virtual void SAL_CALL
characters( const OUString
& aChars
) override
;
30 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
31 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
33 void PushSpan(const OUString
& rSpan
, const OUString
& rStyleName
);
34 void PushFieldSheetName(const OUString
& rStyleName
);
35 void PushFieldDate(const OUString
& rStyleName
);
36 void PushFieldTitle(const OUString
& rStyleName
);
37 void PushFieldURL(const OUString
& rURL
, const OUString
& rRep
, const OUString
& rStyleName
, const OUString
& rTargetFrame
);
41 * This context handles <text:span> element inside <text:p>.
43 class ScXMLCellTextSpanContext
: public ScXMLImportContext
45 ScXMLCellTextParaContext
& mrParentCxt
;
49 ScXMLCellTextSpanContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
51 virtual void SAL_CALL
startFastElement( sal_Int32 nElement
,
52 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
53 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
54 virtual void SAL_CALL
characters( const OUString
& aChars
) override
;
55 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
56 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
57 void submitContentAndClear();
61 * This context handles <text:sheet-name> element inside <text:p>.
63 class ScXMLCellFieldSheetNameContext
: public ScXMLImportContext
65 ScXMLCellTextParaContext
& mrParentCxt
;
68 ScXMLCellFieldSheetNameContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
70 void SetStyleName(const OUString
& rStyleName
);
72 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
76 * This context handles <text:date> element inside <text:p>.
78 class ScXMLCellFieldDateContext
: public ScXMLImportContext
80 ScXMLCellTextParaContext
& mrParentCxt
;
83 ScXMLCellFieldDateContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
85 void SetStyleName(const OUString
& rStyleName
);
87 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
91 * This context handles <text:title> element inside <text:p>.
93 class ScXMLCellFieldTitleContext
: public ScXMLImportContext
95 ScXMLCellTextParaContext
& mrParentCxt
;
98 ScXMLCellFieldTitleContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
100 void SetStyleName(const OUString
& rStyleName
);
102 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
106 * This context handles <text:a> element inside <text:p> or <text:span>.
108 class ScXMLCellFieldURLContext
: public ScXMLImportContext
110 ScXMLCellTextParaContext
& mrParentCxt
;
111 OUString maStyleName
;
114 OUString maTargetFrame
;
116 ScXMLCellFieldURLContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
118 void SetStyleName(const OUString
& rStyleName
);
120 virtual void SAL_CALL
startFastElement( sal_Int32 nElement
,
121 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
122 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
123 virtual void SAL_CALL
characters( const OUString
& aChars
) override
;
127 * This context handles <text:s> element inside <text:p> or <text:span>.
129 class ScXMLCellFieldSContext
: public ScXMLImportContext
131 ScXMLCellTextParaContext
& mrParentCxt
;
132 OUString maStyleName
;
137 ScXMLCellFieldSContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
139 void SetStyleName(const OUString
& rStyleName
);
141 virtual void SAL_CALL
startFastElement( sal_Int32 nElement
,
142 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
143 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
144 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
145 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
149 * This context handles <text:ruby> element inside <text:p>.
151 class ScXMLCellTextRubyContext
: public ScXMLImportContext
153 ScXMLCellTextParaContext
& mrParentCxt
;
154 OUString maRubyStyleName
;
155 OUString maRubyTextStyle
;
158 ScXMLCellTextRubyContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
160 virtual void SAL_CALL
startFastElement( sal_Int32 nElement
,
161 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
162 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
163 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
167 * This context handles <text:ruby-base> element inside <text:ruby>.
169 class ScXMLCellRubyBaseContext
: public ScXMLCellTextSpanContext
171 ScXMLCellTextParaContext
& mrParentCxt
;
173 ScXMLCellRubyBaseContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
174 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
175 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
179 * This context handles <text:ruby-text> element inside <text:ruby>.
181 class ScXMLCellRubyTextContext
: public ScXMLImportContext
183 OUString
& mrRubyText
;
184 OUString
& mrRubyTextStyle
;
186 ScXMLCellRubyTextContext(ScXMLImport
& rImport
, OUString
& rRubyText
, OUString
& rRubyTextStyle
);
188 virtual void SAL_CALL
startFastElement( sal_Int32 nElement
,
189 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
190 virtual void SAL_CALL
characters( const OUString
& aChars
) override
;
194 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */