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: Unit tests for PhoneNoteController. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef T_XQSERVICEREQUEST_H |
|
19 #define T_XQSERVICEREQUEST_H |
|
20 |
|
21 #include <QObject> |
|
22 #include <QVariant> |
|
23 #include <QtTest/qtestcase.h> |
|
24 |
|
25 extern QString mService; |
|
26 extern QString mMessage; |
|
27 extern bool mSend; |
|
28 extern QList<QVariant> mList; |
|
29 |
|
30 |
|
31 /*! |
|
32 \class XQServiceRequest |
|
33 */ |
|
34 class XQServiceRequest : public QObject |
|
35 { |
|
36 Q_OBJECT |
|
37 |
|
38 public: |
|
39 |
|
40 XQServiceRequest(const QString &service, |
|
41 const QString &message, |
|
42 const bool &synchronous = true) |
|
43 { |
|
44 mService = service; |
|
45 mMessage = message; |
|
46 } |
|
47 |
|
48 ~XQServiceRequest() |
|
49 { |
|
50 } |
|
51 |
|
52 bool send(QVariant &retValue) |
|
53 { |
|
54 mSend = true; |
|
55 return mSend; |
|
56 } |
|
57 |
|
58 template <typename T> |
|
59 inline bool send(T& retValue) |
|
60 { |
|
61 QVariant retData; |
|
62 bool ret=send(retData); |
|
63 retValue = qVariantValue<T>(retData); |
|
64 return ret; |
|
65 } |
|
66 |
|
67 void setArguments(QList<QVariant> list) |
|
68 { |
|
69 mList = list; |
|
70 } |
|
71 |
|
72 Q_SIGNALS: |
|
73 |
|
74 void requestCompleted(const QVariant &value); |
|
75 |
|
76 }; |
|
77 |
|
78 #endif //T_XQSERVICEREQUEST_H |
|