Soprano
2.8.0
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
soprano
backend.h
Go to the documentation of this file.
1
/*
2
* This file is part of Soprano Project.
3
*
4
* Copyright (C) 2007-2008 Sebastian Trueg <trueg@kde.org>
5
*
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Library General Public
8
* License as published by the Free Software Foundation; either
9
* version 2 of the License, or (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Library General Public License for more details.
15
*
16
* You should have received a copy of the GNU Library General Public License
17
* along with this library; see the file COPYING.LIB. If not, write to
18
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19
* Boston, MA 02110-1301, USA.
20
*/
21
22
#ifndef _SOPRANO_BACKEND_H_
23
#define _SOPRANO_BACKEND_H_
24
25
#include "
plugin.h
"
26
#include "
error.h
"
27
#include "
soprano_export.h
"
28
#include "
sopranotypes.h
"
29
30
#include <QtCore/QStringList>
31
#include <QtCore/QVariant>
32
#include <QtCore/QSharedDataPointer>
33
34
35
namespace
Soprano
36
{
37
class
StorageModel
;
38
52
class
SOPRANO_EXPORT
BackendSetting
53
{
54
public
:
59
BackendSetting
();
60
64
BackendSetting
(
BackendOption
option );
65
69
BackendSetting
(
BackendOption
s,
const
QVariant
& value_ );
70
74
BackendSetting
(
const
QString
& userOption,
const
QVariant
& value_ );
75
79
BackendSetting
(
const
BackendSetting
& other );
80
84
~
BackendSetting
();
85
89
BackendSetting
& operator=(
const
BackendSetting
& other );
90
95
BackendOption
option()
const
;
96
100
QString
userOptionName()
const
;
101
105
QVariant
value
()
const
;
106
110
void
setValue(
const
QVariant
& value );
111
112
private
:
113
class
Private;
114
QSharedDataPointer<Private>
d;
115
};
116
122
typedef
QList<BackendSetting>
BackendSettings
;
123
138
SOPRANO_EXPORT
bool
isOptionInSettings(
const
BackendSettings
& settings,
BackendOption
option,
const
QString
& userOptionName =
QString
() );
139
154
SOPRANO_EXPORT
BackendSetting
& settingInSettings(
BackendSettings
& settings,
BackendOption
option,
const
QString
& userOptionName =
QString
() );
155
168
SOPRANO_EXPORT
BackendSetting
& settingInSettings(
BackendSettings
& settings,
const
QString
& userOptionName );
169
184
SOPRANO_EXPORT
BackendSetting
settingInSettings(
const
BackendSettings
& settings,
BackendOption
option,
const
QString
& userOptionName =
QString
() );
185
198
SOPRANO_EXPORT
BackendSetting
settingInSettings(
const
BackendSettings
& settings,
const
QString
& userOptionName =
QString
() );
199
215
SOPRANO_EXPORT
QVariant
valueInSettings(
const
BackendSettings
& settings,
BackendOption
option,
const
QString
& userOptionName =
QString
() );
216
231
SOPRANO_EXPORT
QVariant
valueInSettings(
const
BackendSettings
& settings,
const
QString
& userOptionName,
const
QVariant
& defaultValue =
QVariant
() );
232
247
SOPRANO_EXPORT
QVariant
valueInSettingsWithDefault(
const
BackendSettings
& settings,
BackendOption
option,
const
QVariant
& defaultValue );
248
249
263
class
SOPRANO_EXPORT
Backend
:
public
Plugin
,
public
Error::ErrorCache
264
{
265
public
:
266
Backend
(
const
QString
&
name
);
267
virtual
~
Backend
();
268
280
virtual
StorageModel
*
createModel
(
const
BackendSettings
& settings =
BackendSettings
() )
const
= 0;
281
297
virtual
bool
deleteModelData(
const
BackendSettings
& settings )
const
= 0;
298
306
virtual
BackendFeatures supportedFeatures()
const
= 0;
307
317
virtual
QStringList
supportedUserFeatures()
const
;
318
325
bool
supportsFeatures( BackendFeatures feature,
const
QStringList
& userFeatures =
QStringList
() )
const
;
326
327
private
:
328
class
Private;
329
Private*
const
d;
330
};
331
}
332
333
Q_DECLARE_INTERFACE(
Soprano::Backend
,
"org.soprano.plugins.Backend/2.1"
)
334
335
#endif
Generated by
1.8.1.2