StarState.hxx
Go to the documentation of this file.
00001 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
00002 
00003 /* libstaroffice
00004 * Version: MPL 2.0 / LGPLv2+
00005 *
00006 * The contents of this file are subject to the Mozilla Public License Version
00007 * 2.0 (the "License"); you may not use this file except in compliance with
00008 * the License or as specified alternatively below. You may obtain a copy of
00009 * the License at http://www.mozilla.org/MPL/
00010 *
00011 * Software distributed under the License is distributed on an "AS IS" basis,
00012 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013 * for the specific language governing rights and limitations under the
00014 * License.
00015 *
00016 * Major Contributor(s):
00017 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
00018 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
00019 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
00020 * Copyright (C) 2006, 2007 Andrew Ziem
00021 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
00022 *
00023 *
00024 * All Rights Reserved.
00025 *
00026 * For minor contributions see the git repository.
00027 *
00028 * Alternatively, the contents of this file may be used under the terms of
00029 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
00030 * in which case the provisions of the LGPLv2+ are applicable
00031 * instead of those above.
00032 */
00033 
00034 /*
00035  * StarPool to store the state
00036  *
00037  */
00038 #ifndef STAR_STATE_HXX
00039 #  define STAR_STATE_HXX
00040 
00041 #include <vector>
00042 
00043 #include "libstaroffice_internal.hxx"
00044 
00045 #include "STOFFCellStyle.hxx"
00046 #include "STOFFFont.hxx"
00047 #include "STOFFGraphicStyle.hxx"
00048 #include "STOFFParagraph.hxx"
00049 #include "STOFFPageSpan.hxx"
00050 #include "STOFFSection.hxx"
00051 
00052 class StarItemPool;
00053 class StarObject;
00054 class StarZone;
00055 class StarObjectNumericRuler;
00056 class STOFFList;
00057 
00058 namespace SWFieldManagerInternal
00059 {
00060 struct Field;
00061 }
00062 
00065 class StarState
00066 {
00067 public:
00069   struct GlobalState {
00071     GlobalState(StarItemPool const *pool, StarObject &object, double relUnit=0.05) :
00072       m_pool(pool), m_object(object), m_numericRuler(),
00073       m_page(), m_pageName(""), m_pageNameList(), m_pageZone(STOFFPageSpan::Page), m_pageOccurence("all"),
00074       m_list(), m_listLevel(-1),
00075       m_relativeUnit(relUnit)
00076     {
00077     }
00079     ~GlobalState();
00081     StarItemPool const *m_pool;
00083     StarObject &m_object;
00085     shared_ptr<StarObjectNumericRuler> m_numericRuler;
00087     STOFFPageSpan m_page;
00089     librevenge::RVNGString m_pageName;
00091     std::vector<librevenge::RVNGString> m_pageNameList;
00093     STOFFPageSpan::ZoneType m_pageZone;
00095     std::string m_pageOccurence;
00097     shared_ptr<STOFFList> m_list;
00099     int m_listLevel;
00101     double m_relativeUnit;
00102   private:
00103     GlobalState(GlobalState const &);
00104     GlobalState &operator=(GlobalState const &);
00105   };
00107   StarState(StarItemPool const *pool, StarObject &object, double relUnit=0.05) :
00108     m_global(new GlobalState(pool, object, relUnit)),
00109     m_styleName(""),
00110     m_break(0),
00111     m_cell(),
00112     m_graphic(),
00113     m_paragraph(),
00114     m_font(), m_content(false), m_footnote(false), m_link(""), m_refMark(""), m_field()
00115   {
00116   }
00118   explicit StarState(shared_ptr<GlobalState> global) :
00119     m_global(global),
00120     m_styleName(""),
00121     m_break(0),
00122     m_cell(),
00123     m_graphic(),
00124     m_paragraph(),
00125     m_font(), m_content(false), m_footnote(false), m_link(""), m_refMark(""), m_field()
00126   {
00127   }
00129   explicit StarState(StarState const &orig);
00131   ~StarState();
00133   void reinitializeLineData();
00135   shared_ptr<GlobalState> m_global;
00137   librevenge::RVNGString m_styleName;
00138 
00140   int m_break;
00141 
00143   STOFFCellStyle m_cell;
00145   STOFFGraphicStyle m_graphic;
00146 
00148   STOFFParagraph m_paragraph;
00150   STOFFFont m_font;
00152   bool m_content;
00154   bool m_footnote;
00156   librevenge::RVNGString m_link;
00158   librevenge::RVNGString m_refMark;
00160   shared_ptr<SWFieldManagerInternal::Field> m_field;
00161 
00162 private:
00163   StarState &operator=(StarState const &);
00164 };
00165 #endif
00166 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab: