Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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 : */
9 :
10 : #ifndef INCLUDED_SC_SOURCE_FILTER_INC_EXTLSTCONTEXT_HXX
11 : #define INCLUDED_SC_SOURCE_FILTER_INC_EXTLSTCONTEXT_HXX
12 :
13 : #include "excelhandlers.hxx"
14 : #include "worksheetfragment.hxx"
15 :
16 : #include <boost/ptr_container/ptr_vector.hpp>
17 :
18 : struct ScDataBarFormatData;
19 : class ScFormatEntry;
20 :
21 : namespace oox {
22 : namespace xls {
23 :
24 : class IconSetRule;
25 :
26 34 : class ExtCfRuleContext : public WorksheetContextBase
27 : {
28 : public:
29 : explicit ExtCfRuleContext( WorksheetContextBase& rFragment, ScDataBarFormatData* pDataBar );
30 :
31 : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) SAL_OVERRIDE;
32 : virtual void onStartElement( const AttributeList& rAttribs ) SAL_OVERRIDE;
33 :
34 : private:
35 : ScDataBarFormatData* mpTarget;
36 :
37 : bool mbFirstEntry;
38 : };
39 :
40 44 : class ExtConditionalFormattingContext : public WorksheetContextBase
41 : {
42 : public:
43 : explicit ExtConditionalFormattingContext(WorksheetContextBase& rFragment);
44 :
45 : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) SAL_OVERRIDE;
46 : virtual void onStartElement( const AttributeList& rAttribs ) SAL_OVERRIDE;
47 : virtual void onCharacters(const OUString& rCharacters) SAL_OVERRIDE;
48 : virtual void onEndElement() SAL_OVERRIDE;
49 :
50 : private:
51 : OUString aChars;
52 : boost::ptr_vector<ScFormatEntry> maEntries;
53 : IconSetRule* mpCurrentRule;
54 : };
55 :
56 : /**
57 : * Handle ExtLst entries in xlsx. These entries are a way to extend the standard
58 : * without actually changing it
59 : *
60 : * Needed right now for data bars
61 : *
62 : * ExtLstLocalContext is for the entry in the datastructure that needs to be extended
63 : */
64 34 : class ExtLstLocalContext : public WorksheetContextBase
65 : {
66 : public:
67 : explicit ExtLstLocalContext( WorksheetContextBase& rFragment, ScDataBarFormatData* pTarget ); // until now a ExtLst always extends an existing entry
68 :
69 : protected:
70 : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) SAL_OVERRIDE;
71 : virtual void onStartElement( const AttributeList& rAttribs ) SAL_OVERRIDE;
72 : virtual void onCharacters( const OUString& rChars ) SAL_OVERRIDE;
73 :
74 : private:
75 : ScDataBarFormatData* mpTarget;
76 : };
77 :
78 : /**
79 : * A single ext entry. Will be skipped until the actual entry with the correct uri is found
80 : */
81 14 : class ExtGlobalContext : public WorksheetContextBase
82 : {
83 : public:
84 : explicit ExtGlobalContext( WorksheetContextBase& rFragment );
85 :
86 : protected:
87 : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) SAL_OVERRIDE;
88 : virtual void onStartElement( const AttributeList& rAttribs ) SAL_OVERRIDE;
89 :
90 : private:
91 : };
92 :
93 : /**
94 : * Used for the actual ExtLst containing the new extended definition.
95 : * Uses the saved data from the ExtLstLocalContext
96 : */
97 14 : class ExtLstGlobalContext : public WorksheetContextBase
98 : {
99 : public:
100 : explicit ExtLstGlobalContext( WorksheetFragment& rFragment );
101 :
102 : protected:
103 : virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) SAL_OVERRIDE;
104 : };
105 :
106 : } //namespace xls
107 : } //namespace oox
108 :
109 : #endif
110 :
111 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|