Soprano 2.9.4
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
35namespace Soprano
36{
37 class StorageModel;
38
53 {
54 public:
60
65
70
74 BackendSetting( const QString& userOption, const QVariant& value_ );
75
80
85
90
96
101
106
110 void setValue( const QVariant& value );
111
112 private:
113 class Private;
115 };
116
123
139
155
169
185
199
216
232
248
249
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
318
325 bool supportsFeatures( BackendFeatures feature, const QStringList& userFeatures = QStringList() ) const;
326
327 private:
328 class Private;
329 Private* const d;
330 };
331}
332
333Q_DECLARE_INTERFACE(Soprano::Backend, "org.soprano.plugins.Backend/2.1")
334
335#endif
SOPRANO_EXPORT QVariant valueInSettings(const BackendSettings &settings, const QString &userOptionName, const QVariant &defaultValue=QVariant())
BackendSetting & operator=(const BackendSetting &other)
BackendSetting(BackendOption option)
BackendOption option() const
BackendSetting(BackendOption s, const QVariant &value_)
SOPRANO_EXPORT QVariant valueInSettings(const BackendSettings &settings, BackendOption option, const QString &userOptionName=QString())
QVariant value() const
void setValue(const QVariant &value)
QString userOptionName() const
BackendSetting(const QString &userOption, const QVariant &value_)
BackendSetting(const BackendSetting &other)
SOPRANO_EXPORT BackendSetting & settingInSettings(BackendSettings &settings, BackendOption option, const QString &userOptionName=QString())
SOPRANO_EXPORT BackendSetting settingInSettings(const BackendSettings &settings, BackendOption option, const QString &userOptionName=QString())
SOPRANO_EXPORT bool isOptionInSettings(const BackendSettings &settings, BackendOption option, const QString &userOptionName=QString())
SOPRANO_EXPORT BackendSetting settingInSettings(const BackendSettings &settings, const QString &userOptionName=QString())
SOPRANO_EXPORT QVariant valueInSettingsWithDefault(const BackendSettings &settings, BackendOption option, const QVariant &defaultValue)
SOPRANO_EXPORT BackendSetting & settingInSettings(BackendSettings &settings, const QString &userOptionName)
Soprano::Backend defines the interface for a Soprano backend plugin.
Definition backend.h:264
Backend(const QString &name)
bool supportsFeatures(BackendFeatures feature, const QStringList &userFeatures=QStringList()) const
virtual StorageModel * createModel(const BackendSettings &settings=BackendSettings()) const =0
virtual BackendFeatures supportedFeatures() const =0
virtual bool deleteModelData(const BackendSettings &settings) const =0
virtual QStringList supportedUserFeatures() const
virtual ~Backend()
Core class of Soprano's exception system.
Definition error.h:235
Plugin(const QString &name)
Base class for all Model implementations that store data (as compared to FilterModel).
QList< BackendSetting > BackendSettings
Definition backend.h:122
#define SOPRANO_EXPORT