Line data Source code
1 : /*************************************************************************
2 : *
3 : * Copyright (c) 2010, 2011 Kohei Yoshida
4 : *
5 : * Permission is hereby granted, free of charge, to any person
6 : * obtaining a copy of this software and associated documentation
7 : * files (the "Software"), to deal in the Software without
8 : * restriction, including without limitation the rights to use,
9 : * copy, modify, merge, publish, distribute, sublicense, and/or sell
10 : * copies of the Software, and to permit persons to whom the
11 : * Software is furnished to do so, subject to the following
12 : * conditions:
13 : *
14 : * The above copyright notice and this permission notice shall be
15 : * included in all copies or substantial portions of the Software.
16 : *
17 : * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 : * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19 : * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 : * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 : * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 : * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 : * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 : * OTHER DEALINGS IN THE SOFTWARE.
25 : *
26 : ************************************************************************/
27 :
28 : #include "orcus/gnumeric/gnumeric_context.hpp"
29 : #include "orcus/gnumeric/gnumeric_token_constants.hpp"
30 : #include "orcus/gnumeric/gnumeric_sheet_context.hpp"
31 : #include "orcus/global.hpp"
32 : #include "orcus/spreadsheet/import_interface.hpp"
33 :
34 : #include <iostream>
35 : #include <fstream>
36 : #include <algorithm>
37 :
38 : using namespace std;
39 :
40 : namespace orcus {
41 :
42 : namespace {
43 :
44 : }
45 :
46 : // ============================================================================
47 :
48 0 : gnumeric_content_xml_context::gnumeric_content_xml_context(const tokens& tokens, spreadsheet::iface::import_factory* factory) :
49 : xml_context_base(tokens),
50 0 : mp_factory(factory)
51 : {
52 0 : }
53 :
54 0 : gnumeric_content_xml_context::~gnumeric_content_xml_context()
55 : {
56 0 : }
57 :
58 0 : bool gnumeric_content_xml_context::can_handle_element(xmlns_token_t ns, xml_token_t name) const
59 : {
60 0 : if (ns == XMLNS_gnm && name == XML_Sheet)
61 : return false;
62 :
63 0 : return true;
64 : }
65 :
66 0 : xml_context_base* gnumeric_content_xml_context::create_child_context(xmlns_token_t ns, xml_token_t name) const
67 : {
68 0 : if (ns == XMLNS_gnm && name == XML_Sheet)
69 0 : return new gnumeric_sheet_context(get_tokens(), mp_factory);
70 :
71 : return NULL;
72 : }
73 :
74 0 : void gnumeric_content_xml_context::end_child_context(xmlns_token_t ns, xml_token_t name, xml_context_base* child)
75 : {
76 0 : }
77 :
78 0 : void gnumeric_content_xml_context::start_element(xmlns_token_t ns, xml_token_t name, const xml_attrs_t& attrs)
79 : {
80 0 : push_stack(ns, name);
81 :
82 0 : if (ns == XMLNS_gnm)
83 : {
84 : switch (name)
85 : {
86 : default:
87 0 : warn_unhandled();
88 : }
89 : }
90 : else
91 0 : warn_unhandled();
92 0 : }
93 :
94 0 : bool gnumeric_content_xml_context::end_element(xmlns_token_t ns, xml_token_t name)
95 : {
96 : if (ns == XMLNS_gnm)
97 : {
98 : switch (name)
99 : {
100 :
101 : }
102 : }
103 0 : return pop_stack(ns, name);
104 : }
105 :
106 0 : void gnumeric_content_xml_context::characters(const pstring& str)
107 : {
108 0 : }
109 :
110 24 : }
|