|
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 #include <QObject> |
|
21 #include <afasyncrequestobserver.h> |
|
22 |
|
23 #ifdef ACTIVITY_LIB |
|
24 #define ACTIVITY_EXPORT Q_DECL_EXPORT |
|
25 #else |
|
26 #define ACTIVITY_EXPORT Q_DECL_IMPORT |
|
27 #endif |
|
28 |
|
29 class AfStorageClientPrivate; |
|
30 class AfStorageEntry; |
|
31 |
|
32 class ACTIVITY_EXPORT AfStorageClient: public QObject, |
|
33 public MAfAsyncRequestObserver |
|
34 { |
|
35 Q_OBJECT |
|
36 public: |
|
37 AfStorageClient(QObject* =0); |
|
38 |
|
39 ~AfStorageClient(); |
|
40 |
|
41 int connect(); |
|
42 |
|
43 int addActivity(const AfStorageEntry &entry, const QPixmap& imageSource = QPixmap()); |
|
44 |
|
45 int updateActivity(const AfStorageEntry &entry, const QPixmap& imageSource = QPixmap()); |
|
46 |
|
47 int removeActivity(const AfStorageEntry &entry); |
|
48 |
|
49 int removeApplicationActivities(const AfStorageEntry &entry); |
|
50 |
|
51 int activities(QList<AfStorageEntry> &dst); |
|
52 |
|
53 int applicationActivities(QList<AfStorageEntry> &dst, |
|
54 const AfStorageEntry &entry); |
|
55 |
|
56 int activityData(AfStorageEntry &dst, const AfStorageEntry &entry); |
|
57 |
|
58 int waitActivity(); |
|
59 |
|
60 int launchActivity(const AfStorageEntry &entry); |
|
61 |
|
62 int getThumbnail(QSize size, QString imagePath, void* userDdata); |
|
63 |
|
64 int notifyDataChange(); |
|
65 |
|
66 private: |
|
67 void asyncRequestCompleated(int, int, const QString &); |
|
68 |
|
69 void asyncRequestCompleated(int, int, const QPixmap&, void*); |
|
70 |
|
71 void asyncRequestCompleated(int result, |
|
72 int requestType); |
|
73 |
|
74 signals: |
|
75 void activityRequested(const QString &activityId); |
|
76 |
|
77 void thumbnailRequested(QPixmap thumbnailPixmap, void *userData); |
|
78 |
|
79 void dataChanged(); |
|
80 |
|
81 private: |
|
82 /** |
|
83 * Private client implementation. |
|
84 * Own. |
|
85 */ |
|
86 AfStorageClientPrivate *d_ptr; |
|
87 |
|
88 friend class AfStorageClientPrivate; |
|
89 }; |
|
90 |
|
91 #endif //AFSTORAGECLIENT_H |