|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * |
|
5 * This program is free software: you can redistribute it and/or modify |
|
6 * it under the terms of the GNU Lesser General Public License as published by |
|
7 * the Free Software Foundation, version 2.1 of the License. |
|
8 * |
|
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU Lesser General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU Lesser General Public License |
|
15 * along with this program. If not, |
|
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
17 * |
|
18 * Description: |
|
19 * |
|
20 */ |
|
21 |
|
22 #ifndef XQAIWREQUESTDRIVER_H |
|
23 #define XQAIWREQUESTDRIVER_H |
|
24 |
|
25 #include <f32file.h> |
|
26 #include <xqaiwglobal.h> |
|
27 |
|
28 #include <QObject> |
|
29 #include <qglobal.h> |
|
30 #include <QList> |
|
31 #include <QVariant> |
|
32 #include <QAction> |
|
33 #include <xqaiwinterfacedescriptor.h> |
|
34 #include <xqrequestinfo.h> |
|
35 |
|
36 class XQAiwRequestDriver : public QObject |
|
37 { |
|
38 Q_OBJECT |
|
39 |
|
40 public: |
|
41 |
|
42 XQAiwRequestDriver() : |
|
43 mEmbedded(false), |
|
44 mErrorCode(0), |
|
45 mSynchronous(false), |
|
46 mBackground(false) |
|
47 {}; |
|
48 |
|
49 virtual ~XQAiwRequestDriver() {}; |
|
50 |
|
51 virtual void setArguments(const QList<QVariant> &arguments) = 0; |
|
52 |
|
53 virtual bool send(QVariant& retValue) = 0; |
|
54 |
|
55 virtual QAction *createAction() = 0; |
|
56 |
|
57 virtual int lastError() const = 0; |
|
58 |
|
59 virtual const QString& lastErrorMessage() const = 0; |
|
60 |
|
61 virtual const XQAiwInterfaceDescriptor &descriptor() const = 0; |
|
62 |
|
63 virtual void setEmbedded(bool embedded) = 0; |
|
64 virtual bool isEmbedded() const = 0; |
|
65 |
|
66 virtual void setOperation(const QString &operation) = 0; |
|
67 virtual const QString &operation() const = 0; |
|
68 |
|
69 virtual void setSynchronous(bool synchronous)= 0; |
|
70 virtual bool isSynchronous() const = 0; |
|
71 |
|
72 virtual void setBackground(bool background )= 0; |
|
73 virtual bool isBackground() const = 0; |
|
74 |
|
75 virtual void setInfo(const XQRequestInfo &info) {mInfo = info;}; |
|
76 virtual XQRequestInfo info() const {return mInfo;}; |
|
77 |
|
78 signals: |
|
79 |
|
80 void requestOk(const QVariant& result); |
|
81 void requestError(int errorCode, const QString& errorMessage); |
|
82 |
|
83 protected: |
|
84 |
|
85 QString mOperation; |
|
86 bool mEmbedded; |
|
87 XQAiwInterfaceDescriptor mDescr; |
|
88 QString mErrorMsg; |
|
89 int mErrorCode; |
|
90 QList<QVariant> mArguments; |
|
91 bool mSynchronous; |
|
92 bool mBackground; |
|
93 XQRequestInfo mInfo; |
|
94 }; |
|
95 |
|
96 #endif /* XQAIWREQUESTDRIVER_H */ |