StarObjectPageStyle.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 SwPageStyleSheets in a StarOffice document
36  *
37  */
38 #ifndef STAR_OBJECT_PAGESTYLE
39 # define STAR_OBJECT_PAGESTYLE
40 
41 #include <ostream>
42 #include <vector>
43 
45 #include "StarObject.hxx"
46 
48 {
49 struct PageDesc;
50 
51 struct State;
52 }
53 
54 class StarState;
55 class StarZone;
56 
63 {
64 public:
66  StarObjectPageStyle(StarObject const &orig, bool duplicateState);
68  ~StarObjectPageStyle() override;
70  bool read(StarZone &zone);
71 
73  bool updatePageSpans(std::vector<librevenge::RVNGString> const &listNames, std::vector<STOFFPageSpan> &pageSpan, int &numPages);
74 protected:
76  bool updatePageSpan(librevenge::RVNGString const &name, StarState &state);
77  //
78  // low level
79  //
80 
81 protected:
82  //
83  // data
84  //
85 
87  std::shared_ptr<StarObjectPageStyleInternal::State> m_pageStyleState;
88 private:
89  StarObjectPageStyle &operator=(StarObjectPageStyle const &orig) = delete;
90 };
91 #endif
92 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
StarObjectPageStyleInternal::NoteDesc::m_isFootnote
bool m_isFootnote
a flag to know if this corresponds to a footnote or a endnote
Definition: StarObjectPageStyle.cxx:78
StarObjectPageStyleInternal::PageDesc::m_poolId
int m_poolId
the poolId
Definition: StarObjectPageStyle.cxx:175
StarWriterStruct::Bookmark::readList
static bool readList(StarZone &zone, std::vector< Bookmark > &markList)
try to read a list of bookmark
Definition: StarWriterStruct.cxx:207
StarObjectPageStyleInternal::State::State
State()
constructor
Definition: StarObjectPageStyle.cxx:330
SWFieldManager::readField
std::shared_ptr< SWFieldManagerInternal::Field > readField(StarZone &zone, char cKind='_')
try to read a field type
Definition: SWFieldManager.cxx:1025
StarZone::ascii
libstoff::DebugFile & ascii()
returns the ascii file
Definition: StarZone.hxx:254
StarZone::getPoolName
bool getPoolName(int poolId, librevenge::RVNGString &res) const
try to return a pool name
Definition: StarZone.hxx:235
StarObjectPageStyleInternal::NoteDesc::read
bool read(StarZone &zone)
try to read a noteDesc: '1' or '2'
Definition: StarObjectPageStyle.cxx:89
STOFF_DEBUG_MSG
#define STOFF_DEBUG_MSG(M)
Definition: libstaroffice_internal.hxx:129
StarZone::isCompatibleWith
int isCompatibleWith(int vers) const
checks if the document is compatible with vers
Definition: StarZone.hxx:99
StarWriterStruct::Attribute::readList
static bool readList(StarZone &zone, std::vector< Attribute > &attributeList, StarObject &object)
try to read a list of attribute: 'S'
Definition: StarWriterStruct.cxx:107
StarObjectPageStyle::updatePageSpan
bool updatePageSpan(librevenge::RVNGString const &name, StarState &state)
try to update the pagespan
Definition: StarObjectPageStyle.cxx:362
StarObjectPageStyle
the main class to read a SwPageStyleSheets zone
Definition: StarObjectPageStyle.hxx:62
StarObjectPageStyle::StarObjectPageStyle
StarObjectPageStyle(StarObject const &orig, bool duplicateState)
constructor
Definition: StarObjectPageStyle.cxx:349
STOFFPageSpan
A class which defines the page properties.
Definition: STOFFPageSpan.hxx:75
libstoff::simplifyString
librevenge::RVNGString simplifyString(librevenge::RVNGString const &s)
returns a simplify version of a string.
Definition: libstaroffice_internal.cxx:430
StarObjectPageStyleInternal::NoteDesc::NoteDesc
NoteDesc(bool isFootnote)
constructor
Definition: StarObjectPageStyle.cxx:65
StarObjectPageStyleInternal::PageDesc::m_noteDesc
std::shared_ptr< NoteDesc > m_noteDesc[2]
the foot and page foot desc
Definition: StarObjectPageStyle.cxx:183
StarObjectPageStyleInternal::PageDesc::operator<<
friend std::ostream & operator<<(std::ostream &o, PageDesc const &desc)
operator<<
Definition: StarObjectPageStyle.cxx:297
StarObjectPageStyleInternal::State::m_simplifyNameToPageIdMap
std::map< librevenge::RVNGString, size_t > m_simplifyNameToPageIdMap
map simplify name to id
Definition: StarObjectPageStyle.cxx:341
StarObjectPageStyleInternal::PageDesc::updatePageSpan
void updatePageSpan(StarState &state) const
update pagespan properties
Definition: StarObjectPageStyle.cxx:188
StarZone::closeFlagZone
void closeFlagZone()
close the cflag zone
Definition: StarZone.cxx:618
STOFFColor
the class to store a color
Definition: libstaroffice_internal.hxx:189
StarObjectPageStyleInternal::NoteDesc::m_penWidth
int m_penWidth
the pen's width
Definition: StarObjectPageStyle.cxx:84
StarObjectPageStyleInternal::PageDesc::read
bool read(StarZone &zone, StarObject &object)
try to read a pageDesc: 'p'
Definition: StarObjectPageStyle.cxx:213
StarItemPool::T_WriterPool
Definition: StarItemPool.hxx:75
StarState
class to store an state: ie.
Definition: StarState.hxx:67
StarObjectPageStyleInternal::NoteDesc::m_distances
float m_distances[4]
the width/height/topDist/bottomDist
Definition: StarObjectPageStyle.cxx:80
StarObjectPageStyle.hxx
StarObjectPageStyleInternal::PageDesc::~PageDesc
~PageDesc()
destructor
Definition: StarObjectPageStyle.cxx:157
libstaroffice_internal.hxx
StarObjectPageStyleInternal::PageDesc::m_attributes
std::vector< StarWriterStruct::Attribute > m_attributes[2]
the master and left attributes lists
Definition: StarObjectPageStyle.cxx:185
libstoff::DebugStream::str
static std::string str()
Definition: STOFFDebug.hxx:203
StarObjectPageStyle::updatePageSpans
bool updatePageSpans(std::vector< librevenge::RVNGString > const &listNames, std::vector< STOFFPageSpan > &pageSpan, int &numPages)
try to update the page span (to create text document)
Definition: StarObjectPageStyle.cxx:421
STOFFPageSpan.hxx
StarObjectPageStyleInternal::State::m_pageList
std::vector< PageDesc > m_pageList
list of pages
Definition: StarObjectPageStyle.cxx:337
StarObjectPageStyle::operator=
StarObjectPageStyle & operator=(StarObjectPageStyle const &orig)=delete
StarObjectPageStyleInternal::operator<<
std::ostream & operator<<(std::ostream &o, NoteDesc const &desc)
Definition: StarObjectPageStyle.cxx:124
StarObjectPageStyleInternal::PageDesc::m_landscape
bool m_landscape
is the page a lanscape
Definition: StarObjectPageStyle.cxx:173
StarZone::closeSWRecord
bool closeSWRecord(char type, std::string const &debugName)
try to close a record
Definition: StarZone.hxx:177
STOFFListener.hxx
STOFFInputStreamPtr
std::shared_ptr< STOFFInputStream > STOFFInputStreamPtr
a smart pointer of STOFFInputStream
Definition: libstaroffice_internal.hxx:485
StarObjectPageStyleInternal::State::m_nameToPageIdMap
std::map< librevenge::RVNGString, size_t > m_nameToPageIdMap
map name to id
Definition: StarObjectPageStyle.cxx:339
StarObject::getFormatManager
std::shared_ptr< StarFormatManager > getFormatManager()
returns the format manager
Definition: StarObject.cxx:125
SWFieldManager
the main class to read/.
Definition: SWFieldManager.hxx:109
StarZone
a zone in a StarOffice file
Definition: StarZone.hxx:56
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
StarObjectPageStyle::~StarObjectPageStyle
~StarObjectPageStyle() override
destructor
Definition: StarObjectPageStyle.cxx:355
libstoff::DebugStream
Definition: STOFFDebug.hxx:194
StarObjectPageStyleInternal::NoteDesc::operator<<
friend std::ostream & operator<<(std::ostream &o, NoteDesc const &desc)
operator<<
Definition: StarObjectPageStyle.cxx:124
StarZone::readSWHeader
bool readSWHeader()
read the zone header present in a SW file
Definition: StarZone.cxx:190
StarObjectPageStyleInternal::PageDesc::PageDesc
PageDesc()
constructor
Definition: StarObjectPageStyle.cxx:146
StarObjectPageStyleInternal::NoteDesc::m_color
STOFFColor m_color
the color
Definition: StarObjectPageStyle.cxx:86
StarObjectPageStyleInternal::NoteDesc::m_adjust
int m_adjust
the adjust
Definition: StarObjectPageStyle.cxx:82
StarObjectPageStyleInternal::PageDesc
structure to store a page description
Definition: StarObjectPageStyle.cxx:143
StarObjectPageStyleInternal::PageDesc::m_usedOn
int m_usedOn
the page where is it used ?
Definition: StarObjectPageStyle.cxx:179
StarWriterStruct::Redline::readListList
static bool readListList(StarZone &zone, std::vector< std::vector< Redline > > &redlineListList)
try to read a list of list of redline : V
Definition: StarWriterStruct.cxx:829
StarObjectPageStyleInternal::NoteDesc
structure to store a endnote/footnote page description
Definition: StarObjectPageStyle.cxx:62
StarObjectPageStyleInternal::State
Internal: the state of a StarObjectPageStyle.
Definition: StarObjectPageStyle.cxx:328
StarObjectPageStyleInternal::PageDesc::m_numType
int m_numType
the number's type
Definition: StarObjectPageStyle.cxx:177
StarState.hxx
STOFFSection
a class which stores section properties
Definition: STOFFSection.hxx:45
libstoff::DebugFile::addPos
static void addPos(long)
Definition: STOFFDebug.hxx:223
StarZone::readStringsPool
bool readStringsPool()
try to read a pool of strings
Definition: StarZone.cxx:103
StarWriterStruct.hxx
StarObject.hxx
StarZone.hxx
StarState::m_global
std::shared_ptr< GlobalState > m_global
global state
Definition: StarState.hxx:165
libstoff::DebugFile
Definition: STOFFDebug.hxx:210
StarObjectPageStyleInternal
Internal: the structures of a StarObjectPageStyle.
Definition: StarObjectPageStyle.cxx:58
StarObjectPageStyle::m_pageStyleState
std::shared_ptr< StarObjectPageStyleInternal::State > m_pageStyleState
the state
Definition: StarObjectPageStyle.hxx:87
StarFormatManager.hxx
libstoff::DebugFile::addNote
static void addNote(char const *)
Definition: STOFFDebug.hxx:224
StarZone::input
STOFFInputStreamPtr input()
return the zone input
Definition: StarZone.hxx:247
STOFFColor::isBlack
bool isBlack() const
return true if the color is black
Definition: libstaroffice_internal.hxx:277
StarZone::openFlagZone
unsigned char openFlagZone()
try to open a cflag zone
Definition: StarZone.cxx:611
StarItemPool.hxx
StarAttribute.hxx
StarZone::getRecordLastPosition
long getRecordLastPosition() const
returns the actual record last position
Definition: StarZone.hxx:200
StarObjectPageStyleInternal::PageDesc::m_follow
librevenge::RVNGString m_follow
the follow
Definition: StarObjectPageStyle.cxx:171
StarObjectPageStyleInternal::PageDesc::updateState
bool updateState(StarState &state) const
try to update the section
Definition: StarObjectPageStyle.cxx:202
StarObjectPageStyleInternal::PageDesc::m_regCollIdx
int m_regCollIdx
the coll idx
Definition: StarObjectPageStyle.cxx:181
StarZone::openSWRecord
bool openSWRecord(char &type)
try to open a SW record: type + size (24 bytes)
Definition: StarZone.cxx:507
StarObjectPageStyleInternal::PageDesc::m_name
librevenge::RVNGString m_name
the name
Definition: StarObjectPageStyle.cxx:169
StarObjectPageStyle::read
bool read(StarZone &zone)
try to read a PageStyle zone
Definition: StarObjectPageStyle.cxx:454
SWFieldManager.hxx

Generated on Mon Jan 20 2020 23:02:17 for libstaroffice by doxygen 1.8.16