StarObjectChart.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 StarOffice's chart
36 *
37 */
38 #ifndef STAR_OBJECT_CHART
39 # define STAR_OBJECT_CHART
40
41 #include <vector>
42 #include <string>
43
44 #include "libstaroffice_internal.hxx"
45 #include "StarObject.hxx"
46 #include "STOFFGraphicStyle.hxx"
47
48 namespace StarObjectChartInternal
49 {
50 struct State;
51 }
52
53 class StarZone;
54
60 class StarObjectChart : public StarObject
61 {
62 public:
64 StarObjectChart(StarObject const &orig, bool duplicateState);
66 ~StarObjectChart() override;
68 bool parse();
70 bool send(STOFFListenerPtr listener, STOFFFrameStyle const &frame, STOFFGraphicStyle const &style=STOFFGraphicStyle());
71
72 protected:
73 //
74 // data
75 //
76
78 bool readChartDocument(STOFFInputStreamPtr input, std::string const &fileName);
80 bool readSfxStyleSheets(STOFFInputStreamPtr input, std::string const &fileName);
82 bool readSCHAttributes(StarZone &zone);
84 bool readSCHMemChart(StarZone &zone);
85
87 std::shared_ptr<StarObjectChartInternal::State> m_chartState;
88 };
89 #endif
90 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
StarFileManager.hxx
StarObjectChart::readSCHMemChart
bool readSCHMemChart(StarZone &zone)
try to read the memchart data
Definition: StarObjectChart.cxx:918
STOFFListenerPtr
std::shared_ptr< STOFFListener > STOFFListenerPtr
a smart pointer of STOFFListener
Definition: libstaroffice_internal.hxx:491
StarFileManager
the main class to read/.
Definition: StarFileManager.hxx:61
StarObjectChart::~StarObjectChart
~StarObjectChart() override
destructor
Definition: StarObjectChart.cxx:117
STOFFVec2< int >
libstoff::getString
librevenge::RVNGString getString(std::vector< uint32_t > const &unicode)
transform a unicode string in a RNVGString
Definition: libstaroffice_internal.cxx:63
StarZone::ascii
libstoff::DebugFile & ascii()
returns the ascii file
Definition: StarZone.hxx:254
STOFF_DEBUG_MSG
#define STOFF_DEBUG_MSG(M)
Definition: libstaroffice_internal.hxx:129
StarZone::openRecord
bool openRecord()
try to open a classic record: size (32 bytes) + size-4 bytes
Definition: StarZone.cxx:455
STOFFFrameStyle.hxx
STOFFChart
a class used to store a chart associated to a spreadsheet ....
Definition: STOFFChart.hxx:57
StarItemSet::printChild
std::string printChild() const
debug function to print the child field
Definition: StarItem.cxx:52
StarObjectChartInternal::State::State
State()
constructor
Definition: StarObjectChart.cxx:94
STOFFFrameStyle
Class to store a frame style.
Definition: STOFFFrameStyle.hxx:45
StarObject::cleanPools
void cleanPools()
clean each pool
Definition: StarObject.cxx:106
STOFFPageSpan
A class which defines the page properties.
Definition: STOFFPageSpan.hxx:75
STOFFGraphicListener
This class contains the code needed to create Graphic document.
Definition: STOFFGraphicListener.hxx:59
StarObject::getNewItemPool
std::shared_ptr< StarItemPool > getNewItemPool(StarItemPool::Type type)
returns a new item pool for this document
Definition: StarObject.cxx:142
StarObjectChartInternal::Chart
the chart of a StarObjectChart
Definition: StarObjectChart.cxx:69
StarObjectChartInternal::Chart::Chart
Chart()
constructor
Definition: StarObjectChart.cxx:73
StarObjectChart::readSfxStyleSheets
bool readSfxStyleSheets(STOFFInputStreamPtr input, std::string const &fileName)
try to read a chart style zone: SfxStyleSheets
Definition: StarObjectChart.cxx:296
StarZone::readString
bool readString(std::vector< uint32_t > &string, int encoding=-1) const
try to read an unicode string
Definition: StarZone.hxx:220
STOFFChart.hxx
StarZone::openSCHHeader
bool openSCHHeader()
open a zone header present in a SCH file
Definition: StarZone.cxx:341
STOFFColor
the class to store a color
Definition: libstaroffice_internal.hxx:189
STOFFGraphicEncoder
main class used to define store librevenge::RVNGDrawingInterface lists of command in a librevenge::RV...
Definition: STOFFGraphicEncoder.hxx:55
StarObjectChartInternal
Internal: the structures of a StarObjectChart.
Definition: StarObjectChart.cxx:65
STOFFOLEParser.hxx
StarObjectChartInternal::Chart::sendContent
void sendContent(TextZone const &zone, STOFFListenerPtr &listener) const final
send the zone content (called when the zone is of text type)
Definition: StarObjectChart.cxx:81
StarEncryption.hxx
STOFFDocument::STOFF_K_CHART
@ STOFF_K_CHART
chart
Definition: STOFFDocument.hxx:69
STOFFEmbeddedObject
small class use to define a embedded object
Definition: libstaroffice_internal.hxx:408
libstaroffice_internal.hxx
libstoff::DebugFile::reset
static void reset()
Definition: STOFFDebug.hxx:228
libstoff::DebugStream::str
static std::string str()
Definition: STOFFDebug.hxx:203
STOFFPageSpan.hxx
STOFFColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libstaroffice_internal.hxx:282
StarObjectChart::parse
bool parse()
try to parse the current object
Definition: StarObjectChart.cxx:158
StarZone::closeSCHHeader
bool closeSCHHeader(std::string const &debugName)
close a zone header
Definition: StarZone.cxx:366
STOFFGraphicEncoder::getBinaryResult
bool getBinaryResult(STOFFEmbeddedObject &result)
return the final graphic
Definition: STOFFGraphicEncoder.cxx:76
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
StarObjectDraw.hxx
STOFFInputStreamPtr
std::shared_ptr< STOFFInputStream > STOFFInputStreamPtr
a smart pointer of STOFFInputStream
Definition: libstaroffice_internal.hxx:489
StarObject::getFormatManager
std::shared_ptr< StarFormatManager > getFormatManager()
returns the format manager
Definition: StarObject.cxx:125
StarZone
a zone in a StarOffice file
Definition: StarZone.hxx:56
StarItemPool::T_EditEnginePool
@ T_EditEnginePool
Definition: StarItemPool.hxx:75
StarZone::getRecordLevel
int getRecordLevel() const
returns the record level
Definition: StarZone.hxx:195
StarObject
an object corresponding to an OLE directory
Definition: StarObject.hxx:64
StarObjectModel.hxx
StarObjectChart::send
bool send(STOFFListenerPtr listener, STOFFFrameStyle const &frame, STOFFGraphicStyle const &style=STOFFGraphicStyle())
try to send a object to the listener
Definition: StarObjectChart.cxx:128
STOFFChart::TextZone
a text zone a chart
Definition: STOFFChart.hxx:223
libstoff::DebugStream
Definition: STOFFDebug.hxx:194
STOFFGraphicEncoder.hxx
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
STOFFGraphicStyle.hxx
STOFFGraphicListenerPtr
std::shared_ptr< STOFFGraphicListener > STOFFGraphicListenerPtr
a smart pointer of STOFFGraphicListener
Definition: libstaroffice_internal.hxx:485
StarObject::getPassword
const char * getPassword() const
returns the document password (the password given by the user)
Definition: StarObject.hxx:81
STOFFGraphicListener.hxx
STOFFGraphicStyle
Class to store a graphic style.
Definition: STOFFGraphicStyle.hxx:44
StarItemPool::T_Unknown
@ T_Unknown
Definition: StarItemPool.hxx:75
StarObject::getDocumentKind
STOFFDocument::Kind getDocumentKind() const
returns the document kind
Definition: StarObject.cxx:115
StarObject::parse
bool parse()
try to parse data
Definition: StarObject.cxx:170
StarObjectChart::StarObjectChart
StarObjectChart(StarObject const &orig, bool duplicateState)
constructor
Definition: StarObjectChart.cxx:111
StarObjectChartInternal::State
Internal: the state of a StarObjectChart.
Definition: StarObjectChart.cxx:92
StarFileManager::readJobSetUp
static bool readJobSetUp(StarZone &zone, bool usePrinterLen)
try to read a printer zone
Definition: StarFileManager.cxx:847
libstoff::DebugFile::addPos
static void addPos(long)
Definition: STOFFDebug.hxx:223
StarObject.hxx
StarZone.hxx
STOFFListManagerPtr
std::shared_ptr< STOFFListManager > STOFFListManagerPtr
a smart pointer of STOFFListManager
Definition: libstaroffice_internal.hxx:493
libstoff::DebugFile
Definition: STOFFDebug.hxx:210
StarObject::getOLEDirectory
std::shared_ptr< STOFFOLEParser::OleDirectory > getOLEDirectory()
returns the object directory
Definition: StarObject.hxx:86
StarObjectChartInternal::State::m_chart
std::shared_ptr< Chart > m_chart
the chart
Definition: StarObjectChart.cxx:101
StarZone::closeRecord
bool closeRecord(std::string const &debugName)
try to close a record
Definition: StarZone.hxx:147
StarObjectChart
the main class to read a StarOffice chart
Definition: StarObjectChart.hxx:60
StarItemSet
class to store a list of item
Definition: StarItem.hxx:87
StarFormatManager.hxx
StarObjectChart::readSCHAttributes
bool readSCHAttributes(StarZone &zone)
try to read the chart attributes
Definition: StarObjectChart.cxx:354
libstoff::DebugFile::addNote
static void addNote(char const *)
Definition: STOFFDebug.hxx:224
StarObjectChartInternal::State::m_model
std::shared_ptr< StarObjectModel > m_model
the model
Definition: StarObjectChart.cxx:103
StarZone::input
STOFFInputStreamPtr input()
return the zone input
Definition: StarZone.hxx:247
StarItemPool::T_ChartPool
@ T_ChartPool
Definition: StarItemPool.hxx:75
StarItemPool::T_VCControlPool
@ T_VCControlPool
Definition: StarItemPool.hxx:75
STOFFVec2i
STOFFVec2< int > STOFFVec2i
STOFFVec2 of int.
Definition: libstaroffice_internal.hxx:767
libstoff::DebugFile::open
static bool open(std::string const &)
Definition: STOFFDebug.hxx:218
StarObjectChart::readChartDocument
bool readChartDocument(STOFFInputStreamPtr input, std::string const &fileName)
try to read a chart zone: StarChartDocument .sds
Definition: StarObjectChart.cxx:204
StarItemPool.hxx
StarItemPool::T_XOutdevPool
@ T_XOutdevPool
Definition: StarItemPool.hxx:75
StarAttribute.hxx
StarZone::getRecordLastPosition
long getRecordLastPosition() const
returns the actual record last position
Definition: StarZone.hxx:200
StarObjectChart::m_chartState
std::shared_ptr< StarObjectChartInternal::State > m_chartState
the state
Definition: StarObjectChart.hxx:87
STOFFSpreadsheetListener.hxx
StarZone::getHeaderVersion
int getHeaderVersion() const
returns the StarOffice header version (if set)
Definition: StarZone.hxx:94
StarObjectChart.hxx
SWFieldManager.hxx