StarObject.hxx
Go to the documentation of this file.
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
/* libstaroffice
* Version: MPL 2.0 / LGPLv2+
*
* The contents of this file are subject to the Mozilla Public License Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
* Copyright (C) 2006, 2007 Andrew Ziem
* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
*
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
* in which case the provisions of the LGPLv2+ are applicable
* instead of those above.
*/
/*
* class to parse/store an object corresponding to an OLE directory
*
*/
#ifndef STAR_OBJECT
# define STAR_OBJECT
#include <vector>
#include <stack>
#include <libstaroffice/STOFFDocument.hxx>
#include "STOFFDebug.hxx"
#include "STOFFOLEParser.hxx"
#include "StarItemPool.hxx"
namespace StarObjectInternal
{
struct State;
}
class StarAttributeManager;
class StarFormatManager;
class StarItemSet;
class StarObject
{
public:
StarObject(char const *passwd, std::shared_ptr<STOFFOLEParser> &oleParser, std::shared_ptr<STOFFOLEParser::OleDirectory> &directory);
virtual ~StarObject();
//
// basic
//
bool parse();
STOFFDocument::Kind getDocumentKind() const;
char const *getPassword() const
{
return m_password;
}
std::shared_ptr<STOFFOLEParser::OleDirectory> getOLEDirectory()
{
return m_directory;
}
std::shared_ptr<StarAttributeManager> getAttributeManager();
std::shared_ptr<StarFormatManager> getFormatManager();
librevenge::RVNGPropertyList const &getMetaData() const
{
return m_metaData;
}
librevenge::RVNGString getUserNameMetaData(int i) const;
// the document pool
void cleanPools();
std::shared_ptr<StarItemPool> getNewItemPool(StarItemPool::Type type);
std::shared_ptr<StarItemPool> findItemPool(StarItemPool::Type type, bool isInside);
std::shared_ptr<StarItemPool> getCurrentPool(bool onlyInside=true);
bool readPersistData(StarZone &zone, long endPos);
bool readSfxStyleSheets(STOFFInputStreamPtr input, std::string const &name);
bool readItemSet(StarZone &zone, std::vector<STOFFVec2i> const &limits, long endPos,
StarItemSet &itemSet, StarItemPool *pool=nullptr, bool isDirect=false);
protected:
bool readPersistElements(STOFFInputStreamPtr input, std::string const &name);
bool readSfxDocumentInformation(STOFFInputStreamPtr input, std::string const &name);
bool readSfxPreview(STOFFInputStreamPtr input, std::string const &name);
bool readSfxWindows(STOFFInputStreamPtr input, libstoff::DebugFile &ascii);
bool readStarFrameworkConfigFile(STOFFInputStreamPtr input, libstoff::DebugFile &ascii);
bool readStarFrameworkConfigItem(STOFFEntry &entry, STOFFInputStreamPtr input, libstoff::DebugFile &ascii);
//
// data
//
protected:
StarObject(StarObject const &orig, bool duplicateState);
char const *m_password;
std::shared_ptr<STOFFOLEParser> m_oleParser;
std::shared_ptr<STOFFOLEParser::OleDirectory> m_directory;
std::shared_ptr<StarObjectInternal::State> m_state;
librevenge::RVNGPropertyList m_metaData;
private:
StarObject(StarObject const &orig) = delete;
StarObject &operator=(StarObject const &orig) = delete;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
STOFFDebug.hxx
STOFFDocument.hxx
STOFFOLEParser.hxx
StarItemPool.hxx
STOFFDocument::Kind
Kind
an enum to define the kind of document
Definition STOFFDocument.hxx:66
STOFFEntry
basic class to store an entry in a file This contained :
Definition STOFFEntry.hxx:47
StarAttributeManager
the main class to read/.
Definition StarAttribute.hxx:1081
StarFormatManager
the main class to read/.
Definition StarFormatManager.hxx:91
StarItemPool
the main class to read/.
Definition StarItemPool.hxx:71
StarItemPool::Type
Type
the known item pool
Definition StarItemPool.hxx:75
StarItemSet
class to store a list of item
Definition StarItem.hxx:88
StarObject
an object corresponding to an OLE directory
Definition StarObject.hxx:65
StarObject::readSfxStyleSheets
bool readSfxStyleSheets(STOFFInputStreamPtr input, std::string const &name)
try to read a spreadshet style zone: SfxStyleSheets
Definition StarObject.cxx:638
StarObject::m_state
std::shared_ptr< StarObjectInternal::State > m_state
the state
Definition StarObject.hxx:148
StarObject::findItemPool
std::shared_ptr< StarItemPool > findItemPool(StarItemPool::Type type, bool isInside)
check if a pool corresponding to a given type is opened if so returned it.
Definition StarObject.cxx:159
StarObject::getDocumentKind
STOFFDocument::Kind getDocumentKind() const
returns the document kind
Definition StarObject.cxx:115
StarObject::m_password
char const * m_password
the document password
Definition StarObject.hxx:141
StarObject::getOLEDirectory
std::shared_ptr< STOFFOLEParser::OleDirectory > getOLEDirectory()
returns the object directory
Definition StarObject.hxx:86
StarObject::readStarFrameworkConfigFile
bool readStarFrameworkConfigFile(STOFFInputStreamPtr input, libstoff::DebugFile &ascii)
try to read the "Star Framework Config File"
Definition StarObject.cxx:687
StarObject::readPersistData
bool readPersistData(StarZone &zone, long endPos)
try to read persist data
Definition StarObject.cxx:363
StarObject::readStarFrameworkConfigItem
bool readStarFrameworkConfigItem(STOFFEntry &entry, STOFFInputStreamPtr input, libstoff::DebugFile &ascii)
try to read an item in a "Star Framework Config File"
Definition StarObject.cxx:764
StarObject::readPersistElements
bool readPersistElements(STOFFInputStreamPtr input, std::string const &name)
the "persist elements" small ole: the list of object
Definition StarObject.cxx:287
StarObject::readItemSet
bool readItemSet(StarZone &zone, std::vector< STOFFVec2i > const &limits, long endPos, StarItemSet &itemSet, StarItemPool *pool=nullptr, bool isDirect=false)
try to read a list of item
Definition StarObject.cxx:229
StarObject::~StarObject
virtual ~StarObject()
destructor
Definition StarObject.cxx:102
StarObject::StarObject
StarObject(StarObject const &orig)=delete
StarObject::readSfxWindows
bool readSfxWindows(STOFFInputStreamPtr input, libstoff::DebugFile &ascii)
try to read the windows information : "SfxWindows"
Definition StarObject.cxx:824
StarObject::m_oleParser
std::shared_ptr< STOFFOLEParser > m_oleParser
the ole parser
Definition StarObject.hxx:143
StarObject::StarObject
StarObject(char const *passwd, std::shared_ptr< STOFFOLEParser > &oleParser, std::shared_ptr< STOFFOLEParser::OleDirectory > &directory)
constructor
Definition StarObject.cxx:80
StarObject::readSfxDocumentInformation
bool readSfxDocumentInformation(STOFFInputStreamPtr input, std::string const &name)
try to read the document information : "SfxDocumentInformation"
Definition StarObject.cxx:488
StarObject::getUserNameMetaData
librevenge::RVNGString getUserNameMetaData(int i) const
returns the ith user meta data
Definition StarObject.cxx:130
StarObject::operator=
StarObject & operator=(StarObject const &orig)=delete
StarObject::getMetaData
librevenge::RVNGPropertyList const & getMetaData() const
returns the meta data (filled by readSfxDocumentInformation)
Definition StarObject.hxx:95
StarObject::getNewItemPool
std::shared_ptr< StarItemPool > getNewItemPool(StarItemPool::Type type)
returns a new item pool for this document
Definition StarObject.cxx:142
StarObject::m_metaData
librevenge::RVNGPropertyList m_metaData
the meta data
Definition StarObject.hxx:150
StarObject::getFormatManager
std::shared_ptr< StarFormatManager > getFormatManager()
returns the format manager
Definition StarObject.cxx:125
StarObject::getAttributeManager
std::shared_ptr< StarAttributeManager > getAttributeManager()
returns the attribute manager
Definition StarObject.cxx:120
StarObject::cleanPools
void cleanPools()
clean each pool
Definition StarObject.cxx:106
StarObject::m_directory
std::shared_ptr< STOFFOLEParser::OleDirectory > m_directory
the directory
Definition StarObject.hxx:145
StarObject::readSfxPreview
bool readSfxPreview(STOFFInputStreamPtr input, std::string const &name)
try to read the preview : "SfxPreview"
Definition StarObject.cxx:800
StarObject::parse
bool parse()
try to parse data
Definition StarObject.cxx:170
StarObject::getPassword
char const * getPassword() const
returns the document password (the password given by the user)
Definition StarObject.hxx:81
StarObject::getCurrentPool
std::shared_ptr< StarItemPool > getCurrentPool(bool onlyInside=true)
returns the current all/inside pool
Definition StarObject.cxx:149
StarZone
a zone in a StarOffice file
Definition StarZone.hxx:57
libstoff::DebugFile
Definition STOFFDebug.hxx:211
STOFFInputStreamPtr
std::shared_ptr< STOFFInputStream > STOFFInputStreamPtr
a smart pointer of STOFFInputStream
Definition libstaroffice_internal.hxx:489
StarObjectInternal
Internal: the structures of a StarObject.
Definition StarObject.cxx:52
StarObjectInternal::State
the state of a StarObject
Definition StarObject.cxx:54