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

Generated on Sat May 29 2021 22:54:03 for libstaroffice by doxygen 1.8.14