|
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 addActivity(const CAfEntry &entry, TInt imageHandle); |
|
37 int updateActivity(const CAfEntry &entry, TInt imageHandle); |
|
38 int saveActivity(const CAfEntry &entry, TInt imageHandle); |
|
39 int removeActivity(const CAfEntry &entry); |
|
40 int removeApplicationActivities(const CAfEntry &entry); |
|
41 int activities(RPointerArray<CAfEntry> &dst); |
|
42 int applicationActivities(RPointerArray<CAfEntry> &dst, const CAfEntry &entry); |
|
43 int activityData(CAfEntry *&dst, const CAfEntry &entry); |
|
44 int waitActivity(); |
|
45 int launchActivity(const CAfEntry &entry); |
|
46 int getThumbnail(const TSize &size, const TDesC &imagePath, void *userData); |
|
47 int notifyDataChange(); |
|
48 |
|
49 private: |
|
50 MAfAsyncRequestObserver &mObserver; |
|
51 |
|
52 private: |
|
53 void updateLastEntry(const CAfEntry &entry); |
|
54 |
|
55 public: |
|
56 void invokeWaitActivityCallback(int result, const TDesC8 &data); |
|
57 void invokeGetThumbnailCallback(int result, int bitmapHandle, void *userData); |
|
58 void invokeDataChangeCallback(int result); |
|
59 |
|
60 static void clearLastCallInfo(); |
|
61 |
|
62 public: |
|
63 enum LastMethodCalled { |
|
64 NoCall, |
|
65 AddActivityMethod, |
|
66 UpdateActivityMethod, |
|
67 SaveActivityMethod, |
|
68 RemoveActivityMethod, |
|
69 RemoveApplicationActivitiesMethod, |
|
70 ActivitiesMethod, |
|
71 ApplicationActivitiesMethod, |
|
72 ActivityDataMethod, |
|
73 WaitActivityMethod, |
|
74 LaunchActivityMethod, |
|
75 GetThumbnailMethod, |
|
76 NotifyDataChangeMethod, |
|
77 }; |
|
78 |
|
79 public: |
|
80 static TInt constructorError; |
|
81 static TInt expectedReturnCode; |
|
82 |
|
83 static CAfEntry *lastCallEntry; |
|
84 static TInt lastCallImageHandle; |
|
85 static TSize lastCallThumbnailSize; |
|
86 static HBufC *lastCallThumbnailPath; |
|
87 static void *lastCallUserData; |
|
88 |
|
89 static LastMethodCalled lastMethodCalled; |
|
90 }; |
|
91 |
|
92 #endif //AFSTORAGECLIENT_H |