- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

StarItem.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 some StarOffice items
36 *
37 */
38 #ifndef STAR_ITEM_HXX
39 # define STAR_ITEM_HXX
40
41 #include <map>
42 #include <vector>
43
44 #include <libstaroffice/STOFFDocument.hxx>
45
46 #include "STOFFDebug.hxx"
47
48 class StarAttribute;
49
53 class StarItem
54 {
55 public:
57 explicit StarItem(int which) : m_attribute(), m_which(which), m_surrogateId(0), m_localId(false)
58 {
59 }
61 StarItem(shared_ptr<StarAttribute> attribute, int which) : m_attribute(attribute), m_which(which), m_surrogateId(0), m_localId(false)
62 {
63 }
65 shared_ptr<StarAttribute> m_attribute;
67 int m_which;
69 int m_surrogateId;
71 bool m_localId;
72 private:
73 StarItem(StarItem const &);
74 StarItem &operator=(StarItem const &);
75 };
76
79 class StarItemSet
80 {
81 public:
83 StarItemSet() : m_style(""), m_family(0), m_whichToItemMap()
84 {
85 }
87 bool empty() const
88 {
89 return m_whichToItemMap.empty();
90 }
92 bool add(shared_ptr<StarItem> item);
94 std::string printChild() const;
96 librevenge::RVNGString m_style;
98 int m_family;
100 std::map<int, shared_ptr<StarItem> > m_whichToItemMap;
101 };
102
104 class StarItemStyle
105 {
106 public:
108 enum FamilyStyle {
109 F_Char=1, F_Paragraph=2, F_Frame=4, F_Page=8, F_Pseudo=0x10, F_ALL=0xFE
110 };
112 StarItemStyle() : m_family(0), m_mask(0), m_itemSet(), m_helpId(0)
113 {
114 }
116 friend std::ostream &operator<<(std::ostream &o, StarItemStyle const &style);
118 librevenge::RVNGString m_names[4];
120 int m_family;
122 int m_mask;
124 StarItemSet m_itemSet;
126 unsigned m_helpId;
127 };
128
129 #endif
130 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
StarItem
class to store an item: ie.
Definition: StarItem.hxx:53
StarItemStyle::m_family
int m_family
the family
Definition: StarItem.hxx:120
StarItemStyle::m_itemSet
StarItemSet m_itemSet
the item list
Definition: StarItem.hxx:124
StarItem::m_localId
bool m_localId
true if which is local
Definition: StarItem.hxx:71
StarItemSet::empty
bool empty() const
return true if the set is empty
Definition: StarItem.hxx:87
StarItemSet::m_style
librevenge::RVNGString m_style
item set name
Definition: StarItem.hxx:96
StarItemSet::m_family
int m_family
the family
Definition: StarItem.hxx:98
STOFFDebug.hxx
StarItemStyle::m_mask
int m_mask
the mask
Definition: StarItem.hxx:122
StarItemSet::m_whichToItemMap
std::map< int, shared_ptr< StarItem > > m_whichToItemMap
the list of item
Definition: StarItem.hxx:100
StarItemStyle::StarItemStyle
StarItemStyle()
constructor
Definition: StarItem.hxx:112
operator<<
std::ostream & operator<<(std::ostream &o, STOFFColor const &c)
Definition: libstaroffice_internal.cxx:214
StarItem::m_surrogateId
int m_surrogateId
the surrogate id
Definition: StarItem.hxx:69
StarItemStyle::m_helpId
unsigned m_helpId
the help id
Definition: StarItem.hxx:126
StarAttribute
virtual class used to store the different attribute
Definition: StarAttribute.hxx:67
StarItem::m_attribute
shared_ptr< StarAttribute > m_attribute
the attribute if loaded
Definition: StarItem.hxx:65
StarItemSet::StarItemSet
StarItemSet()
constructor
Definition: StarItem.hxx:83
StarItem::StarItem
StarItem(shared_ptr< StarAttribute > attribute, int which)
constructor from attribute
Definition: StarItem.hxx:61
StarItemSet
class to store a list of item
Definition: StarItem.hxx:79
StarItemStyle
brief class used to stored the style
Definition: StarItem.hxx:104
STOFFDocument.hxx
StarItem::m_which
int m_which
the which id
Definition: StarItem.hxx:67
StarItem::StarItem
StarItem(int which)
constructor
Definition: StarItem.hxx:57
StarItemStyle::FamilyStyle
FamilyStyle
the different family style
Definition: StarItem.hxx:108
StarItem::operator=
StarItem & operator=(StarItem const &)