StarObject.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  * class to parse/store an object corresponding to an OLE directory
36  *
37  */
38 #ifndef STAR_OBJECT
39 # define STAR_OBJECT
40 
41 #include <vector>
42 #include <stack>
44 
45 #include "STOFFDebug.hxx"
46 #include "STOFFOLEParser.hxx"
47 
48 #include "StarItemPool.hxx"
49 
50 namespace StarObjectInternal
51 {
52 struct State;
53 }
54 
56 class StarFormatManager;
57 class StarItemSet;
58 
65 {
66 public:
68  StarObject(char const *passwd, shared_ptr<STOFFOLEParser::OleDirectory> directory);
70  virtual ~StarObject();
71 
72  //
73  // basic
74  //
75 
77  bool parse();
79  STOFFDocument::Kind getDocumentKind() const;
81  char const *getPassword() const
82  {
83  return m_password;
84  }
86  shared_ptr<STOFFOLEParser::OleDirectory> getOLEDirectory()
87  {
88  return m_directory;
89  }
91  shared_ptr<StarAttributeManager> getAttributeManager();
93  shared_ptr<StarFormatManager> getFormatManager();
95  librevenge::RVNGPropertyList const &getMetaData() const
96  {
97  return m_metaData;
98  }
99 
100  // the document pool
102  void cleanPools();
104  shared_ptr<StarItemPool> getNewItemPool(StarItemPool::Type type);
108  shared_ptr<StarItemPool> findItemPool(StarItemPool::Type type, bool isInside);
110  shared_ptr<StarItemPool> getCurrentPool(bool onlyInside=true);
111 
113  bool readPersistData(StarZone &zone, long endPos);
115  bool readSfxStyleSheets(STOFFInputStreamPtr input, std::string const &name);
117  bool readItemSet(StarZone &zone, std::vector<STOFFVec2i> const &limits, long endPos,
118  StarItemSet &itemSet, StarItemPool *pool=0, bool isDirect=false);
119 protected:
121  bool readPersistElements(STOFFInputStreamPtr input, std::string const &name);
123  bool readSfxDocumentInformation(STOFFInputStreamPtr input, std::string const &name);
125  bool readSfxPreview(STOFFInputStreamPtr input, std::string const &name);
127  bool readSfxWindows(STOFFInputStreamPtr input, libstoff::DebugFile &ascii);
129  bool readStarFrameworkConfigFile(STOFFInputStreamPtr input, libstoff::DebugFile &ascii);
130 
131  //
132  // data
133  //
134 protected:
136  StarObject(StarObject const &orig, bool duplicateState);
138  char const *m_password;
140  shared_ptr<STOFFOLEParser::OleDirectory> m_directory;
141 
143  shared_ptr<StarObjectInternal::State> m_state;
145  librevenge::RVNGPropertyList m_metaData;
146 
147 private:
148  StarObject(StarObject const &orig);
149  StarObject &operator=(StarObject const &orig);
150 };
151 
152 #endif
153 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
shared_ptr< STOFFInputStream > STOFFInputStreamPtr
a smart pointer of STOFFInputStream
Definition: libstaroffice_internal.hxx:482
char const * getPassword() const
returns the document password (the password given by the user)
Definition: StarObject.hxx:81
the main class to read/.
Definition: StarAttribute.hxx:1110
Definition: STOFFDebug.hxx:198
Type
the known item pool
Definition: StarItemPool.hxx:75
Internal: the structures of a StarObject.
Definition: StarObject.cxx:51
shared_ptr< StarObjectInternal::State > m_state
the state
Definition: StarObject.hxx:143
the main class to read/.
Definition: StarFormatManager.hxx:62
char const * m_password
the document password
Definition: StarObject.hxx:138
librevenge::RVNGPropertyList m_metaData
the meta data
Definition: StarObject.hxx:145
shared_ptr< STOFFOLEParser::OleDirectory > getOLEDirectory()
returns the object directory
Definition: StarObject.hxx:86
shared_ptr< STOFFOLEParser::OleDirectory > m_directory
the directory
Definition: StarObject.hxx:140
class to store a list of item
Definition: StarItem.hxx:79
Kind
an enum to define the kind of document
Definition: STOFFDocument.hxx:66
librevenge::RVNGPropertyList const & getMetaData() const
returns the meta data (filled by readSfxDocumentInformation)
Definition: StarObject.hxx:95
the main class to read/.
Definition: StarItemPool.hxx:70
an object corresponding to an OLE directory
Definition: StarObject.hxx:64
a zone in a StarOffice file
Definition: StarZone.hxx:56

Generated on Mon Jul 25 2016 14:48:13 for libstaroffice by doxygen 1.8.11