|
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 XQSERVICEABSTRACTSERVICE_H |
|
23 #define XQSERVICEABSTRACTSERVICE_H |
|
24 |
|
25 // THIS IS A STUB CLASS FOR WIN32 ENVIRONMENT! |
|
26 // It is only meant to compile, not to actually do anything |
|
27 |
|
28 #include <QObject> |
|
29 #include <QString> |
|
30 #include <QVariant> |
|
31 #include <QSet> |
|
32 #include <QStringList> |
|
33 |
|
34 class XQRequestInfo |
|
35 { |
|
36 public: |
|
37 |
|
38 bool isValid() const { return true; } |
|
39 |
|
40 void setEmbedded(bool) {} |
|
41 bool isEmbedded() const { return false; } |
|
42 void setBackground(bool) {} |
|
43 bool isBackground() const { return false; } |
|
44 bool isSynchronous() const { return false; } |
|
45 void setForeground(bool) {} |
|
46 bool isForeground() const { return true; } |
|
47 |
|
48 quint32 clientSecureId() const { return VID_DEFAULT; } |
|
49 quint32 clientVendorId() const { return VID_DEFAULT; } |
|
50 QSet<int> clientCapabilities() const { return QSet<int>(); } |
|
51 int id() const { return -1; } |
|
52 |
|
53 void setInfo(const QString&, const QVariant&) {} |
|
54 QVariant info(const QString&) const { return QVariant(); } |
|
55 QStringList infoKeys() const { return QStringList(); } |
|
56 |
|
57 }; |
|
58 |
|
59 class XQServiceProvider : public QObject |
|
60 { |
|
61 Q_OBJECT |
|
62 public: |
|
63 explicit XQServiceProvider( const QString& service, QObject* parent = 0 ); |
|
64 ~XQServiceProvider(); |
|
65 |
|
66 void SetPlugin(QObject*) {} |
|
67 |
|
68 Q_SIGNALS: |
|
69 void returnValueDelivered(); |
|
70 void clientDisconnected(); |
|
71 |
|
72 protected: |
|
73 void publishAll() {} |
|
74 int setCurrentRequestAsync() { return -1; } |
|
75 bool completeRequest(int, const QVariant&) { return true; } |
|
76 XQRequestInfo requestInfo() const { return XQRequestInfo(); } |
|
77 |
|
78 template <typename T> |
|
79 inline bool completeRequest(int index, const T& retValue) |
|
80 { |
|
81 QVariant retValueVariant; |
|
82 retValueVariant.setValue(retValue); |
|
83 return completeRequest(index, retValueVariant); |
|
84 } |
|
85 |
|
86 }; |
|
87 |
|
88 #endif |