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 #ifndef HSACTIVITYDBASYNCREQUESTPRIVATE_H |
|
18 #define HSACTIVITYDBASYNCREQUESTPRIVATE_H |
|
19 #include <e32base.h> |
|
20 #include <QVariant> |
|
21 #include <QPixmap> |
|
22 #include <hsactivitydbasyncrequestobserver.h> |
|
23 #include <activitycmd.h> |
|
24 |
|
25 class HsActivityDbClientPrivate; |
|
26 |
|
27 /** |
|
28 * Class is responsible for async. request handling |
|
29 */ |
|
30 class HsActivityDbAsyncRequestPrivate : public CActive |
|
31 |
|
32 { |
|
33 public: |
|
34 |
|
35 enum TAsyncRequest{ |
|
36 EWaitActivity = WaitActivity, |
|
37 EWaitGetThumbnail = GetThumbnail, |
|
38 ENotifyDataChange = NotifyChange |
|
39 }; |
|
40 |
|
41 private: |
|
42 static HsActivityDbAsyncRequestPrivate* |
|
43 NewLC(HsActivityDbAsyncRequestObserver &, |
|
44 HsActivityDbClientPrivate &, |
|
45 TAsyncRequest, |
|
46 void* userData = 0); |
|
47 |
|
48 public: |
|
49 |
|
50 static void waitActivityLD(HsActivityDbAsyncRequestObserver &, |
|
51 HsActivityDbClientPrivate &, |
|
52 const QVariantHash &); |
|
53 |
|
54 static void notifyDataChangeLD(HsActivityDbAsyncRequestObserver &, |
|
55 HsActivityDbClientPrivate &); |
|
56 |
|
57 static void getThumbnailLD(HsActivityDbAsyncRequestObserver &, |
|
58 HsActivityDbClientPrivate &, |
|
59 QSize, |
|
60 const QString&, |
|
61 const QString&, |
|
62 void *); |
|
63 |
|
64 |
|
65 /** |
|
66 * Destructor |
|
67 */ |
|
68 ~HsActivityDbAsyncRequestPrivate(); |
|
69 |
|
70 private: |
|
71 /** |
|
72 * Function create subscription to current ativity changes |
|
73 * @param condition - activity filetering rules |
|
74 */ |
|
75 void waitActivity(const QVariantHash &condition); |
|
76 |
|
77 /** |
|
78 */ |
|
79 void getThumbnail(QSize size, QString imagePath, QString mimeType); |
|
80 |
|
81 void notifyDataChange(); |
|
82 protected: |
|
83 /** |
|
84 * Interface implementation. |
|
85 * @see void CActive::DoCancel() |
|
86 */ |
|
87 void DoCancel(); |
|
88 |
|
89 /** |
|
90 * Interface implementation. |
|
91 * @see void CActive::DoCancel() |
|
92 */ |
|
93 void RunL(); |
|
94 private: |
|
95 /** |
|
96 * Constructor |
|
97 */ |
|
98 HsActivityDbAsyncRequestPrivate(HsActivityDbAsyncRequestObserver &, |
|
99 HsActivityDbClientPrivate &, |
|
100 TAsyncRequest, |
|
101 void* userData); |
|
102 private: |
|
103 HsActivityDbAsyncRequestObserver &mObserver; |
|
104 HsActivityDbClientPrivate &mSession; |
|
105 const TAsyncRequest mRequestType; |
|
106 TPckgBuf<int> mTaskId; |
|
107 TPckgBuf<int> mDataSize; |
|
108 TPckgBuf<int> mBitmapId; |
|
109 HBufC* mBitmapPath; |
|
110 HBufC8* mBitmapMimeType; |
|
111 RBuf8 mDataBuf; |
|
112 void *const mUserData; |
|
113 }; |
|
114 #endif // HSACTIVITYDBCLIENTPRIVATE_H |
|