StarObjectText.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2 
3 /* libstaroffice
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33 
34 /*
35  * Parser to convert a text zone/OLE in a StarOffice document
36  *
37  */
38 #ifndef STAR_OBJECT_TEXT
39 # define STAR_OBJECT_TEXT
40 
41 #include <vector>
42 
44 #include "StarObject.hxx"
45 
46 class StarState;
47 
48 namespace StarObjectTextInternal
49 {
51 struct Zone {
53  Zone()
54  {
55  }
57  virtual ~Zone();
59  virtual bool send(STOFFListenerPtr listener, StarState &state) const=0;
61  virtual void inventoryPage(StarState &/*state*/) const
62  {
63  }
64 };
65 
67 struct Content {
69  Content() : m_sectionName(""), m_zoneList()
70  {
71  }
73  ~Content();
75  bool send(STOFFListenerPtr listener, StarState &state) const;
77  void inventoryPages(StarState &state) const;
79  librevenge::RVNGString m_sectionName;
81  std::vector<shared_ptr<Zone> > m_zoneList;
82 };
83 
84 struct GraphZone;
85 struct SectionZone;
86 struct TextZone;
87 struct State;
88 }
89 
90 class StarZone;
91 
97 class StarObjectText : public StarObject
98 {
99 public:
101  StarObjectText(StarObject const &orig, bool duplicateState);
103  virtual ~StarObjectText();
104 
105  // try to parse all zone
106  bool parse();
107 
109  bool updatePageSpans(std::vector<STOFFPageSpan> &pageSpan, int &numPages);
111  bool sendPages(STOFFTextListenerPtr listener);
112 
114  static bool readSWImageMap(StarZone &zone);
115 
117  bool readSWContent(StarZone &zone, shared_ptr<StarObjectTextInternal::Content> &content);
118 protected:
119  //
120  // low level
121  //
122 
124  bool readSfxStyleSheets(STOFFInputStreamPtr input, std::string const &fileName);
126  bool readWriterDocument(STOFFInputStreamPtr input, std::string const &fileName);
127 
129  bool readDrawingLayer(STOFFInputStreamPtr input, std::string const &fileName);
130 
131 protected:
133  bool readSWGraphNode(StarZone &zone, shared_ptr<StarObjectTextInternal::GraphZone> &graphZone);
135  bool readSWJobSetUp(StarZone &zone);
137  bool readSWOLENode(StarZone &zone);
139  bool readSWSection(StarZone &zone, shared_ptr<StarObjectTextInternal::SectionZone> &section);
141  bool readSWTextZone(StarZone &zone, shared_ptr<StarObjectTextInternal::TextZone> &textZone);
142  //
143  // data
144  //
145 
147  shared_ptr<StarObjectTextInternal::State> m_textState;
148 private:
149  StarObjectText &operator=(StarObjectText const &orig);
150 };
151 #endif
152 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
virtual ~Zone()
destructor
Definition: StarObjectText.cxx:75
librevenge::RVNGString m_sectionName
the section name
Definition: StarObjectText.hxx:79
shared_ptr< STOFFInputStream > STOFFInputStreamPtr
a smart pointer of STOFFInputStream
Definition: libstaroffice_internal.hxx:474
virtual bool send(STOFFListenerPtr listener, StarState &state) const =0
try to send the data to a listener
std::vector< shared_ptr< Zone > > m_zoneList
the list of text zone
Definition: StarObjectText.hxx:81
class to store an state: ie.
Definition: StarState.hxx:65
shared_ptr< STOFFTextListener > STOFFTextListenerPtr
a smart pointer of STOFFTextListener
Definition: libstaroffice_internal.hxx:486
Internal: a sectionZone of StarObjectTextInteral.
Definition: StarObjectText.cxx:186
Internal: a basic sone of StarObjectTextInternal.
Definition: StarObjectText.hxx:51
Internal: a set of zone.
Definition: StarObjectText.hxx:67
shared_ptr< STOFFListener > STOFFListenerPtr
a smart pointer of STOFFListener
Definition: libstaroffice_internal.hxx:476
Internal: the state of a StarObjectText.
Definition: StarObjectText.cxx:542
Internal: the structures of a StarObjectText.
Definition: StarObjectText.cxx:71
Internal: a textZone of StarObjectTextInteral.
Definition: StarObjectText.cxx:226
Content()
constructor
Definition: StarObjectText.hxx:69
Zone()
constructor
Definition: StarObjectText.hxx:53
Internal: a graphZone of StarObjectTextInteral.
Definition: StarObjectText.cxx:142
the main class to read a StarOffice sdw file
Definition: StarObjectText.hxx:97
an object corresponding to an OLE directory
Definition: StarObject.hxx:64
a zone in a StarOffice file
Definition: StarZone.hxx:56
shared_ptr< StarObjectTextInternal::State > m_textState
the state
Definition: StarObjectText.hxx:147
virtual void inventoryPage(StarState &) const
try to inventory the different pages
Definition: StarObjectText.hxx:61

Generated on Sat Apr 29 2017 12:29:38 for libstaroffice by doxygen 1.8.13