• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

/home/builduser/trunk/pkgs/soprano/BUILD/soprano-2.4.63/soprano/util/asyncquery.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of Soprano Project.
00003  *
00004  * Copyright (C) 2009 Sebastian Trueg <trueg@kde.org>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with this library; see the file COPYING.LIB.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
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

Generated on Wed Sep 8 2010 14:46:06 for Soprano by  doxygen 1.7.1