libqutim  0.3.1.0
abstractsearchrequest.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** qutIM - instant messenger
4 **
5 ** Copyright © 2011 Ruslan Nigmatullin <euroelessar@yandex.ru>
6 **
7 *****************************************************************************
8 **
9 ** $QUTIM_BEGIN_LICENSE$
10 ** This program is free software: you can redistribute it and/or modify
11 ** it under the terms of the GNU General Public License as published by
12 ** the Free Software Foundation, either version 3 of the License, or
13 ** (at your option) any later version.
14 **
15 ** This program is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 ** See the GNU General Public License for more details.
19 **
20 ** You should have received a copy of the GNU General Public License
21 ** along with this program. If not, see http://www.gnu.org/licenses/.
22 ** $QUTIM_END_LICENSE$
23 **
24 ****************************************************************************/
25 #ifndef ABSTRACTSEARCHREQUEST_H
26 #define ABSTRACTSEARCHREQUEST_H
27 
28 #include <QVariant>
29 #include <QSharedData>
30 #include "localizedstring.h"
31 #include "dataforms.h"
32 
33 namespace qutim_sdk_0_3
34 {
35  class AbstractSearchFactoryPrivate;
36 
37  class LIBQUTIM_EXPORT AbstractSearchRequest : public QObject
38  {
39  Q_OBJECT
40  Q_DISABLE_COPY(AbstractSearchRequest)
41  public:
43  virtual ~AbstractSearchRequest();
44  virtual DataItem fields() const = 0;
45  virtual QSet<QString> services() const;
46  virtual void setService(const QString &service);
47  virtual void start(const DataItem &fields) = 0;
48  virtual void cancel() = 0;
49  virtual int actionCount() const = 0;
50  virtual QVariant actionData(int index, int role = Qt::DisplayRole) = 0;
51  virtual void actionActivated(int actionIndex, int row) = 0;
52  virtual int columnCount() const = 0;
53  virtual QVariant headerData(int column, int role = Qt::DisplayRole) = 0;
54  virtual int rowCount() const = 0;
55  virtual QVariant data(int row, int column, int role = Qt::DisplayRole) = 0;
56  signals:
57  void done(bool ok);
58  void rowAboutToBeAdded(int row);
59  void rowAdded(int row);
60  void fieldsUpdated();
61  void servicesUpdated();
62  void actionsUpdated();
63  };
64 
65  class LIBQUTIM_EXPORT AbstractSearchFactory : public QObject
66  {
67  Q_OBJECT
68  Q_DISABLE_COPY(AbstractSearchFactory )
69  Q_DECLARE_PRIVATE(AbstractSearchFactory )
70  public:
72  virtual ~AbstractSearchFactory();
73  virtual QStringList requestList() const = 0;
74  virtual QVariant data(const QString &request, int role = Qt::DisplayRole);
75  virtual AbstractSearchRequest *request(const QString &name) const = 0;
76  signals:
77  void requestAdded(const QString &request);
78  void requestRemoved(const QString &request);
79  void requestUpdated(const QString &request);
80  protected:
81  AbstractSearchFactory(AbstractSearchFactoryPrivate *d);
82  QScopedPointer<AbstractSearchFactoryPrivate> d_ptr;
83  };
84 
85 } // namespace qutim_sdk_0_3
86 
87 #endif // ABSTRACTSEARCHREQUEST_H
88 

Generated by Doxygen