|
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 XQAIWFILEDRIVER_H |
|
23 #define XQAIWFILEDRIVER_H |
|
24 |
|
25 #include <xqaiwglobal.h> |
|
26 |
|
27 #include <QObject> |
|
28 #include <qglobal.h> |
|
29 |
|
30 #include <QList> |
|
31 #include <QVariant> |
|
32 #include <QAction> |
|
33 #include <QFile> |
|
34 #include <xqaiwinterfacedescriptor.h> |
|
35 #include "xqaiwrequestdriver.h" |
|
36 #include "xqaiwutils.h" |
|
37 |
|
38 class XQServiceRequest; |
|
39 |
|
40 class XQAiwFileDriver : public XQAiwRequestDriver |
|
41 { |
|
42 Q_OBJECT |
|
43 |
|
44 public: |
|
45 |
|
46 XQAiwFileDriver(const QFile &file, const XQAiwInterfaceDescriptor& descriptor, const QString &operation); |
|
47 XQAiwFileDriver(const XQSharableFile &file, const XQAiwInterfaceDescriptor& descriptor, const QString &operation); |
|
48 |
|
49 virtual ~XQAiwFileDriver(); |
|
50 |
|
51 void setArguments(const QList<QVariant> &arguments); |
|
52 |
|
53 bool send(QVariant& retValue); |
|
54 |
|
55 QAction *createAction(); |
|
56 |
|
57 int lastError() const; |
|
58 |
|
59 const QString& lastErrorMessage() const; |
|
60 |
|
61 const XQAiwInterfaceDescriptor &descriptor() const; |
|
62 |
|
63 void setEmbedded(bool embedded); |
|
64 bool isEmbedded() const; |
|
65 |
|
66 void setOperation(const QString &operation); |
|
67 const QString &operation() const; |
|
68 |
|
69 void setSynchronous(bool synchronous); |
|
70 bool isSynchronous() const; |
|
71 |
|
72 void setBackground(bool background ); |
|
73 bool isBackground() const; |
|
74 |
|
75 private slots: |
|
76 |
|
77 void handleAsyncResponse(const QVariant& value); |
|
78 void handleAsyncError(int err); |
|
79 |
|
80 private: |
|
81 QVariant mFile; |
|
82 XQAiwUtils * mUtilities; |
|
83 }; |
|
84 |
|
85 #endif /* XQAIWFILEDRIVER_H */ |