00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _SOPRANO_UTIL_ASYNC_QUERY_H_
00023 #define _SOPRANO_UTIL_ASYNC_QUERY_H_
00024
00025 #include <QtCore/QObject>
00026 #include "error.h"
00027 #include "sopranotypes.h"
00028 #include "soprano_export.h"
00029
00030 namespace Soprano {
00031
00032 class Statement;
00033 class BindingSet;
00034 class Node;
00035 class Model;
00036
00037 namespace Util {
00065 class SOPRANO_EXPORT AsyncQuery : public QObject, public Error::ErrorCache
00066 {
00067 Q_OBJECT
00068
00069 public:
00077 ~AsyncQuery();
00078
00080
00084 Statement currentStatement() const;
00085
00090 BindingSet currentBindings() const;
00091
00099 bool boolValue() const;
00101
00103
00113 Node binding( const QString &name ) const;
00114
00125 Node binding( int offset ) const;
00126
00134 int bindingCount() const;
00135
00141 QStringList bindingNames() const;
00143
00145
00151 bool isGraph() const;
00152
00159 bool isBinding() const;
00160
00170 bool isBool() const;
00172
00173 public Q_SLOTS:
00181 bool next();
00182
00190 void close();
00191
00192 Q_SIGNALS:
00199 void nextReady( Soprano::Util::AsyncQuery* query );
00200
00212 void finished( Soprano::Util::AsyncQuery* query );
00213
00214 public:
00230 static AsyncQuery* executeQuery( Soprano::Model* model,
00231 const QString& query,
00232 Query::QueryLanguage language,
00233 const QString& userQueryLanguage = QString() );
00234
00235 private:
00236 AsyncQuery();
00237
00238 class Private;
00239 Private* const d;
00240
00241 Q_PRIVATE_SLOT( d, void _s_finished() )
00242 Q_PRIVATE_SLOT( d, void _s_emitNextReady() )
00243 };
00244 }
00245 }
00246
00247 #endif