Computer Assited Medical Intervention Tool Kit  version 3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
189 
190 public:
199  Property(QString name, const QVariant &variant, QString description, QString unit);
200 
202  const QString & getName() const;
203 
205  const QVariant &getInitialValue() const;
206 
208  void setReadOnly(bool);
209 
211  bool getReadOnly() const;
212 
214  void setDescription(QString);
215 
217  const QString & getDescription() const;
218 
233  void setAttribute(const QString &attribute, const QVariant &value );
234 
245  QVariant getAttribute(QString attName);
246 
248  QStringList getAttributeList();
249 
251  void setEnumTypeName(QString);
252 
254  QString getEnumTypeName() const;
255 
263  QString getEnumValueAsString(const QObject *objectDeclaringTheEnum) const;
264 
266  QMap<int,QIcon> getEnumIcons() const;
267 
269  void setEnumIcons(const QMap<int,QIcon>& enumIcons);
270 
275  void setGroupName(QString groupName);
276 
280  QString getGroupName() const;
281 
282 private:
284  QString name;
285 
287  QString groupName;
288 
294  QVariant initialValue;
295 
297  QString description;
298 
300  bool readOnly;
301 
303  QMap<QString,QVariant> attributeValues;
304 
306  QString enumTypeName;
307 
309  QMap<int,QIcon> enumIcons;
310 };
311 
312 }
313 
314 #endif // PROPERTY_H
bool readOnly
is the property read only
Definition: Property.h:300
QVariant initialValue
initial value of the property, Only needed between the time when the property is instanciated and the...
Definition: Property.h:294
#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:306
QMap< int, QIcon > enumIcons
map containing all the icons for the enum
Definition: Property.h:309
QString groupName
name of the group in which this property is classified (null if no group name were set) ...
Definition: Property.h:287
QString name
name of the property
Definition: Property.h:284
QString description
description of the property, can be rich text
Definition: Property.h:297
QMap< QString, QVariant > attributeValues
map containing all the attributes and their values
Definition: Property.h:303
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:188