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

Generated on Mon Apr 22 2024 12:48:55 for libstaroffice by doxygen 1.10.0