CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkLocation.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 #ifndef CTKLOCATION_H
23 #define CTKLOCATION_H
24 
25 #include <ctkPluginFrameworkExport.h>
26 
27 #include <QObject>
28 
29 class QUrl;
30 
35 struct CTK_PLUGINFW_EXPORT ctkLocation
36 {
37 
42  static const QString INSTANCE_FILTER;
43 
48  static const QString INSTALL_FILTER;
49 
54  static const QString CONFIGURATION_FILTER;
55 
60  static const QString USER_FILTER;
61 
66  static const QString CTK_HOME_FILTER;
67 
68 
69  virtual ~ctkLocation() {}
70 
77  virtual bool allowsDefault() const = 0;
78 
86  virtual QUrl getDefault() const = 0;
87 
93  virtual ctkLocation* getParentLocation() const = 0;
94 
103  virtual QUrl getUrl() const = 0;
104 
111  virtual bool isSet() const = 0;
112 
121  virtual bool isReadOnly() const = 0;
122 
134  virtual bool set(const QUrl& value, bool lock) = 0;
135 
150  virtual bool set(const QUrl& value, bool lock, const QString& lockFilePath) = 0;
151 
164  virtual bool lock() = 0;
165 
170  virtual void release() = 0;
171 
178  virtual bool isLocked() const = 0;
179 
187  virtual ctkLocation* createLocation(ctkLocation* parent, const QUrl& defaultValue, bool readonly) = 0;
188 
209  virtual QUrl getDataArea(const QString& path) const = 0;
210 
211 };
212 
213 Q_DECLARE_INTERFACE(ctkLocation, "org.commontk.service.datalocation.Location")
214 
215 #endif // CTKLOCATION_H
static const QString INSTALL_FILTER
Definition: ctkLocation.h:48
virtual bool set(const QUrl &value, bool lock, const QString &lockFilePath)=0
virtual bool isLocked() const =0
virtual ~ctkLocation()
Definition: ctkLocation.h:69
virtual ctkLocation * getParentLocation() const =0
static const QString USER_FILTER
Definition: ctkLocation.h:60
virtual bool lock()=0
virtual QUrl getDefault() const =0
virtual bool isReadOnly() const =0
virtual QUrl getDataArea(const QString &path) const =0
static const QString CONFIGURATION_FILTER
Definition: ctkLocation.h:54
virtual bool isSet() const =0
virtual void release()=0
virtual bool set(const QUrl &value, bool lock)=0
virtual ctkLocation * createLocation(ctkLocation *parent, const QUrl &defaultValue, bool readonly)=0
static const QString INSTANCE_FILTER
Definition: ctkLocation.h:42
static const QString CTK_HOME_FILTER
Definition: ctkLocation.h:66
virtual QUrl getUrl() const =0
virtual bool allowsDefault() const =0