|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef XQSERVICEREQUEST_H |
|
19 #define XQSERVICEREQUEST_H |
|
20 |
|
21 #include <QVariant> |
|
22 #include <xqrequestinfo.h> |
|
23 #include <QObject> |
|
24 |
|
25 class XQServiceRequest : public QObject |
|
26 { |
|
27 Q_OBJECT |
|
28 public: |
|
29 |
|
30 XQServiceRequest(); |
|
31 XQServiceRequest(const QString& fullServiceName, const QString& message, const bool& synchronous = true); |
|
32 virtual ~XQServiceRequest(); |
|
33 |
|
34 bool send(QVariant& retValue) ; |
|
35 |
|
36 void setSynchronous(const bool &synchronous); |
|
37 bool isSynchronous() const; |
|
38 |
|
39 QString service() const; |
|
40 QString message() const; |
|
41 |
|
42 void setArguments(const QList<QVariant> &arguments); |
|
43 |
|
44 template<typename T> |
|
45 inline XQServiceRequest &operator<< (const T &var) |
|
46 { |
|
47 QVariant v = qVariantFromValue(var); |
|
48 addArg(v); |
|
49 return *this; |
|
50 } |
|
51 |
|
52 void setInfo(const XQRequestInfo &info); |
|
53 XQRequestInfo info() const; |
|
54 |
|
55 signals: |
|
56 void requestCompleted(const QVariant& value) ; |
|
57 void requestError(int err); |
|
58 |
|
59 private: |
|
60 void addArg(const QVariant& v); |
|
61 }; |
|
62 |
|
63 |
|
64 #endif |