Soprano  2.9.0
asyncresult.h
Go to the documentation of this file.
1 /*
2  * This file is part of Soprano Project.
3  *
4  * Copyright (C) 2008-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 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_ASYNC_RESULT_H_
23 #define _SOPRANO_ASYNC_RESULT_H_
24 
25 #include <QtCore/QObject>
26 #include <QtCore/QVariant>
27 
28 #include "error.h"
29 #include "soprano_export.h"
30 
31 
32 namespace Soprano {
33 
34  class StatementIterator;
35  class Node;
36  class NodeIterator;
37  class QueryResultIterator;
38 
39  namespace Util {
40 
41  class AsyncModel;
42 
53  {
54  Q_OBJECT
55 
56  Q_SIGNALS:
63  void resultReady( Soprano::Util::AsyncResult* );
64 
65  public:
71  static AsyncResult* createResult();
72 
73  ~AsyncResult();
74 
91  QVariant value() const { return m_result; }
92 
104  Error::ErrorCode errorCode() const;
105 
114  StatementIterator statementIterator() const;
115 
124  NodeIterator nodeIterator() const;
125 
134  QueryResultIterator queryResultIterator() const;
135 
144  Node node() const;
145 
150  void setResult( const QVariant& result, const Error::Error& error );
151 
152  private Q_SLOTS:
153  void slotResultReady();
154 
155  private:
156  AsyncResult();
157 
158  QVariant m_result;
159 
160  friend class AsyncModel;
161  };
162  }
163 }
164 
165 #endif