StarObjectText.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.
*/
/*
* Parser to convert a text zone/OLE in a StarOffice document
*
*/
#ifndef STAR_OBJECT_TEXT
# define STAR_OBJECT_TEXT
#include <vector>
#include "libstaroffice_internal.hxx"
#include "StarObject.hxx"
class StarState;
namespace StarObjectTextInternal
{
struct Zone {
Zone()
{
}
virtual ~Zone();
virtual bool send(STOFFListenerPtr &listener, StarState &state) const=0;
virtual void inventoryPage(StarState &/*state*/) const
{
}
};
struct Content {
Content()
: m_sectionName("")
, m_zoneList()
{
}
~Content();
bool send(STOFFListenerPtr &listener, StarState &state, bool isFlyer=false) const;
void inventoryPages(StarState &state) const;
librevenge::RVNGString m_sectionName;
std::vector<std::shared_ptr<Zone> > m_zoneList;
};
struct GraphZone;
struct OLEZone;
struct SectionZone;
struct TextZone;
struct State;
}
class StarZone;
class StarObjectText final : public StarObject
{
public:
StarObjectText(StarObject const &orig, bool duplicateState);
~StarObjectText() final;
// try to parse all zone
bool parse();
bool updatePageSpans(std::vector<STOFFPageSpan> &pageSpan, int &numPages);
bool sendPages(STOFFTextListenerPtr &listener);
static bool readSWImageMap(StarZone &zone);
bool readSWContent(StarZone &zone, std::shared_ptr<StarObjectTextInternal::Content> &content);
protected:
//
// low level
//
bool readSfxStyleSheets(STOFFInputStreamPtr input, std::string const &fileName);
bool readWriterDocument(STOFFInputStreamPtr input, std::string const &fileName);
bool readDrawingLayer(STOFFInputStreamPtr input, std::string const &fileName);
protected:
bool readSWGraphNode(StarZone &zone, std::shared_ptr<StarObjectTextInternal::GraphZone> &graphZone);
bool readSWJobSetUp(StarZone &zone);
bool readSWOLENode(StarZone &zone, std::shared_ptr<StarObjectTextInternal::OLEZone> &ole);
bool readSWSection(StarZone &zone, std::shared_ptr<StarObjectTextInternal::SectionZone> &section);
bool readSWTextZone(StarZone &zone, std::shared_ptr<StarObjectTextInternal::TextZone> &textZone);
//
// data
//
std::shared_ptr<StarObjectTextInternal::State> m_textState;
private:
StarObjectText &operator=(StarObjectText const &orig) = delete;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
StarObject.hxx
StarObjectText::readSWContent
bool readSWContent(StarZone &zone, std::shared_ptr< StarObjectTextInternal::Content > &content)
try to read some content : 'N'
Definition StarObjectText.cxx:958
StarObjectText::readDrawingLayer
bool readDrawingLayer(STOFFInputStreamPtr input, std::string const &fileName)
the drawing layers ?
Definition StarObjectText.cxx:1614
StarObjectText::StarObjectText
StarObjectText(StarObject const &orig, bool duplicateState)
constructor
Definition StarObjectText.cxx:742
StarObjectText::updatePageSpans
bool updatePageSpans(std::vector< STOFFPageSpan > &pageSpan, int &numPages)
try to update the page span (to create draw document)
Definition StarObjectText.cxx:756
StarObjectText::readWriterDocument
bool readWriterDocument(STOFFInputStreamPtr input, std::string const &fileName)
the main zone
Definition StarObjectText.cxx:1708
StarObjectText::readSWSection
bool readSWSection(StarZone &zone, std::shared_ptr< StarObjectTextInternal::SectionZone > &section)
try to read a section : 'I'
Definition StarObjectText.cxx:1366
StarObjectText::readSfxStyleSheets
bool readSfxStyleSheets(STOFFInputStreamPtr input, std::string const &fileName)
try to read a text style zone: SfxStyleSheets
Definition StarObjectText.cxx:902
StarObjectText::readSWTextZone
bool readSWTextZone(StarZone &zone, std::shared_ptr< StarObjectTextInternal::TextZone > &textZone)
try to read some content : 'T'
Definition StarObjectText.cxx:1445
StarObjectText::readSWJobSetUp
bool readSWJobSetUp(StarZone &zone)
try to read a SW zone setup : 'J'
Definition StarObjectText.cxx:1289
StarObjectText::readSWImageMap
static bool readSWImageMap(StarZone &zone)
try to read a image map zone : 'X'
Definition StarObjectText.cxx:1205
StarObjectText::readSWOLENode
bool readSWOLENode(StarZone &zone, std::shared_ptr< StarObjectTextInternal::OLEZone > &ole)
try to read a OLE node : 'O'
Definition StarObjectText.cxx:1317
StarObjectText::sendPages
bool sendPages(STOFFTextListenerPtr &listener)
try to send the different page
Definition StarObjectText.cxx:782
StarObjectText::readSWGraphNode
bool readSWGraphNode(StarZone &zone, std::shared_ptr< StarObjectTextInternal::GraphZone > &graphZone)
try to read a OLE node : 'g'
Definition StarObjectText.cxx:1088
StarObjectText::m_textState
std::shared_ptr< StarObjectTextInternal::State > m_textState
the state
Definition StarObjectText.hxx:150
StarObjectText::~StarObjectText
~StarObjectText() final
destructor
Definition StarObjectText.cxx:748
StarObjectText::parse
bool parse()
Definition StarObjectText.cxx:819
StarObjectText::operator=
StarObjectText & operator=(StarObjectText const &orig)=delete
StarObject::StarObject
StarObject(char const *passwd, std::shared_ptr< STOFFOLEParser > &oleParser, std::shared_ptr< STOFFOLEParser::OleDirectory > &directory)
constructor
Definition StarObject.cxx:80
StarState
class to store an state: ie.
Definition StarState.hxx:68
StarZone
a zone in a StarOffice file
Definition StarZone.hxx:57
libstaroffice_internal.hxx
STOFFListenerPtr
std::shared_ptr< STOFFListener > STOFFListenerPtr
a smart pointer of STOFFListener
Definition libstaroffice_internal.hxx:491
STOFFInputStreamPtr
std::shared_ptr< STOFFInputStream > STOFFInputStreamPtr
a smart pointer of STOFFInputStream
Definition libstaroffice_internal.hxx:489
STOFFTextListenerPtr
std::shared_ptr< STOFFTextListener > STOFFTextListenerPtr
a smart pointer of STOFFTextListener
Definition libstaroffice_internal.hxx:501
StarObjectTextInternal
Internal: the structures of a StarObjectText.
Definition StarObjectText.cxx:75
StarObjectTextInternal::Content::m_zoneList
std::vector< std::shared_ptr< Zone > > m_zoneList
the list of text zone
Definition StarObjectText.hxx:83
StarObjectTextInternal::Content::inventoryPages
void inventoryPages(StarState &state) const
try to inventory the different pages
Definition StarObjectText.cxx:129
StarObjectTextInternal::Content::m_sectionName
librevenge::RVNGString m_sectionName
the section name
Definition StarObjectText.hxx:81
StarObjectTextInternal::Content::~Content
~Content()
destructor
Definition StarObjectText.cxx:125
StarObjectTextInternal::Content::send
bool send(STOFFListenerPtr &listener, StarState &state, bool isFlyer=false) const
try to send the data to a listener
Definition StarObjectText.cxx:677
StarObjectTextInternal::Content::Content
Content()
constructor
Definition StarObjectText.hxx:69
StarObjectTextInternal::GraphZone
Internal: a graphZone of StarObjectTextInteral.
Definition StarObjectText.cxx:174
StarObjectTextInternal::OLEZone
Internal: a OLEZone of StarObjectTextInteral.
Definition StarObjectText.cxx:218
StarObjectTextInternal::SectionZone
Internal: a sectionZone of StarObjectTextInteral.
Definition StarObjectText.cxx:282
StarObjectTextInternal::State
Internal: the state of a StarObjectText.
Definition StarObjectText.cxx:709
StarObjectTextInternal::TextZone
Internal: a textZone of StarObjectTextInteral.
Definition StarObjectText.cxx:330
StarObjectTextInternal::Zone::Zone
Zone()
constructor
Definition StarObjectText.hxx:53
StarObjectTextInternal::Zone::send
virtual bool send(STOFFListenerPtr &listener, StarState &state) const =0
try to send the data to a listener
StarObjectTextInternal::Zone::inventoryPage
virtual void inventoryPage(StarState &) const
try to inventory the different pages
Definition StarObjectText.hxx:61
StarObjectTextInternal::Zone::~Zone
virtual ~Zone()
destructor
Definition StarObjectText.cxx:121