StarState.hxx
Go to the documentation of this file.
/* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
/* libstaroffice
* Version: MPL 2.0 / LGPLv2+
*
* The contents of this file are subject to the Mozilla Public License Version
* 2.0 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2002 William Lachance (wrlach@gmail.com)
* Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
* Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
* Copyright (C) 2006, 2007 Andrew Ziem
* Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
*
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
* in which case the provisions of the LGPLv2+ are applicable
* instead of those above.
*/
/*
* StarPool to store the state
*
*/
#ifndef STAR_STATE_HXX
# define STAR_STATE_HXX
#include <vector>
#include "libstaroffice_internal.hxx"
#include "STOFFCellStyle.hxx"
#include "STOFFFont.hxx"
#include "STOFFFrameStyle.hxx"
#include "STOFFGraphicStyle.hxx"
#include "STOFFParagraph.hxx"
#include "STOFFPageSpan.hxx"
#include "STOFFSection.hxx"
class StarItemPool;
class StarObject;
class StarObjectModel;
class StarZone;
class StarObjectNumericRuler;
class STOFFList;
namespace SWFieldManagerInternal
{
struct Field;
}
class StarState
{
public:
struct GlobalState {
GlobalState(StarItemPool const *pool, StarObject &object, double relUnit=0.05)
: m_pool(pool)
, m_object(object)
, m_objectModel()
, m_numericRuler()
, m_page()
, m_pageName("")
, m_pageNameList()
, m_pageZone(STOFFPageSpan::Page)
, m_pageOccurence("all")
, m_list()
, m_listLevel(-1)
, m_relativeUnit(relUnit)
, m_offset(0,0)
{
}
~GlobalState();
StarItemPool const *m_pool;
StarObject &m_object;
std::shared_ptr<StarObjectModel> m_objectModel;
std::shared_ptr<StarObjectNumericRuler> m_numericRuler;
STOFFPageSpan m_page;
librevenge::RVNGString m_pageName;
std::vector<librevenge::RVNGString> m_pageNameList;
STOFFPageSpan::ZoneType m_pageZone;
std::string m_pageOccurence;
std::shared_ptr<STOFFList> m_list;
int m_listLevel;
double m_relativeUnit;
STOFFVec2f m_offset;
private:
GlobalState(GlobalState const &) = delete;
GlobalState &operator=(GlobalState const &) = delete;
};
StarState(StarItemPool const *pool, StarObject &object);
explicit StarState(GlobalState const &global);
explicit StarState(std::shared_ptr<GlobalState> &global)
: m_global(global)
, m_styleName("")
, m_break(0)
, m_cell()
, m_frame()
, m_graphic()
, m_paragraph()
, m_font()
, m_content(false)
, m_flyCnt(false)
, m_footnote(false)
, m_headerFooter(false)
, m_link("")
, m_refMark("")
, m_field()
{
}
~StarState();
void reinitializeLineData();
double convertInPoint(double val) const
{
return m_global->m_relativeUnit*val;
}
STOFFVec2f convertPointInPoint(STOFFVec2f const &val) const
{
return float(m_global->m_relativeUnit)*val+m_global->m_offset;
}
STOFFVec2f convertVectorInPoint(STOFFVec2f const &val) const
{
return float(m_global->m_relativeUnit)*val;
}
std::shared_ptr<GlobalState> m_global;
librevenge::RVNGString m_styleName;
int m_break;
STOFFCellStyle m_cell;
STOFFFrameStyle m_frame;
STOFFGraphicStyle m_graphic;
STOFFParagraph m_paragraph;
STOFFFont m_font;
bool m_content;
bool m_flyCnt;
bool m_footnote;
bool m_headerFooter;
librevenge::RVNGString m_link;
librevenge::RVNGString m_refMark;
std::shared_ptr<SWFieldManagerInternal::Field> m_field;
};
#endif
// 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
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::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
STOFFVec2f
STOFFVec2< float > STOFFVec2f
STOFFVec2 of float.
Definition libstaroffice_internal.hxx:771
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