Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / source / filter / xml / celltextparacontext.hxx
blob3d62077c329e19f7e22f3fd0664d278df551da6b
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 #ifndef INCLUDED_SC_SOURCE_FILTER_XML_CELLTEXTPARACONTEXT_HXX
11 #define INCLUDED_SC_SOURCE_FILTER_XML_CELLTEXTPARACONTEXT_HXX
13 #include "importcontext.hxx"
15 class ScXMLImport;
16 class ScXMLTableRowCellContext;
18 /**
19 * This context handles <text:p> element inside <table:table-cell>.
21 class ScXMLCellTextParaContext : public ScXMLImportContext
23 ScXMLTableRowCellContext& mrParentCxt;
24 OUString maContent;
25 public:
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);
40 /**
41 * This context handles <text:span> element inside <text:p>.
43 class ScXMLCellTextSpanContext : public ScXMLImportContext
45 ScXMLCellTextParaContext& mrParentCxt;
46 OUString maStyleName;
47 OUString maContent;
48 public:
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;
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 startFastElement( sal_Int32 nElement,
72 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
73 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
76 /**
77 * This context handles <text:date> element inside <text:p>.
79 class ScXMLCellFieldDateContext : public ScXMLImportContext
81 ScXMLCellTextParaContext& mrParentCxt;
82 OUString maStyleName;
83 public:
84 ScXMLCellFieldDateContext(ScXMLImport& rImport, ScXMLCellTextParaContext& rParent);
86 void SetStyleName(const OUString& rStyleName);
88 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
91 /**
92 * This context handles <text:title> element inside <text:p>.
94 class ScXMLCellFieldTitleContext : public ScXMLImportContext
96 ScXMLCellTextParaContext& mrParentCxt;
97 OUString maStyleName;
98 public:
99 ScXMLCellFieldTitleContext(ScXMLImport& rImport, ScXMLCellTextParaContext& rParent);
101 void SetStyleName(const OUString& rStyleName);
103 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
107 * This context handles <text:a> element inside <text:p> or <text:span>.
109 class ScXMLCellFieldURLContext : public ScXMLImportContext
111 ScXMLCellTextParaContext& mrParentCxt;
112 OUString maStyleName;
113 OUString maURL;
114 OUString maRep;
115 OUString maTargetFrame;
116 public:
117 ScXMLCellFieldURLContext(ScXMLImport& rImport, ScXMLCellTextParaContext& rParent);
119 void SetStyleName(const OUString& rStyleName);
121 virtual void SAL_CALL startFastElement( sal_Int32 nElement,
122 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
123 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
124 virtual void SAL_CALL characters( const OUString& aChars ) override;
128 * This context handles <text:s> element inside <text:p> or <text:span>.
130 class ScXMLCellFieldSContext : public ScXMLImportContext
132 ScXMLCellTextParaContext& mrParentCxt;
133 OUString maStyleName;
134 sal_Int32 mnCount;
136 void PushSpaces();
137 public:
138 ScXMLCellFieldSContext(ScXMLImport& rImport, ScXMLCellTextParaContext& rParent);
140 void SetStyleName(const OUString& rStyleName);
142 virtual void SAL_CALL startFastElement( sal_Int32 nElement,
143 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
144 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
145 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
146 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
149 #endif
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */