StarState.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 * StarPool to store the state
36 *
37 */
38#ifndef STAR_STATE_HXX
39# define STAR_STATE_HXX
40
41#include <vector>
42
43#include "libstaroffice_internal.hxx"
44
45#include "STOFFCellStyle.hxx"
46#include "STOFFFont.hxx"
47#include "STOFFFrameStyle.hxx"
48#include "STOFFGraphicStyle.hxx"
49#include "STOFFParagraph.hxx"
50#include "STOFFPageSpan.hxx"
51#include "STOFFSection.hxx"
52
53 class StarItemPool;
54 class StarObject;
55 class StarObjectModel;
56 class StarZone;
57 class StarObjectNumericRuler;
58 class STOFFList;
59
60 namespace SWFieldManagerInternal
61{
62 struct Field;
63}
64
67 class StarState
68{
69 public:
71 struct GlobalState {
73 GlobalState(StarItemPool const *pool, StarObject &object, double relUnit=0.05)
74 : m_pool(pool)
75 , m_object(object)
76 , m_objectModel()
77 , m_numericRuler()
78 , m_page()
79 , m_pageName("")
80 , m_pageNameList()
81 , m_pageZone(STOFFPageSpan::Page)
82 , m_pageOccurence("all")
83 , m_list()
84 , m_listLevel(-1)
85 , m_relativeUnit(relUnit)
86 , m_offset(0,0)
87 {
88 }
90 ~GlobalState();
92 StarItemPool const *m_pool;
94 StarObject &m_object;
96 std::shared_ptr<StarObjectModel> m_objectModel;
98 std::shared_ptr<StarObjectNumericRuler> m_numericRuler;
100 STOFFPageSpan m_page;
102 librevenge::RVNGString m_pageName;
104 std::vector<librevenge::RVNGString> m_pageNameList;
106 STOFFPageSpan::ZoneType m_pageZone;
108 std::string m_pageOccurence;
110 std::shared_ptr<STOFFList> m_list;
112 int m_listLevel;
114 double m_relativeUnit;
116 STOFFVec2f m_offset;
117 private:
118 GlobalState(GlobalState const &) = delete;
119 GlobalState &operator=(GlobalState const &) = delete;
120 };
122 StarState(StarItemPool const *pool, StarObject &object);
124 explicit StarState(GlobalState const &global);
126 explicit StarState(std::shared_ptr<GlobalState> &global)
127 : m_global(global)
128 , m_styleName("")
129 , m_break(0)
130 , m_cell()
131 , m_frame()
132 , m_graphic()
133 , m_paragraph()
134 , m_font()
135 , m_content(false)
136 , m_flyCnt(false)
137 , m_footnote(false)
138 , m_headerFooter(false)
139 , m_link("")
140 , m_refMark("")
141 , m_field()
142 {
143 }
144
146 ~StarState();
148 void reinitializeLineData();
150 double convertInPoint(double val) const
151 {
152 return m_global->m_relativeUnit*val;
153 }
155 STOFFVec2f convertPointInPoint(STOFFVec2f const &val) const
156 {
157 return float(m_global->m_relativeUnit)*val+m_global->m_offset;
158 }
160 STOFFVec2f convertVectorInPoint(STOFFVec2f const &val) const
161 {
162 return float(m_global->m_relativeUnit)*val;
163 }
165 std::shared_ptr<GlobalState> m_global;
167 librevenge::RVNGString m_styleName;
168
170 int m_break;
171
173 STOFFCellStyle m_cell;
175 STOFFFrameStyle m_frame;
177 STOFFGraphicStyle m_graphic;
178
180 STOFFParagraph m_paragraph;
182 STOFFFont m_font;
184 bool m_content;
186 bool m_flyCnt;
188 bool m_footnote;
190 bool m_headerFooter;
192 librevenge::RVNGString m_link;
194 librevenge::RVNGString m_refMark;
196 std::shared_ptr<SWFieldManagerInternal::Field> m_field;
197};
198#endif
199// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
STOFFCellStyle.hxx
STOFFFont.hxx
STOFFFrameStyle.hxx
STOFFGraphicStyle.hxx
STOFFPageSpan.hxx
STOFFParagraph.hxx
STOFFSection.hxx
STOFFCellStyle
Class to store a cell style.
Definition STOFFCellStyle.hxx:44
STOFFFont
Class to store font.
Definition STOFFFont.hxx:44
STOFFFrameStyle
Class to store a frame style.
Definition STOFFFrameStyle.hxx:46
STOFFGraphicStyle
Class to store a graphic style.
Definition STOFFGraphicStyle.hxx:45
STOFFList
a small structure used to store the informations about a list
Definition STOFFList.hxx:110
STOFFPageSpan
A class which defines the page properties.
Definition STOFFPageSpan.hxx:76
STOFFPageSpan::ZoneType
ZoneType
the zone type
Definition STOFFPageSpan.hxx:79
STOFFParagraph
class to store the paragraph properties
Definition STOFFParagraph.hxx:48
STOFFVec2< float >
StarItemPool
the main class to read/.
Definition StarItemPool.hxx:71
StarObjectModel
the main class to read a SdrModel zone
Definition StarObjectModel.hxx:65
StarObjectNumericRuler
the main class to read a SwNumRules zone
Definition StarObjectNumericRuler.hxx:64
StarObject
an object corresponding to an OLE directory
Definition StarObject.hxx:65
StarState
class to store an state: ie.
Definition StarState.hxx:68
StarState::m_footnote
bool m_footnote
flag to know if this is a footnote
Definition StarState.hxx:188
StarState::m_break
int m_break
a page/column break: 1=columnBefore, 2=columnAfter, 3=columnBoth, 4=pageBefore, 5=pageAfter,...
Definition StarState.hxx:170
StarState::m_font
STOFFFont m_font
the font
Definition StarState.hxx:182
StarState::m_headerFooter
bool m_headerFooter
flag to know if this is a header/footer
Definition StarState.hxx:190
StarState::m_content
bool m_content
flag to know if this is a content zone
Definition StarState.hxx:184
StarState::StarState
StarState(StarItemPool const *pool, StarObject &object)
constructor
Definition StarState.cxx:50
StarState::reinitializeLineData
void reinitializeLineData()
reinit the local data: break, font, content, footnote, ...
Definition StarState.cxx:92
StarState::convertInPoint
double convertInPoint(double val) const
return the relative units
Definition StarState.hxx:150
StarState::m_flyCnt
bool m_flyCnt
flag to know if this is a flyCnt
Definition StarState.hxx:186
StarState::m_styleName
librevenge::RVNGString m_styleName
the style name
Definition StarState.hxx:167
StarState::m_paragraph
STOFFParagraph m_paragraph
the paragraph style
Definition StarState.hxx:180
StarState::m_cell
STOFFCellStyle m_cell
the cell style
Definition StarState.hxx:173
StarState::StarState
StarState(std::shared_ptr< GlobalState > &global)
constructor which share the global state
Definition StarState.hxx:126
StarState::m_global
std::shared_ptr< GlobalState > m_global
global state
Definition StarState.hxx:165
StarState::m_graphic
STOFFGraphicStyle m_graphic
the graphic style
Definition StarState.hxx:177
StarState::m_frame
STOFFFrameStyle m_frame
the frame style
Definition StarState.hxx:175
StarState::convertPointInPoint
STOFFVec2f convertPointInPoint(STOFFVec2f const &val) const
return the relative units
Definition StarState.hxx:155
StarState::m_field
std::shared_ptr< SWFieldManagerInternal::Field > m_field
the field
Definition StarState.hxx:196
StarState::~StarState
~StarState()
destructor
Definition StarState.cxx:88
StarState::m_link
librevenge::RVNGString m_link
the link url
Definition StarState.hxx:192
StarState::convertVectorInPoint
STOFFVec2f convertVectorInPoint(STOFFVec2f const &val) const
return the relative units
Definition StarState.hxx:160
StarState::m_refMark
librevenge::RVNGString m_refMark
the ref mark
Definition StarState.hxx:194
StarZone
a zone in a StarOffice file
Definition StarZone.hxx:57
libstaroffice_internal.hxx
SWFieldManagerInternal
Internal: the structures of a SWFieldManager.
Definition StarState.hxx:61
SWFieldManagerInternal::Field
Internal: a field.
Definition SWFieldManager.hxx:53
StarState::GlobalState
small struct use to store global data
Definition StarState.hxx:71
StarState::GlobalState::m_offset
STOFFVec2f m_offset
an offset: in point
Definition StarState.hxx:116
StarState::GlobalState::m_pageNameList
std::vector< librevenge::RVNGString > m_pageNameList
the list of page name
Definition StarState.hxx:104
StarState::GlobalState::m_pageName
librevenge::RVNGString m_pageName
the page name
Definition StarState.hxx:102
StarState::GlobalState::m_page
STOFFPageSpan m_page
the page
Definition StarState.hxx:100
StarState::GlobalState::m_listLevel
int m_listLevel
the current list level
Definition StarState.hxx:112
StarState::GlobalState::m_pool
StarItemPool const * m_pool
the pool
Definition StarState.hxx:92
StarState::GlobalState::GlobalState
GlobalState(GlobalState const &)=delete
StarState::GlobalState::m_numericRuler
std::shared_ptr< StarObjectNumericRuler > m_numericRuler
the numeric ruler manager
Definition StarState.hxx:98
StarState::GlobalState::m_objectModel
std::shared_ptr< StarObjectModel > m_objectModel
the object model(for sdw file)
Definition StarState.hxx:96
StarState::GlobalState::m_pageOccurence
std::string m_pageOccurence
the page occurence: all, first, left, right
Definition StarState.hxx:108
StarState::GlobalState::m_pageZone
STOFFPageSpan::ZoneType m_pageZone
the actual page zone: document, header, footer
Definition StarState.hxx:106
StarState::GlobalState::~GlobalState
~GlobalState()
destructor
Definition StarState.cxx:46
StarState::GlobalState::operator=
GlobalState & operator=(GlobalState const &)=delete
StarState::GlobalState::GlobalState
GlobalState(StarItemPool const *pool, StarObject &object, double relUnit=0.05)
constructor
Definition StarState.hxx:73
StarState::GlobalState::m_relativeUnit
double m_relativeUnit
the relative unit uses to transform rel font height in point, default 1/20
Definition StarState.hxx:114
StarState::GlobalState::m_list
std::shared_ptr< STOFFList > m_list
the current list
Definition StarState.hxx:110
StarState::GlobalState::m_object
StarObject & m_object
the object
Definition StarState.hxx:94