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
46class StarState;
47
49{
51struct 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
67struct Content {
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
84struct GraphZone;
85struct OLEZone;
86struct SectionZone;
87struct TextZone;
88struct State;
89}
90
91class StarZone;
92
99{
100public:
102 StarObjectText(StarObject const &orig, bool duplicateState);
104 virtual ~StarObjectText();
105
106 // try to parse all zone
107 bool parse();
108
110 bool updatePageSpans(std::vector<STOFFPageSpan> &pageSpan, int &numPages);
112 bool sendPages(STOFFTextListenerPtr listener);
113
115 static bool readSWImageMap(StarZone &zone);
116
118 bool readSWContent(StarZone &zone, shared_ptr<StarObjectTextInternal::Content> &content);
119protected:
120 //
121 // low level
122 //
123
125 bool readSfxStyleSheets(STOFFInputStreamPtr input, std::string const &fileName);
127 bool readWriterDocument(STOFFInputStreamPtr input, std::string const &fileName);
128
130 bool readDrawingLayer(STOFFInputStreamPtr input, std::string const &fileName);
131
132protected:
134 bool readSWGraphNode(StarZone &zone, shared_ptr<StarObjectTextInternal::GraphZone> &graphZone);
136 bool readSWJobSetUp(StarZone &zone);
138 bool readSWOLENode(StarZone &zone, shared_ptr<StarObjectTextInternal::OLEZone> &ole);
140 bool readSWSection(StarZone &zone, shared_ptr<StarObjectTextInternal::SectionZone> &section);
142 bool readSWTextZone(StarZone &zone, shared_ptr<StarObjectTextInternal::TextZone> &textZone);
143 //
144 // data
145 //
146
148 shared_ptr<StarObjectTextInternal::State> m_textState;
149private:
151};
152#endif
153// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
the main class to read a StarOffice sdw file
Definition StarObjectText.hxx:99
shared_ptr< StarObjectTextInternal::State > m_textState
the state
Definition StarObjectText.hxx:148
bool sendPages(STOFFTextListenerPtr listener)
try to send the different page
Definition StarObjectText.cxx:664
StarObjectText & operator=(StarObjectText const &orig)
bool readDrawingLayer(STOFFInputStreamPtr input, std::string const &fileName)
the drawing layers ?
Definition StarObjectText.cxx:1482
virtual ~StarObjectText()
destructor
Definition StarObjectText.cxx:630
bool updatePageSpans(std::vector< STOFFPageSpan > &pageSpan, int &numPages)
try to update the page span (to create draw document)
Definition StarObjectText.cxx:638
bool readSWTextZone(StarZone &zone, shared_ptr< StarObjectTextInternal::TextZone > &textZone)
try to read some content : 'T'
Definition StarObjectText.cxx:1317
bool readSWOLENode(StarZone &zone, shared_ptr< StarObjectTextInternal::OLEZone > &ole)
try to read a OLE node : 'O'
Definition StarObjectText.cxx:1189
bool readWriterDocument(STOFFInputStreamPtr input, std::string const &fileName)
the main zone
Definition StarObjectText.cxx:1569
bool readSfxStyleSheets(STOFFInputStreamPtr input, std::string const &fileName)
try to read a text style zone: SfxStyleSheets
Definition StarObjectText.cxx:774
bool readSWJobSetUp(StarZone &zone)
try to read a SW zone setup : 'J'
Definition StarObjectText.cxx:1161
bool readSWSection(StarZone &zone, shared_ptr< StarObjectTextInternal::SectionZone > &section)
try to read a section : 'I'
Definition StarObjectText.cxx:1238
static bool readSWImageMap(StarZone &zone)
try to read a image map zone : 'X'
Definition StarObjectText.cxx:1077
bool readSWGraphNode(StarZone &zone, shared_ptr< StarObjectTextInternal::GraphZone > &graphZone)
try to read a OLE node : 'g'
Definition StarObjectText.cxx:960
bool readSWContent(StarZone &zone, shared_ptr< StarObjectTextInternal::Content > &content)
try to read some content : 'N'
Definition StarObjectText.cxx:830
bool parse()
Definition StarObjectText.cxx:688
an object corresponding to an OLE directory
Definition StarObject.hxx:65
class to store an state: ie.
Definition StarState.hxx:67
a zone in a StarOffice file
Definition StarZone.hxx:57
shared_ptr< STOFFTextListener > STOFFTextListenerPtr
a smart pointer of STOFFTextListener
Definition libstaroffice_internal.hxx:486
shared_ptr< STOFFListener > STOFFListenerPtr
a smart pointer of STOFFListener
Definition libstaroffice_internal.hxx:476
shared_ptr< STOFFInputStream > STOFFInputStreamPtr
a smart pointer of STOFFInputStream
Definition libstaroffice_internal.hxx:474
Internal: the structures of a StarObjectText.
Definition StarObjectText.cxx:72
Internal: a set of zone.
Definition StarObjectText.hxx:67
std::vector< shared_ptr< Zone > > m_zoneList
the list of text zone
Definition StarObjectText.hxx:81
void inventoryPages(StarState &state) const
try to inventory the different pages
Definition StarObjectText.cxx:83
librevenge::RVNGString m_sectionName
the section name
Definition StarObjectText.hxx:79
~Content()
destructor
Definition StarObjectText.cxx:79
bool send(STOFFListenerPtr listener, StarState &state) const
try to send the data to a listener
Definition StarObjectText.cxx:97
Content()
constructor
Definition StarObjectText.hxx:69
Internal: a graphZone of StarObjectTextInteral.
Definition StarObjectText.cxx:142
Internal: a OLEZone of StarObjectTextInteral.
Definition StarObjectText.cxx:186
Internal: a sectionZone of StarObjectTextInteral.
Definition StarObjectText.cxx:234
Internal: the state of a StarObjectText.
Definition StarObjectText.cxx:602
Internal: a textZone of StarObjectTextInteral.
Definition StarObjectText.cxx:274
Internal: a basic sone of StarObjectTextInternal.
Definition StarObjectText.hxx:51
Zone()
constructor
Definition StarObjectText.hxx:53
virtual bool send(STOFFListenerPtr listener, StarState &state) const =0
try to send the data to a listener
virtual void inventoryPage(StarState &) const
try to inventory the different pages
Definition StarObjectText.hxx:61
virtual ~Zone()
destructor
Definition StarObjectText.cxx:75

Generated on Mon Nov 27 2023 04:05:54 for libstaroffice by doxygen 1.9.8