|
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 AFSTORAGECLIENT_H |
|
19 #define AFSTORAGECLIENT_H |
|
20 |
|
21 #include <e32base.h> |
|
22 |
|
23 class CAfEntry; |
|
24 class MAfAsyncRequestObserver; |
|
25 |
|
26 class CAfStorageClient : public CBase |
|
27 { |
|
28 public: |
|
29 static CAfStorageClient *NewL(MAfAsyncRequestObserver &observer); |
|
30 virtual ~CAfStorageClient(); |
|
31 |
|
32 private: |
|
33 CAfStorageClient(MAfAsyncRequestObserver &observer); |
|
34 |
|
35 public: |
|
36 int saveActivity(const CAfEntry &entry, TInt imageHandle); |
|
37 int removeActivity(const CAfEntry &entry); |
|
38 int removeApplicationActivities(const CAfEntry &entry); |
|
39 int activities(RPointerArray<CAfEntry> &dst, int limit = 0); |
|
40 int applicationActivities(RPointerArray<CAfEntry> &dst, const CAfEntry &entry); |
|
41 int activityData(CAfEntry *&dst, const CAfEntry &entry); |
|
42 int waitActivity(); |
|
43 int launchActivity(const CAfEntry &entry); |
|
44 int getThumbnail(const TDesC &imagePath, void *userData); |
|
45 int notifyDataChange(); |
|
46 |
|
47 private: |
|
48 MAfAsyncRequestObserver &mObserver; |
|
49 |
|
50 private: |
|
51 void updateLastEntry(const CAfEntry &entry); |
|
52 |
|
53 public: |
|
54 void invokeWaitActivityCallback(int result, const TDesC8 &data); |
|
55 void invokeGetThumbnailCallback(int result, int bitmapHandle, void *userData); |
|
56 void invokeDataChangeCallback(int result); |
|
57 |
|
58 static void clearLastCallInfo(); |
|
59 |
|
60 public: |
|
61 enum LastMethodCalled { |
|
62 NoCall, |
|
63 SaveActivityMethod, |
|
64 RemoveActivityMethod, |
|
65 RemoveApplicationActivitiesMethod, |
|
66 ActivitiesMethod, |
|
67 ApplicationActivitiesMethod, |
|
68 ActivityDataMethod, |
|
69 WaitActivityMethod, |
|
70 LaunchActivityMethod, |
|
71 GetThumbnailMethod, |
|
72 NotifyDataChangeMethod, |
|
73 }; |
|
74 |
|
75 public: |
|
76 static TInt constructorError; |
|
77 static TInt expectedReturnCode; |
|
78 |
|
79 static CAfEntry *lastCallEntry; |
|
80 static TInt lastCallImageHandle; |
|
81 static TSize lastCallThumbnailSize; |
|
82 static HBufC *lastCallThumbnailPath; |
|
83 static void *lastCallUserData; |
|
84 |
|
85 static LastMethodCalled lastMethodCalled; |
|
86 }; |
|
87 |
|
88 #endif //AFSTORAGECLIENT_H |