tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / filter / xml / celltextparacontext.hxx
blob8a230c56f1bdff95afc6783f911a8d80ed011774
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #pragma once
12 #include "importcontext.hxx"
14 class ScXMLImport;
15 class ScXMLTableRowCellContext;
17 /**
18 * This context handles <text:p> element inside <table:table-cell>.
20 class ScXMLCellTextParaContext : public ScXMLImportContext
22 ScXMLTableRowCellContext& mrParentCxt;
23 OUString maContent;
24 public:
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);
39 /**
40 * This context handles <text:span> element inside <text:p>.
42 class ScXMLCellTextSpanContext : public ScXMLImportContext
44 ScXMLCellTextParaContext& mrParentCxt;
45 OUString maStyleName;
46 OUString maContent;
47 public:
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();
59 /**
60 * This context handles <text:sheet-name> element inside <text:p>.
62 class ScXMLCellFieldSheetNameContext : public ScXMLImportContext
64 ScXMLCellTextParaContext& mrParentCxt;
65 OUString maStyleName;
66 public:
67 ScXMLCellFieldSheetNameContext(ScXMLImport& rImport, ScXMLCellTextParaContext& rParent);
69 void SetStyleName(const OUString& rStyleName);
71 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
74 /**
75 * This context handles <text:date> element inside <text:p>.
77 class ScXMLCellFieldDateContext : public ScXMLImportContext
79 ScXMLCellTextParaContext& mrParentCxt;
80 OUString maStyleName;
81 public:
82 ScXMLCellFieldDateContext(ScXMLImport& rImport, ScXMLCellTextParaContext& rParent);
84 void SetStyleName(const OUString& rStyleName);
86 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
89 /**
90 * This context handles <text:title> element inside <text:p>.
92 class ScXMLCellFieldTitleContext : public ScXMLImportContext
94 ScXMLCellTextParaContext& mrParentCxt;
95 OUString maStyleName;
96 public:
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;
111 OUString maURL;
112 OUString maRep;
113 OUString maTargetFrame;
114 public:
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;
132 sal_Int32 mnCount;
134 void PushSpaces();
135 public:
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;
154 OUString maRubyText;
155 public:
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;
170 public:
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;
183 public:
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: */