• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Property Editing Library
 

KDevelop Property Editing Library

  • lib
  • widgets
  • propeditor
propertylist.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2004 by Alexander Dymo *
3  * cloudtemple@mskat.net *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU Library General Public License as *
7  * published by the Free Software Foundation; either version 2 of the *
8  * License, or (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU Library General Public *
16  * License along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 #ifndef PROPERTYLIST_H
21 #define PROPERTYLIST_H
22 
23 #include <tqobject.h>
24 #include <tqmap.h>
25 #include <tqptrlist.h>
26 #include <tqvaluelist.h>
27 #include <tqpair.h>
28 
29 namespace PropertyLib{
30 
31 class Property;
32 class MultiProperty;
33 
55 class PropertyList: public TQObject
56 {
57  Q_OBJECT
58 
59 
60 public:
61  class Iterator {
62  public:
63  void operator ++();
64  void operator ++(int);
65 
66  MultiProperty *operator *();
67 
68  bool operator != (Iterator it);
69 
70  TQString key();
71  MultiProperty *data();
72 
73  private:
74  Iterator(PropertyList *list);
75  Iterator(PropertyList *list, bool end);
76 
77  void next();
78  TQMap<TQString, MultiProperty*>::iterator current;
79 
80  PropertyList *m_list;
81  friend class PropertyList;
82  };
83 
84  typedef Iterator iterator;
85 
86  PropertyList();
87  virtual ~PropertyList();
88 
97  virtual MultiProperty *operator[](const TQString &name);
101  MultiProperty *property( const TQString &name );
102 
104  virtual void addProperty(Property *property);
106  virtual void addProperty(const TQString &group, Property *property);
108  virtual void removeProperty(Property *property);
111  virtual void removeProperty(const TQString &name);
112 
114  virtual const TQValueList<TQPair<TQString, TQValueList<TQString> > >& propertiesOfGroup() const;
116  virtual const TQMap<MultiProperty*, TQString>& groupOfProperty() const;
117 
119  virtual void clear();
121  virtual bool contains(const TQString &name);
122 
124  TQPtrList<Property> properties(const TQString &name);
125 
126  Iterator begin();
127  Iterator end();
128 
129 signals:
131  void propertyValueChanged(Property* property);
133  void aboutToDeleteProperty(Property* property);
134 
135 protected:
137  PropertyList(bool propertyOwner);
138 
140  void addToGroup(const TQString &group, MultiProperty *property);
142  void removeFromGroup(MultiProperty *property);
143 
144 private:
145  //sorted list of properties in form name: property
146  TQMap<TQString, MultiProperty*> m_list;
147 
148  //groups of properties:
149  // list of group name: (list of property names)
150  TQValueList<TQPair<TQString, TQValueList<TQString> > > m_propertiesOfGroup;
151  // map of property: group
152  TQMap<MultiProperty*, TQString> m_groupOfProperty;
153 
154  //indicates that this list will delete properties after removeProperty()
155  //and also in destructor
156  bool m_propertyOwner;
157 
158 friend class MultiProperty;
159 friend class PropertyBuffer;
160 friend class Iterator;
161 };
162 
163 
183 class PropertyBuffer: public PropertyList{
184  Q_OBJECT
185 
186 public:
188  PropertyBuffer(PropertyList *list);
190  PropertyBuffer();
191 
193  virtual void intersect(const PropertyList *list);
194 
195 protected slots:
196  void intersectedValueChanged(Property *property);
197 
198 };
199 
200 }
201 
202 #endif
PropertyLib::PropertyList::addProperty
virtual void addProperty(Property *property)
Adds the property to the list to the "common" group.
Definition: propertylist.cpp:58
PropertyLib::PropertyList::propertiesOfGroup
virtual const TQValueList< TQPair< TQString, TQValueList< TQString > > > & propertiesOfGroup() const
Definition: propertylist.cpp:149
PropertyLib
Namespace which contain property editing classes.
Definition: childproperty.cpp:29
PropertyLib::PropertyList::removeProperty
virtual void removeProperty(Property *property)
Removes property from the list.
Definition: propertylist.cpp:95
PropertyLib::PropertyList::groupOfProperty
virtual const TQMap< MultiProperty *, TQString > & groupOfProperty() const
Definition: propertylist.cpp:154
PropertyLib::PropertyBuffer
The list of properties which does not own them.
Definition: propertylist.h:183
PropertyLib::PropertyList::properties
TQPtrList< Property > properties(const TQString &name)
The list of properties with given name.
Definition: propertylist.cpp:227
PropertyLib::PropertyList::contains
virtual bool contains(const TQString &name)
Returns true if the list of properties contains property with given name.
Definition: propertylist.cpp:220
PropertyLib::PropertyList::propertyValueChanged
void propertyValueChanged(Property *property)
Emitted when the value of the property is changed.
PropertyLib::PropertyList
The list of properties.
Definition: propertylist.h:55
PropertyLib::PropertyList::property
MultiProperty * property(const TQString &name)
Accesses a property by it&#39;s name.
Definition: propertylist.cpp:50
PropertyLib::PropertyList::removeFromGroup
void removeFromGroup(MultiProperty *property)
Removes property from a group.
Definition: propertylist.cpp:194
PropertyLib::PropertyList::addToGroup
void addToGroup(const TQString &group, MultiProperty *property)
Adds property to a group.
Definition: propertylist.cpp:159
PropertyLib::PropertyList::operator[]
virtual MultiProperty * operator[](const TQString &name)
Accesses a property by it&#39;s name.
Definition: propertylist.cpp:42
PropertyLib::PropertyList::clear
virtual void clear()
Clears the list of properties.
Definition: propertylist.cpp:214
PropertyLib::Property
Property.
Definition: property.h:62
PropertyLib::MultiProperty
Holds a list of properties with the same name and type.
Definition: multiproperty.h:49
PropertyLib::PropertyList::aboutToDeleteProperty
void aboutToDeleteProperty(Property *property)
Emitted when property is about to be deleted.

KDevelop Property Editing Library

Skip menu "KDevelop Property Editing Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

KDevelop Property Editing Library

Skip menu "KDevelop Property Editing Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Property Editing Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.