CTK 0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkAttributeDefinition.h
Go to the documentation of this file.
1/*=============================================================================
2
3 Library: CTK
4
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics
7
8 Licensed under the Apache License, Version 2.0 (the "License");
9 you may not use this file except in compliance with the License.
10 You may obtain a copy of the License at
11
12 http://www.apache.org/licenses/LICENSE-2.0
13
14 Unless required by applicable law or agreed to in writing, software
15 distributed under the License is distributed on an "AS IS" BASIS,
16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 See the License for the specific language governing permissions and
18 limitations under the License.
19
20=============================================================================*/
21
22
23#ifndef CTKATTRIBUTEDEFINITION_H
24#define CTKATTRIBUTEDEFINITION_H
25
26#include <QSharedPointer>
27#include <QMetaType>
28#include <QString>
29#include <QVariant>
30
31#include <ctkPluginFrameworkExport.h>
32
42struct CTK_PLUGINFW_EXPORT ctkAttributeDefinition
43{
44 typedef QVariant::Type Type;
45
46 static const int PASSWORD;
47
57 struct Password : public QString {
58 Password() : QString() {}
59 Password(const QString& pwd) : QString(pwd) {}
60 Password(const char* pwd) : QString(pwd) {}
61 };
62
64
70 virtual QString getName() const = 0;
71
90 virtual QString getID() const = 0;
91
100 virtual QString getDescription() const = 0;
101
118 virtual int getCardinality() const = 0;
119
133 virtual int getType() const = 0;
134
154 virtual QStringList getOptionValues() const = 0;
155
174 virtual QStringList getOptionLabels() const = 0;
175
192 virtual QString validate(const QString& value) const = 0;
193
208 virtual QStringList getDefaultValue() const = 0;
209};
210
211
215typedef QSharedPointer<ctkAttributeDefinition> ctkAttributeDefinitionPtr;
216
218
219
220#endif // CTKATTRIBUTEDEFINITION_H
Q_DECLARE_METATYPE(ctkDICOMPersonName)
QSharedPointer< ctkAttributeDefinition > ctkAttributeDefinitionPtr
virtual int getType() const =0
virtual QString getID() const =0
virtual QStringList getOptionLabels() const =0
virtual int getCardinality() const =0
virtual QString getName() const =0
virtual QStringList getOptionValues() const =0
virtual QString getDescription() const =0
virtual QStringList getDefaultValue() const =0
virtual QString validate(const QString &value) const =0