Soprano  2.7.6
asyncquery.h
Go to the documentation of this file.
1 /*
2  * This file is part of Soprano Project.
3  *
4  * Copyright (C) 2009 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 Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 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  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser 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_UTIL_ASYNC_QUERY_H_
23 #define _SOPRANO_UTIL_ASYNC_QUERY_H_
24 
25 #include <QtCore/QObject>
26 #include "error.h"
27 #include "sopranotypes.h"
28 #include "soprano_export.h"
29 
30 namespace Soprano {
31 
32  class Statement;
33  class BindingSet;
34  class Node;
35  class Model;
36 
37  namespace Util {
77  {
78  Q_OBJECT
79 
80  public:
88  ~AsyncQuery();
89 
91 
95  Statement currentStatement() const;
96 
101  BindingSet currentBindings() const;
102 
110  bool boolValue() const;
112 
114 
124  Node binding( const QString &name ) const;
125 
136  Node binding( int offset ) const;
137 
145  int bindingCount() const;
146 
152  QStringList bindingNames() const;
154 
156 
162  bool isGraph() const;
163 
170  bool isBinding() const;
171 
181  bool isBool() const;
183 
184  public Q_SLOTS:
193  bool next();
194 
202  void close();
203 
204  Q_SIGNALS:
213  void nextReady( Soprano::Util::AsyncQuery* query );
214 
226  void finished( Soprano::Util::AsyncQuery* query );
227 
228  public:
244  static AsyncQuery* executeQuery( Soprano::Model* model,
245  const QString& query,
247  const QString& userQueryLanguage = QString() );
248 
249  private:
250  AsyncQuery();
251 
252  class Private;
253  Private* const d;
254 
255  Q_PRIVATE_SLOT( d, void _s_finished() )
256  Q_PRIVATE_SLOT( d, void _s_emitNextReady() )
257  };
258  }
259 }
260 
261 #endif