StarState.hxx Source File documentation

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 StarZone;
56 class StarObjectNumericRuler;
57 class STOFFList;
58
59 namespace SWFieldManagerInternal
60 {
61 struct Field;
62 }
63
66 class StarState
67 {
68 public:
70 struct GlobalState {
72 GlobalState(StarItemPool const *pool, StarObject &object, double relUnit=0.05)
73 : m_pool(pool)
74 , m_object(object)
75 , m_numericRuler()
76 , m_page()
77 , m_pageName("")
78 , m_pageNameList()
79 , m_pageZone(STOFFPageSpan::Page)
80 , m_pageOccurence("all")
81 , m_list()
82 , m_listLevel(-1)
83 , m_relativeUnit(relUnit)
84 {
85 }
87 ~GlobalState();
89 StarItemPool const *m_pool;
91 StarObject &m_object;
93 std::shared_ptr<StarObjectNumericRuler> m_numericRuler;
95 STOFFPageSpan m_page;
97 librevenge::RVNGString m_pageName;
99 std::vector<librevenge::RVNGString> m_pageNameList;
101 STOFFPageSpan::ZoneType m_pageZone;
103 std::string m_pageOccurence;
105 std::shared_ptr<STOFFList> m_list;
107 int m_listLevel;
109 double m_relativeUnit;
110
111 private:
112 GlobalState(GlobalState const &) = delete;
113 GlobalState &operator=(GlobalState const &) = delete;
114 };
116 StarState(StarItemPool const *pool, StarObject &object, double relUnit=0.05)
117 : m_global(new GlobalState(pool, object, relUnit))
118 , m_styleName("")
119 , m_break(0)
120 , m_cell()
121 , m_frame()
122 , m_graphic()
123 , m_paragraph()
124 , m_font()
125 , m_content(false)
126 , m_footnote(false)
127 , m_link("")
128 , m_refMark("")
129 , m_field()
130 {
131 }
133 explicit StarState(std::shared_ptr<GlobalState> global)
134 : m_global(global)
135 , m_styleName("")
136 , m_break(0)
137 , m_cell()
138 , m_frame()
139 , m_graphic()
140 , m_paragraph()
141 , m_font()
142 , m_content(false)
143 , m_footnote(false)
144 , m_link("")
145 , m_refMark("")
146 , m_field()
147 {
148 }
150 explicit StarState(StarState const &) = default;
152 ~StarState();
154 void reinitializeLineData();
156 std::shared_ptr<GlobalState> m_global;
158 librevenge::RVNGString m_styleName;
159
161 int m_break;
162
164 STOFFCellStyle m_cell;
166 STOFFFrameStyle m_frame;
168 STOFFGraphicStyle m_graphic;
169
171 STOFFParagraph m_paragraph;
173 STOFFFont m_font;
175 bool m_content;
177 bool m_footnote;
179 librevenge::RVNGString m_link;
181 librevenge::RVNGString m_refMark;
183 std::shared_ptr<SWFieldManagerInternal::Field> m_field;
184 private:
185 StarState &operator=(StarState const &) = delete;
186 };
187 #endif
188 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
StarState::m_global
std::shared_ptr< GlobalState > m_global
global state
Definition: StarState.hxx:156
STOFFSection.hxx
STOFFFont.hxx
StarState::~StarState
~StarState()
destructor
Definition: StarState.cxx:48
StarState::GlobalState::m_pool
StarItemPool const * m_pool
the pool
Definition: StarState.hxx:89
StarState::GlobalState::m_listLevel
int m_listLevel
the current list level
Definition: StarState.hxx:107
StarState::StarState
StarState(StarItemPool const *pool, StarObject &object, double relUnit=0.05)
constructor
Definition: StarState.hxx:116
StarState::GlobalState::GlobalState
GlobalState(StarItemPool const *pool, StarObject &object, double relUnit=0.05)
constructor
Definition: StarState.hxx:72
StarState
class to store an state: ie.
Definition: StarState.hxx:66
STOFFFrameStyle.hxx
STOFFFrameStyle
Class to store a frame style.
Definition: STOFFFrameStyle.hxx:43
StarState::GlobalState::operator=
GlobalState & operator=(GlobalState const &)=delete
StarState::m_link
librevenge::RVNGString m_link
the link url
Definition: StarState.hxx:179
SWFieldManagerInternal::Field
Internal: a field.
Definition: SWFieldManager.hxx:53
StarState::m_graphic
STOFFGraphicStyle m_graphic
the graphic style
Definition: StarState.hxx:168
StarState::m_content
bool m_content
flag to know if this is a content zone
Definition: StarState.hxx:175
StarState::GlobalState::m_numericRuler
std::shared_ptr< StarObjectNumericRuler > m_numericRuler
the numeric ruler manager
Definition: StarState.hxx:93
StarState::GlobalState::m_pageZone
STOFFPageSpan::ZoneType m_pageZone
the actual page zone: document, header, footer
Definition: StarState.hxx:101
StarState::GlobalState::m_page
STOFFPageSpan m_page
the page
Definition: StarState.hxx:95
STOFFParagraph
class to store the paragraph properties
Definition: STOFFParagraph.hxx:47
StarState::GlobalState::m_pageOccurence
std::string m_pageOccurence
the page occurence: all, first, left, right
Definition: StarState.hxx:103
StarState::GlobalState::~GlobalState
~GlobalState()
destructor
Definition: StarState.cxx:44
StarState::GlobalState::m_list
std::shared_ptr< STOFFList > m_list
the current list
Definition: StarState.hxx:105
STOFFPageSpan::ZoneType
ZoneType
the zone type
Definition: STOFFPageSpan.hxx:79
StarState::m_footnote
bool m_footnote
flag to know if this is a footnote
Definition: StarState.hxx:177
StarState::m_refMark
librevenge::RVNGString m_refMark
the ref mark
Definition: StarState.hxx:181
StarObjectNumericRuler
the main class to read a SwNumRules zone
Definition: StarObjectNumericRuler.hxx:63
SWFieldManagerInternal
Internal: the structures of a SWFieldManager.
Definition: StarState.hxx:59
STOFFPageSpan.hxx
StarState::reinitializeLineData
void reinitializeLineData()
reinit the local data: break, font, content, footnote, ...
Definition: StarState.cxx:52
STOFFList
a small structure used to store the informations about a list
Definition: STOFFList.hxx:105
StarState::GlobalState::m_pageNameList
std::vector< librevenge::RVNGString > m_pageNameList
the list of page name
Definition: StarState.hxx:99
STOFFGraphicStyle.hxx
StarState::m_cell
STOFFCellStyle m_cell
the cell style
Definition: StarState.hxx:164
libstaroffice_internal.hxx
STOFFParagraph.hxx
STOFFFont
Class to store font.
Definition: STOFFFont.hxx:43
StarState::GlobalState::m_object
StarObject & m_object
the object
Definition: StarState.hxx:91
StarState::m_frame
STOFFFrameStyle m_frame
the frame style
Definition: StarState.hxx:166
StarItemPool
the main class to read/.
Definition: StarItemPool.hxx:70
StarState::GlobalState::m_pageName
librevenge::RVNGString m_pageName
the page name
Definition: StarState.hxx:97
STOFFCellStyle.hxx
StarState::m_field
std::shared_ptr< SWFieldManagerInternal::Field > m_field
the field
Definition: StarState.hxx:183
StarState::m_font
STOFFFont m_font
the font
Definition: StarState.hxx:173
StarState::operator=
StarState & operator=(StarState const &)=delete
STOFFPageSpan
A class which defines the page properties.
Definition: STOFFPageSpan.hxx:75
StarState::GlobalState::m_relativeUnit
double m_relativeUnit
the relative unit uses to transform rel font height in point, default 1/20
Definition: StarState.hxx:109
StarState::m_styleName
librevenge::RVNGString m_styleName
the style name
Definition: StarState.hxx:158
StarObject
an object corresponding to an OLE directory
Definition: StarObject.hxx:64
StarZone
a zone in a StarOffice file
Definition: StarZone.hxx:56
StarState::StarState
StarState(std::shared_ptr< GlobalState > global)
constructor
Definition: StarState.hxx:133
STOFFCellStyle
Class to store a cell style.
Definition: STOFFCellStyle.hxx:43
STOFFGraphicStyle
Class to store a graphic style.
Definition: STOFFGraphicStyle.hxx:44
StarState::m_paragraph
STOFFParagraph m_paragraph
the paragraph style
Definition: StarState.hxx:171
StarState::GlobalState
small struct use to store global data
Definition: StarState.hxx:70
StarState::m_break
int m_break
a page/column break: 1=columnBefore, 2=columnAfter, 3=columnBoth, 4=pageBefore, 5=pageAfter,n 6=pageBoth
Definition: StarState.hxx:161