/src/libetonyek/src/lib/contexts/IWORKStylesContext.cpp
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* |
3 | | * This file is part of the libetonyek 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 | | #include "IWORKStylesContext.h" |
11 | | |
12 | | #include "IWORKDictionary.h" |
13 | | #include "IWORKStyle_fwd.h" |
14 | | #include "IWORKStyleContext.h" |
15 | | #include "IWORKStyleRefContext.h" |
16 | | #include "IWORKToken.h" |
17 | | #include "IWORKXMLParserState.h" |
18 | | |
19 | | namespace libetonyek |
20 | | { |
21 | | IWORKStylesContext::IWORKStylesContext(IWORKXMLParserState &state, const bool anonymous) |
22 | 0 | : IWORKXMLElementContextBase(state) |
23 | 0 | , m_anonymous(anonymous) |
24 | 0 | { |
25 | 0 | } |
26 | | |
27 | | IWORKXMLContextPtr_t IWORKStylesContext::element(const int name) |
28 | 0 | { |
29 | 0 | switch (name) |
30 | 0 | { |
31 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::connection_style : |
32 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_graphicStyles); |
33 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::headline_style : |
34 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_headlineStyles); |
35 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::liststyle : |
36 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_listStyles); |
37 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::cell_style : |
38 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_cellStyles); |
39 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::chart_style : |
40 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_chartStyles); |
41 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::chart_series_style : |
42 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_chartSeriesStyles); |
43 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::graphic_style : |
44 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_graphicStyles); |
45 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::characterstyle : |
46 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_characterStyles); |
47 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::layoutstyle : |
48 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_layoutStyles); |
49 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle : |
50 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_paragraphStyles); |
51 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::table_style : |
52 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_tableStyles); |
53 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::table_cell_style : |
54 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_tableCellStyles); |
55 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::table_vector_style : |
56 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_tableVectorStyles); |
57 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::tabular_style : |
58 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_tabularStyles); |
59 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::tocstyle : |
60 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_tocStyles); |
61 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::vector_style : |
62 | 0 | return std::make_shared<IWORKStyleContext>(getState(), &getState().getDictionary().m_vectorStyles); |
63 | | |
64 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::cell_style_ref : |
65 | 0 | return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_cellStyles); |
66 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::characterstyle_ref : |
67 | 0 | return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_characterStyles); |
68 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::chart_style_ref : |
69 | 0 | return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_chartStyles); |
70 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::chart_series_style_ref : |
71 | 0 | return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_chartSeriesStyles); |
72 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::connection_style_ref : |
73 | 0 | return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_graphicStyles); |
74 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::graphic_style_ref : |
75 | 0 | return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_graphicStyles); |
76 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::layoutstyle_ref : |
77 | 0 | return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_layoutStyles); |
78 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::liststyle_ref : |
79 | 0 | return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_listStyles); |
80 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::paragraphstyle_ref : |
81 | 0 | return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_paragraphStyles); |
82 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::table_style_ref : |
83 | 0 | return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_tableStyles); |
84 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::table_cell_style_ref : |
85 | 0 | return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_tableCellStyles); |
86 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::table_vector_style_ref : |
87 | 0 | return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_tableVectorStyles); |
88 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::tabular_style_ref : |
89 | 0 | return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_tabularStyles); |
90 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::tocstyle_ref : |
91 | 0 | return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_tocStyles); |
92 | 0 | case IWORKToken::NS_URI_SF | IWORKToken::vector_style_ref : |
93 | 0 | return std::make_shared<IWORKStyleRefContext>(getState(), getState().getDictionary().m_vectorStyles); |
94 | 0 | default: |
95 | 0 | ETONYEK_DEBUG_MSG(("IWORKStylesContext::element: find some unknown element %d\n", int(name))); |
96 | 0 | } |
97 | | |
98 | 0 | return IWORKXMLContextPtr_t(); |
99 | 0 | } |
100 | | |
101 | | void IWORKStylesContext::endOfElement() |
102 | 0 | { |
103 | 0 | } |
104 | | |
105 | | |
106 | | } |
107 | | |
108 | | /* vim:set shiftwidth=2 softtabstop=2 expandtab: */ |