Computer Assited Medical Intervention Tool Kit  version 4.0
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-2016 Univ. Grenoble Alpes, 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 
261 
262 public:
271  Property(QString name, const QVariant &variant, QString description, QString unit);
272 
274  virtual ~Property() {}
275 
277  const QString & getName() const;
278 
280  const QVariant &getInitialValue() const;
281 
283  void setReadOnly(bool);
284 
286  bool getReadOnly() const;
287 
289  void setDescription(QString);
290 
292  const QString & getDescription() const;
293 
308  void setAttribute(const QString &attribute, const QVariant &value );
309 
320  QVariant getAttribute(QString attName);
321 
323  QStringList getAttributeList();
324 
326  void setEnumTypeName(QString);
327 
329  QString getEnumTypeName() const;
330 
338  QString getEnumValueAsString(const QObject *objectDeclaringTheEnum) const;
339 
341  QMap<int,QIcon> getEnumIcons() const;
342 
344  void setEnumIcons(const QMap<int,QIcon>& enumIcons);
345 
350  void setGroupName(QString groupName);
351 
355  QString getGroupName() const;
356 
357 private:
359  QString name;
360 
362  QString groupName;
363 
369  QVariant initialValue;
370 
372  QString description;
373 
375  bool readOnly;
376 
378  QMap<QString,QVariant> attributeValues;
379 
381  QString enumTypeName;
382 
384  QMap<int,QIcon> enumIcons;
385 };
386 
387 }
388 
389 #endif // PROPERTY_H
const char * description
Definition: applications/cepgenerator/main.cpp:37
bool readOnly
is the property read only
Definition: Property.h:375
QVariant initialValue
initial value of the property, Only needed between the time when the property is instanciated and the...
Definition: Property.h:369
Definition: Action.cpp:40
#define CAMITK_API
Definition: CamiTKAPI.h:49
QString enumTypeName
if the property&#39;s type is an enum, this is the Qt registered enum name, otherwise it is the null stri...
Definition: Property.h:381
virtual ~Property()
Destructor.
Definition: Property.h:274
QMap< int, QIcon > enumIcons
map containing all the icons for the enum
Definition: Property.h:384
QString groupName
name of the group in which this property is classified (null if no group name were set) ...
Definition: Property.h:362
QString name
name of the property
Definition: Property.h:359
QString description
description of the property, can be rich text
Definition: Property.h:372
QMap< QString, QVariant > attributeValues
map containing all the attributes and their values
Definition: Property.h:378
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:260