Computer Assited Medical Intervention Tool Kit  version 3.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Property.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2014 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef PROPERTY_H
27 #define PROPERTY_H
28 
29 #include <QVariant>
30 #include <QStringList>
31 #include <QIcon>
32 
33 #include "CamiTKAPI.h"
34 
35 namespace camitk {
36 
196 
197 public:
206  Property(QString name, const QVariant &variant, QString description, QString unit);
207 
209  const QString & getName() const;
210 
212  const QVariant &getInitialValue() const;
213 
215  void setReadOnly(bool);
216 
218  bool getReadOnly() const;
219 
221  void setDescription(QString);
222 
224  const QString & getDescription() const;
225 
240  void setAttribute(const QString &attribute, const QVariant &value );
241 
252  QVariant getAttribute(QString attName);
253 
255  QStringList getAttributeList();
256 
258  void setEnumTypeName(QString);
259 
261  QString getEnumTypeName() const;
262 
270  QString getEnumValueAsString(const QObject *objectDeclaringTheEnum) const;
271 
273  QMap<int,QIcon> getEnumIcons() const;
274 
276  void setEnumIcons(const QMap<int,QIcon>& enumIcons);
277 
282  void setGroupName(QString groupName);
283 
287  QString getGroupName() const;
288 
289 private:
291  QString name;
292 
294  QString groupName;
295 
301  QVariant initialValue;
302 
304  QString description;
305 
307  bool readOnly;
308 
310  QMap<QString,QVariant> attributeValues;
311 
313  QString enumTypeName;
314 
316  QMap<int,QIcon> enumIcons;
317 };
318 
319 }
320 
321 #endif // PROPERTY_H
const char * description
Definition: applications/cepgenerator/main.cpp:37
bool readOnly
is the property read only
Definition: Property.h:307
string name
Definition: select.cpp:111
QVariant initialValue
initial value of the property, Only needed between the time when the property is instanciated and the...
Definition: Property.h:301
Definition: Action.cpp:40
#define CAMITK_API
Definition: CamiTKAPI.h:49
QString enumTypeName
if the property's type is an enum, this is the Qt registered enum name, otherwise it is the null stri...
Definition: Property.h:313
QMap< int, QIcon > enumIcons
map containing all the icons for the enum
Definition: Property.h:316
QString groupName
name of the group in which this property is classified (null if no group name were set) ...
Definition: Property.h:294
QString name
name of the property
Definition: Property.h:291
QString description
description of the property, can be rich text
Definition: Property.h:304
QMap< QString, QVariant > attributeValues
map containing all the attributes and their values
Definition: Property.h:310
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:195