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/.
12 #include "importcontext.hxx"
15 class ScXMLTableRowCellContext
;
18 * This context handles <text:p> element inside <table:table-cell>.
20 class ScXMLCellTextParaContext
: public ScXMLImportContext
22 ScXMLTableRowCellContext
& mrParentCxt
;
25 ScXMLCellTextParaContext(ScXMLImport
& rImport
, ScXMLTableRowCellContext
& rParent
);
27 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
28 virtual void SAL_CALL
characters( const OUString
& aChars
) override
;
29 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
30 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
32 void PushSpan(std::u16string_view aSpan
, const OUString
& rStyleName
);
33 void PushFieldSheetName(const OUString
& rStyleName
);
34 void PushFieldDate(const OUString
& rStyleName
);
35 void PushFieldTitle(const OUString
& rStyleName
);
36 void PushFieldURL(const OUString
& rURL
, const OUString
& rRep
, const OUString
& rStyleName
, const OUString
& rTargetFrame
);
40 * This context handles <text:span> element inside <text:p>.
42 class ScXMLCellTextSpanContext
: public ScXMLImportContext
44 ScXMLCellTextParaContext
& mrParentCxt
;
48 ScXMLCellTextSpanContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
50 virtual void SAL_CALL
startFastElement( sal_Int32 nElement
,
51 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
52 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
53 virtual void SAL_CALL
characters( const OUString
& aChars
) override
;
54 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
55 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
56 void submitContentAndClear();
60 * This context handles <text:sheet-name> element inside <text:p>.
62 class ScXMLCellFieldSheetNameContext
: public ScXMLImportContext
64 ScXMLCellTextParaContext
& mrParentCxt
;
67 ScXMLCellFieldSheetNameContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
69 void SetStyleName(const OUString
& rStyleName
);
71 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
75 * This context handles <text:date> element inside <text:p>.
77 class ScXMLCellFieldDateContext
: public ScXMLImportContext
79 ScXMLCellTextParaContext
& mrParentCxt
;
82 ScXMLCellFieldDateContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
84 void SetStyleName(const OUString
& rStyleName
);
86 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
90 * This context handles <text:title> element inside <text:p>.
92 class ScXMLCellFieldTitleContext
: public ScXMLImportContext
94 ScXMLCellTextParaContext
& mrParentCxt
;
97 ScXMLCellFieldTitleContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
99 void SetStyleName(const OUString
& rStyleName
);
101 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
105 * This context handles <text:a> element inside <text:p> or <text:span>.
107 class ScXMLCellFieldURLContext
: public ScXMLImportContext
109 ScXMLCellTextParaContext
& mrParentCxt
;
110 OUString maStyleName
;
113 OUString maTargetFrame
;
115 ScXMLCellFieldURLContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
117 void SetStyleName(const OUString
& rStyleName
);
119 virtual void SAL_CALL
startFastElement( sal_Int32 nElement
,
120 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
121 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
122 virtual void SAL_CALL
characters( const OUString
& aChars
) override
;
126 * This context handles <text:s> element inside <text:p> or <text:span>.
128 class ScXMLCellFieldSContext
: public ScXMLImportContext
130 ScXMLCellTextParaContext
& mrParentCxt
;
131 OUString maStyleName
;
136 ScXMLCellFieldSContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
138 void SetStyleName(const OUString
& rStyleName
);
140 virtual void SAL_CALL
startFastElement( sal_Int32 nElement
,
141 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
142 virtual void SAL_CALL
endFastElement( sal_Int32 nElement
) override
;
143 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
144 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
148 * This context handles <text:ruby> element inside <text:p>.
150 class ScXMLCellTextRubyContext
: public ScXMLImportContext
152 ScXMLCellTextParaContext
& mrParentCxt
;
153 OUString maRubyTextStyle
;
156 ScXMLCellTextRubyContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
158 virtual void SAL_CALL
startFastElement( sal_Int32 nElement
,
159 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
160 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
161 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
165 * This context handles <text:ruby-base> element inside <text:ruby>.
167 class ScXMLCellRubyBaseContext
: public ScXMLCellTextSpanContext
169 ScXMLCellTextParaContext
& mrParentCxt
;
171 ScXMLCellRubyBaseContext(ScXMLImport
& rImport
, ScXMLCellTextParaContext
& rParent
);
172 virtual css::uno::Reference
< css::xml::sax::XFastContextHandler
> SAL_CALL
createFastChildContext(
173 sal_Int32 nElement
, const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
177 * This context handles <text:ruby-text> element inside <text:ruby>.
179 class ScXMLCellRubyTextContext
: public ScXMLImportContext
181 OUString
& mrRubyText
;
182 OUString
& mrRubyTextStyle
;
184 ScXMLCellRubyTextContext(ScXMLImport
& rImport
, OUString
& rRubyText
, OUString
& rRubyTextStyle
);
186 virtual void SAL_CALL
startFastElement( sal_Int32 nElement
,
187 const css::uno::Reference
< css::xml::sax::XFastAttributeList
>& xAttrList
) override
;
188 virtual void SAL_CALL
characters( const OUString
& aChars
) override
;
191 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */