QtSparql  0.2.6
qsparqldriver_p.h
1 /****************************************************************************
2 **
3 ** Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (ivan.frade@nokia.com)
6 **
7 ** This file is part of the QtSparql module (not yet part of the Qt Toolkit).
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** GNU Lesser General Public License Usage
11 ** This file may be used under the terms of the GNU Lesser General Public
12 ** License version 2.1 as published by the Free Software Foundation and
13 ** appearing in the file LICENSE.LGPL included in the packaging of this
14 ** file. Please review the following information to ensure the GNU Lesser
15 ** General Public License version 2.1 requirements will be met:
16 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 **
18 ** In addition, as a special exception, Nokia gives you certain additional
19 ** rights. These rights are described in the Nokia Qt LGPL Exception
20 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 **
22 ** GNU General Public License Usage
23 ** Alternatively, this file may be used under the terms of the GNU General
24 ** Public License version 3.0 as published by the Free Software Foundation
25 ** and appearing in the file LICENSE.GPL included in the packaging of this
26 ** file. Please review the following information to ensure the GNU General
27 ** Public License version 3.0 requirements will be met:
28 ** http://www.gnu.org/copyleft/gpl.html.
29 **
30 ** Other Usage
31 ** Alternatively, this file may be used in accordance with the terms and
32 ** conditions contained in a signed written agreement between you and Nokia.
33 **
34 ** If you have questions regarding the use of this file, please contact
35 ** Nokia at ivan.frade@nokia.com.
36 ** $QT_END_LICENSE$
37 **
38 ****************************************************************************/
39 
40 // TODO: publish this header file when the Driver interface has stabilized
41 #ifndef QSPARQLDRIVER_H
42 #define QSPARQLDRIVER_H
43 
44 #include <qsparqlconnection.h>
45 #include <qsparqlconnectionoptions.h>
46 #include <qsparqlquery.h>
47 
48 #include <QtCore/qurl.h>
49 #include <QtCore/qobject.h>
50 #include <QtCore/qstring.h>
51 #include <QtCore/qstringlist.h>
52 
53 
54 QT_BEGIN_HEADER
55 
56 QT_BEGIN_NAMESPACE
57 
58 QT_MODULE(Sparql)
59 
60 class QSparqlDriverPrivate;
61 class QSparqlError;
63 class QSparqlResult;
64 class QVariant;
65 
66 class Q_SPARQL_EXPORT QSparqlDriver : public QObject
67 {
68  Q_OBJECT
69  friend class QSparqlConnection;
70 public:
71  explicit QSparqlDriver(QObject *parent=0);
72  ~QSparqlDriver();
73  virtual bool isOpen() const;
74  bool isOpenError() const;
75 
76  virtual bool beginTransaction();
77  virtual bool commitTransaction();
78  virtual bool rollbackTransaction();
79 
80  QSparqlError lastError() const;
81 
82  virtual QVariant handle() const;
83  virtual bool hasFeature(QSparqlConnection::Feature f) const = 0;
84  virtual bool hasError() const = 0;
85  virtual void close() = 0;
86  virtual QSparqlResult* exec(const QString& query, QSparqlQuery::StatementType type, const QSparqlQueryOptions& options) = 0;
87 
88  virtual bool open(const QSparqlConnectionOptions& options = QSparqlConnectionOptions()) = 0;
89 
90  void addPrefix(const QString& prefix, const QUrl& uri);
91  QString prefixes() const;
92  void clearPrefixes();
93 
94 protected:
95  virtual void setOpen(bool o);
96  virtual void setOpenError(bool e);
97  virtual void setLastError(const QSparqlError& e);
98 
99 private:
100  Q_DISABLE_COPY(QSparqlDriver)
101  QSparqlDriverPrivate* d;
102 };
103 
104 QT_END_NAMESPACE
105 
106 QT_END_HEADER
107 
108 #endif // QSPARQLDRIVER_H
QSparqlConnection::clearPrefixes
void clearPrefixes()
Definition: qsparqlconnection.cpp:647
QSparqlConnection::hasFeature
bool hasFeature(Feature feature) const
Definition: qsparqlconnection.cpp:594
QSparqlError
The QSparqlError class provides SPARQL error information.
Definition: qsparqlerror.h:65
QSparqlConnectionOptions
The QSparqlConnectionOptions class encapsulates options given to QSparqlConnection....
Definition: qsparqlconnectionoptions.h:65
QSparqlConnection::lastError
QSparqlError lastError() const
Definition: qsparqlconnection.cpp:619
QSparqlConnection::Feature
Feature
Definition: qsparqlconnection.h:71
QSparqlConnection::addPrefix
void addPrefix(const QString &prefix, const QUrl &uri)
Definition: qsparqlconnection.cpp:638
QSparqlConnection
The QSparqlConnection class provides an interface for accessing an RDF store.
Definition: qsparqlconnection.h:68
QSparqlConnection::hasError
bool hasError() const
Definition: qsparqlconnection.cpp:610
QSparqlConnection::exec
QSparqlResult * exec(const QSparqlQuery &query)
Definition: qsparqlconnection.cpp:441
QSparqlResult
The QSparqlResult class provides an abstract interface for accessing the results of an executed QSpar...
Definition: qsparqlresult.h:65
QSparqlQueryOptions
Encapsulates query execution options given to QSparqlConnection::exec(const QSparqlQuery&,...
Definition: qsparqlqueryoptions.h:61
QSparqlQuery::StatementType
StatementType
Definition: qsparqlquery.h:67