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

KDevelop Property Editing Library

  • lib
  • widgets
  • propeditor
property.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2002-2004 by Alexander Dymo <cloudtemple@mskat.net> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU Library General Public License as *
6  * published by the Free Software Foundation; either version 2 of the *
7  * License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU Library General Public *
15  * License along with this program; if not, write to the *
16  * Free Software Foundation, Inc., *
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18  ***************************************************************************/
19 #ifndef PROPERTY_H
20 #define PROPERTY_H
21 
22 #include <tqvariant.h>
23 
24 #include <tqmap.h>
25 
26 class TQWidget;
27 class TQString;
28 
30 namespace PropertyLib{
31 
62 class Property {
63 public:
66  enum PropertyType {
67  //standard supported TQVariant types
68  Invalid = TQVariant::Invalid ,
69  Map = TQVariant::Map ,
70  List = TQVariant::List ,
71  String = TQVariant::String ,
72  StringList = TQVariant::StringList ,
73  Font = TQVariant::Font ,
74  Pixmap = TQVariant::Pixmap ,
75  //@todo implement TQVariant::Brush
76  Rect = TQVariant::Rect ,
77  Size = TQVariant::Size ,
78  Color = TQVariant::Color ,
79  //@todo implement TQVariant::Palette
80  //@todo implement TQVariant::ColorGroup
81  //@todo implement TQVariant::IconSet
82  Point = TQVariant::Point ,
83  //@todo implement TQVariant::Image
84  Integer = TQVariant::Int ,
85  //@todo implement TQVariant::UInt
86  Boolean = TQVariant::Bool ,
87  Double = TQVariant::Double ,
88  //@todo implement TQVariant::CString
89  //@todo implement TQVariant::PointArray
90  //@todo implement TQVariant::Region
91  //@todo implement TQVariant::Bitmap
92  Cursor = TQVariant::Cursor ,
93  SizePolicy = TQVariant::SizePolicy ,
94  Date = TQVariant::Date ,
95  //@todo implement TQVariant::Time
96  DateTime = TQVariant::DateTime ,
97  //@todo implement TQVariant::ByteArray
98  //@todo implement TQVariant::BitArray
99  //@todo implement TQVariant::KeySequence
100  //@todo implement TQVariant::Pen
101  //@todo implement TQVariant::Long
102  //@todo implement TQVariant::LongLong
103  //@todo implement TQVariant::ULongLong
104 
105 
106  //predefined custom types
107  ValueFromList = 2000 ,
108  Symbol = 2001 ,
109  FontName = 2002 ,
110  FileURL = 2003 ,
111  DirectoryURL = 2004 ,
112  LineStyle = 2005 ,
113 
114  UserDefined = 3000
115  };
116 
118  Property() {}
120  Property(int type, const TQString &name, const TQString &description,
121  const TQVariant &value = TQVariant(), bool save = true, bool readOnly = false);
123  Property(const TQString &name, const TQMap<TQString, TQVariant> &v_valueList,
124  const TQString &description, const TQVariant &value = TQVariant(), bool save = true, bool readOnly = false);
125  virtual ~Property();
126 
127  virtual bool operator<(const Property &prop) const;
128 
130  virtual TQString name() const;
132  virtual void setName(const TQString &name);
134  virtual int type() const;
136  virtual void setType(int type);
138  virtual TQVariant value() const;
140  virtual void setValue(const TQVariant &value, bool rememberOldValue = true);
142  virtual TQString description() const;
144  virtual void setDescription(const TQString &description);
147  virtual void setValueList(const TQMap<TQString, TQVariant> &list);
149  TQMap<TQString, TQVariant> valueList;
150 
154  virtual bool allowSaving() const;
156  virtual bool readOnly() const;
158  virtual bool visible() const;
160  virtual void setVisible(const bool visible);
161 
163  virtual TQVariant oldValue() const;
164 
165 private:
166 // Property(Property &property) {};
167 // void operator=(Property &property) {};
168 
169  int m_type;
170  TQString m_name;
171  TQString m_description;
172  TQVariant m_value;
173  TQVariant m_oldValue;
174  bool m_save;
175  bool m_readOnly;
176  bool m_visible;
177 };
178 
179 }
180 
181 #endif
PropertyLib::Property::StringList
string list
Definition: property.h:72
PropertyLib::Property::SizePolicy
size policy (horizontal, vertical)
Definition: property.h:93
PropertyLib::Property::description
virtual TQString description() const
Definition: property.cpp:91
PropertyLib::Property::List
TQValueList<TQVariant>
Definition: property.h:70
PropertyLib::Property::Pixmap
pixmap
Definition: property.h:74
PropertyLib::Property::Map
TQMap<TQString, TQVariant>
Definition: property.h:69
PropertyLib::Property::Point
point (x,y)
Definition: property.h:82
PropertyLib::Property::Date
date
Definition: property.h:94
PropertyLib
Namespace which contain property editing classes.
Definition: childproperty.cpp:29
PropertyLib::Property::Integer
integer
Definition: property.h:84
PropertyLib::Property::FontName
font name, e.g.
Definition: property.h:109
PropertyLib::Property::Invalid
invalid property type
Definition: property.h:68
PropertyLib::Property::oldValue
virtual TQVariant oldValue() const
Gets the previous property value.
Definition: property.cpp:121
PropertyLib::Property::setValueList
virtual void setValueList(const TQMap< TQString, TQVariant > &list)
Sets the string-to-value correspondence list of the property.
Definition: property.cpp:101
PropertyLib::Property::Property
Property()
Constructs empty property.
Definition: property.h:118
PropertyLib::Property::DirectoryURL
url of a directory
Definition: property.h:111
PropertyLib::Property::DateTime
date and time
Definition: property.h:96
PropertyLib::Property::readOnly
virtual bool readOnly() const
Tells if the property is read only.
Definition: property.cpp:106
PropertyLib::Property::Color
color
Definition: property.h:78
PropertyLib::Property::valueList
TQMap< TQString, TQVariant > valueList
The string-to-value correspondence list of the property.
Definition: property.h:149
PropertyLib::Property::value
virtual TQVariant value() const
Definition: property.cpp:77
PropertyLib::Property::setType
virtual void setType(int type)
Sets the type of the property.
Definition: property.cpp:72
PropertyLib::Property::Font
font
Definition: property.h:73
PropertyLib::Property::setVisible
virtual void setVisible(const bool visible)
Set the visibility.
Definition: property.cpp:116
PropertyLib::Property::String
string
Definition: property.h:71
PropertyLib::Property::ValueFromList
string value from a list
Definition: property.h:107
PropertyLib::Property::Boolean
boolean
Definition: property.h:86
PropertyLib::Property::Cursor
cursor
Definition: property.h:92
PropertyLib::Property::type
virtual int type() const
Definition: property.cpp:67
PropertyLib::Property::Size
size (width, height)
Definition: property.h:77
PropertyLib::Property::PropertyType
PropertyType
PropertyType.
Definition: property.h:66
PropertyLib::Property::visible
virtual bool visible() const
Tells if the property is visible.
Definition: property.cpp:111
PropertyLib::Property::Symbol
unicode symbol code
Definition: property.h:108
PropertyLib::Property::name
virtual TQString name() const
Definition: property.cpp:57
PropertyLib::Property::LineStyle
line style
Definition: property.h:112
PropertyLib::Property::allowSaving
virtual bool allowSaving() const
Tells if the property can be saved to a stream, xml, etc.
Definition: property.cpp:44
PropertyLib::Property::FileURL
url of a file
Definition: property.h:110
PropertyLib::Property
Property.
Definition: property.h:62
PropertyLib::Property::UserDefined
plugin defined properties should start here
Definition: property.h:114
PropertyLib::Property::setDescription
virtual void setDescription(const TQString &description)
Sets the description of the property.
Definition: property.cpp:96
PropertyLib::Property::Double
double
Definition: property.h:87
PropertyLib::Property::setName
virtual void setName(const TQString &name)
Sets the name of the property.
Definition: property.cpp:62
PropertyLib::Property::Rect
rectangle (x,y, width, height)
Definition: property.h:76
PropertyLib::Property::setValue
virtual void setValue(const TQVariant &value, bool rememberOldValue=true)
Sets the value of the property.
Definition: property.cpp:82

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.