• 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.cpp
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#include "property.h"
20
21#include <tqstring.h>
22
23namespace PropertyLib{
24
25Property::Property(int type, const TQString &name, const TQString &description,
26 const TQVariant &value, bool save, bool readOnly):
27 m_type(type), m_name(name), m_description(description), m_value(value), m_save(save),
28 m_readOnly(readOnly), m_visible(true)
29{
30}
31
32Property::Property(const TQString &name, const TQStringVariantMap &v_valueList,
33 const TQString &description, const TQVariant &value, bool save, bool readOnly):
34 valueList(v_valueList), m_type(ValueFromList), m_name(name),
35 m_description(description), m_value(value), m_save(save), m_readOnly(readOnly),
36 m_visible(true)
37{
38}
39
40Property::~Property()
41{
42}
43
44bool Property::allowSaving() const
45{
46 return m_save;
47}
48
49bool Property::operator<(const Property &prop) const
50{
51 if ((type() < prop.type()) && (name() < prop.name()))
52 return true;
53 else
54 return false;
55}
56
57TQString Property::name() const
58{
59 return m_name;
60}
61
62void Property::setName(const TQString &name)
63{
64 m_name = name;
65}
66
67int Property::type() const
68{
69 return m_type;
70}
71
72void Property::setType(int type)
73{
74 m_type = type;
75}
76
77TQVariant Property::value() const
78{
79 return m_value;
80}
81
82void Property::setValue(const TQVariant &value, bool rememberOldValue)
83{
84 if (rememberOldValue)
85 m_oldValue = m_value;
86 else
87 m_oldValue = value;
88 m_value = value;
89}
90
91TQString Property::description() const
92{
93 return m_description;
94}
95
96void Property::setDescription(const TQString &description)
97{
98 m_description = description;
99}
100
101void Property::setValueList(const TQStringVariantMap &v_valueList)
102{
103 valueList = v_valueList;
104}
105
106bool Property::readOnly() const
107{
108 return m_readOnly;
109}
110
111bool Property::visible() const
112{
113 return m_visible;
114}
115
116void Property::setVisible( const bool visible )
117{
118 m_visible = visible;
119}
120
121TQVariant Property::oldValue() const
122{
123 if (m_oldValue.isNull())
124 return m_value;
125 else
126 return m_oldValue;
127}
128
129}
PropertyLib::Property
Property.
Definition property.h:62
PropertyLib::Property::readOnly
virtual bool readOnly() const
Tells if the property is read only.
Definition property.cpp:106
PropertyLib::Property::visible
virtual bool visible() const
Tells if the property is visible.
Definition property.cpp:111
PropertyLib::Property::name
virtual TQString name() const
Definition property.cpp:57
PropertyLib::Property::valueList
TQStringVariantMap valueList
The string-to-value correspondence list of the property.
Definition property.h:149
PropertyLib::Property::description
virtual TQString description() const
Definition property.cpp:91
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::setValue
virtual void setValue(const TQVariant &value, bool rememberOldValue=true)
Sets the value of the property.
Definition property.cpp:82
PropertyLib::Property::setType
virtual void setType(int type)
Sets the type of the property.
Definition property.cpp:72
PropertyLib::Property::Property
Property()
Constructs empty property.
Definition property.h:118
PropertyLib::Property::setDescription
virtual void setDescription(const TQString &description)
Sets the description of the property.
Definition property.cpp:96
PropertyLib::Property::oldValue
virtual TQVariant oldValue() const
Gets the previous property value.
Definition property.cpp:121
PropertyLib::Property::type
virtual int type() const
Definition property.cpp:67
PropertyLib::Property::setVisible
virtual void setVisible(const bool visible)
Set the visibility.
Definition property.cpp:116
PropertyLib::Property::value
virtual TQVariant value() const
Definition property.cpp:77
PropertyLib::Property::setValueList
virtual void setValueList(const TQStringVariantMap &list)
Sets the string-to-value correspondence list of the property.
Definition property.cpp:101
PropertyLib::Property::setName
virtual void setName(const TQString &name)
Sets the name of the property.
Definition property.cpp:62
PropertyLib
Namespace which contain property editing classes.
Definition childproperty.cpp:29
property.h
Contains PropertyLib::Property class and PropertyLib::Property::PropertyType enum.

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.9.8
This website is maintained by Timothy Pearson.