StarItem.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 some StarOffice items
*
*/
#ifndef STAR_ITEM_HXX
# define STAR_ITEM_HXX
#include <map>
#include <vector>
#include <libstaroffice/STOFFDocument.hxx>
#include "STOFFDebug.hxx"
class StarAttribute;
class StarItem
{
public:
explicit StarItem(int which)
: m_attribute()
, m_which(which)
, m_surrogateId(0)
, m_localId(false)
{
}
StarItem(std::shared_ptr<StarAttribute> attribute, int which)
: m_attribute(attribute)
, m_which(which)
, m_surrogateId(0)
, m_localId(false)
{
}
std::shared_ptr<StarAttribute> m_attribute;
int m_which;
int m_surrogateId;
bool m_localId;
private:
StarItem(StarItem const &);
StarItem &operator=(StarItem const &);
};
class StarItemSet
{
public:
StarItemSet()
: m_style("")
, m_family(0)
, m_whichToItemMap()
{
}
bool empty() const
{
return m_whichToItemMap.empty();
}
bool add(std::shared_ptr<StarItem> item);
std::string printChild() const;
librevenge::RVNGString m_style;
int m_family;
std::map<int, std::shared_ptr<StarItem> > m_whichToItemMap;
};
class StarItemStyle
{
public:
enum FamilyStyle {
F_Char=1, F_Paragraph=2, F_Frame=4, F_Page=8, F_Pseudo=0x10, F_ALL=0xFE
};
StarItemStyle()
: m_family(0)
, m_mask(0)
, m_itemSet()
, m_helpId(0)
, m_outlineLevel(-1)
{
}
friend std::ostream &operator<<(std::ostream &o, StarItemStyle const &style);
librevenge::RVNGString m_names[4];
int m_family;
int m_mask;
StarItemSet m_itemSet;
unsigned m_helpId;
int m_outlineLevel;
};
#endif
// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
STOFFDebug.hxx
STOFFDocument.hxx
StarAttribute
virtual class used to store the different attribute
Definition StarAttribute.hxx:63
StarItemSet
class to store a list of item
Definition StarItem.hxx:88
StarItemSet::empty
bool empty() const
return true if the set is empty
Definition StarItem.hxx:98
StarItemSet::StarItemSet
StarItemSet()
constructor
Definition StarItem.hxx:91
StarItemSet::m_whichToItemMap
std::map< int, std::shared_ptr< StarItem > > m_whichToItemMap
the list of item
Definition StarItem.hxx:111
StarItemSet::printChild
std::string printChild() const
debug function to print the child field
Definition StarItem.cxx:52
StarItemSet::m_family
int m_family
the family
Definition StarItem.hxx:109
StarItemSet::add
bool add(std::shared_ptr< StarItem > item)
try to add a item
Definition StarItem.cxx:42
StarItemSet::m_style
librevenge::RVNGString m_style
item set name
Definition StarItem.hxx:107
StarItemStyle
brief class used to stored the style
Definition StarItem.hxx:116
StarItemStyle::m_outlineLevel
int m_outlineLevel
the outline level
Definition StarItem.hxx:144
StarItemStyle::StarItemStyle
StarItemStyle()
constructor
Definition StarItem.hxx:123
StarItemStyle::m_family
int m_family
the family
Definition StarItem.hxx:136
StarItemStyle::FamilyStyle
FamilyStyle
the different family style
Definition StarItem.hxx:119
StarItemStyle::F_Pseudo
@ F_Pseudo
Definition StarItem.hxx:120
StarItemStyle::F_Paragraph
@ F_Paragraph
Definition StarItem.hxx:120
StarItemStyle::F_Page
@ F_Page
Definition StarItem.hxx:120
StarItemStyle::F_Frame
@ F_Frame
Definition StarItem.hxx:120
StarItemStyle::F_Char
@ F_Char
Definition StarItem.hxx:120
StarItemStyle::F_ALL
@ F_ALL
Definition StarItem.hxx:120
StarItemStyle::operator<<
friend std::ostream & operator<<(std::ostream &o, StarItemStyle const &style)
operator<<
Definition StarItem.cxx:69
StarItemStyle::m_itemSet
StarItemSet m_itemSet
the item list
Definition StarItem.hxx:140
StarItemStyle::m_names
librevenge::RVNGString m_names[4]
the name, the parent name, the follow name, the help names
Definition StarItem.hxx:134
StarItemStyle::m_helpId
unsigned m_helpId
the help id
Definition StarItem.hxx:142
StarItemStyle::m_mask
int m_mask
the mask
Definition StarItem.hxx:138
StarItem::operator=
StarItem & operator=(StarItem const &)
StarItem::StarItem
StarItem(StarItem const &)
StarItem::m_which
int m_which
the which id
Definition StarItem.hxx:75
StarItem::StarItem
StarItem(int which)
constructor
Definition StarItem.hxx:57
StarItem::StarItem
StarItem(std::shared_ptr< StarAttribute > attribute, int which)
constructor from attribute
Definition StarItem.hxx:65
StarItem::m_localId
bool m_localId
true if which is local
Definition StarItem.hxx:79
StarItem::m_surrogateId
int m_surrogateId
the surrogate id
Definition StarItem.hxx:77
StarItem::m_attribute
std::shared_ptr< StarAttribute > m_attribute
the attribute if loaded
Definition StarItem.hxx:73