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 XQAIWSERVICEDRIVER_H |
|
23 #define XQAIWSERVICEDRIVER_H |
|
24 |
|
25 #include <xqaiwglobal.h> |
|
26 |
|
27 #include <QObject> |
|
28 #include <qglobal.h> |
|
29 #include <qtranslator.h> |
|
30 |
|
31 #include <QList> |
|
32 #include <QVariant> |
|
33 #include <QAction> |
|
34 #include <xqaiwinterfacedescriptor.h> |
|
35 #include "xqaiwrequestdriver.h" |
|
36 |
|
37 class XQServiceRequest; |
|
38 |
|
39 class XQAiwServiceDriver : public XQAiwRequestDriver |
|
40 { |
|
41 Q_OBJECT |
|
42 |
|
43 public: |
|
44 |
|
45 XQAiwServiceDriver(const XQAiwInterfaceDescriptor& descriptor, const QString &operation); |
|
46 |
|
47 virtual ~XQAiwServiceDriver(); |
|
48 |
|
49 void setArguments(const QList<QVariant> &arguments); |
|
50 |
|
51 bool send(QVariant& retValue); |
|
52 |
|
53 QAction *createAction(); |
|
54 |
|
55 int lastError() const; |
|
56 |
|
57 const QString& lastErrorMessage() const; |
|
58 |
|
59 const XQAiwInterfaceDescriptor &descriptor() const; |
|
60 |
|
61 void setEmbedded(bool embedded); |
|
62 bool isEmbedded() const; |
|
63 |
|
64 void setOperation(const QString &operation); |
|
65 const QString &operation() const; |
|
66 |
|
67 void setSynchronous(bool synchronous); |
|
68 bool isSynchronous() const; |
|
69 |
|
70 void setBackground(bool background ); |
|
71 bool isBackground() const; |
|
72 |
|
73 void setInfo(const XQRequestInfo &info); |
|
74 XQRequestInfo info() const; |
|
75 |
|
76 private slots: |
|
77 |
|
78 void handleAsyncResponse(const QVariant& value); |
|
79 void handleAsyncError(int err); |
|
80 |
|
81 private: |
|
82 bool installTranslator(); |
|
83 void removeTranslator(); |
|
84 QString makeFileName(const QString &textFile) const; |
|
85 |
|
86 private: |
|
87 |
|
88 XQServiceRequest * currentRequest; |
|
89 bool completeSignalConnected; |
|
90 bool errorSignalConnected; |
|
91 QTranslator translator; |
|
92 QString lastLang; |
|
93 }; |
|
94 |
|
95 #endif /* XQAIWSERVICEDRIVER_H */ |
|