Computer Assited Medical Intervention Tool Kit  version 4.1
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-2018 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 
292 
293 public:
302  Property(QString name, const QVariant& variant, QString description, QString unit);
303 
305  virtual ~Property() = default;
306 
308  const QString& getName() const;
309 
311  const QVariant& getInitialValue() const;
312 
314  void setReadOnly(bool);
315 
317  bool getReadOnly() const;
318 
320  void setDescription(QString);
321 
323  const QString& getDescription() const;
324 
339  void setAttribute(const QString& attribute, const QVariant& value);
340 
352  QVariant getAttribute(QString attName);
353 
355  QStringList getAttributeList();
356 
360  void setEnumTypeName(QString);
361 
371  void setEnumTypeName(QString enumTypeName, QObject* objectDeclaringTheEnum);
372 
374  QString getEnumTypeName() const;
375 
383  QString getEnumValueAsString(const QObject* objectDeclaringTheEnum) const;
384 
386  QMap<int, QIcon> getEnumIcons() const;
387 
389  void setEnumIcons(const QMap<int, QIcon>& enumIcons);
390 
395  void setGroupName(QString groupName);
396 
400  QString getGroupName() const;
401 
402 private:
404  QString name;
405 
407  QString groupName;
408 
414  QVariant initialValue;
415 
417  QString description;
418 
420  bool readOnly;
421 
423  QMap<QString, QVariant> attributeValues;
424 
426  QString enumTypeName;
427 
429  QMap<int, QIcon> enumIcons;
430 };
431 
432 }
433 
434 #endif // PROPERTY_H
const char * description
Definition: applications/cepgenerator/main.cpp:37
bool readOnly
is the property read only
Definition: Property.h:420
QVariant initialValue
initial value of the property, Only needed between the time when the property is instantiated and the...
Definition: Property.h:414
QMap< QString, QVariant > attributeValues
map containing all the attributes and their values
Definition: Property.h:423
Definition: Action.cpp:36
#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:426
QMap< int, QIcon > enumIcons
map containing all the icons for the enum
Definition: Property.h:429
QString groupName
name of the group in which this property is classified (null if no group name were set) ...
Definition: Property.h:407
QString name
name of the property
Definition: Property.h:404
QString description
description of the property, can be rich text
Definition: Property.h:417
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:291