activityfw/storage/client/inc/afstorageclient.h
changeset 104 9b022b1f357c
child 107 b34d53f6acdf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/inc/afstorageclient.h	Tue Jul 06 14:37:10 2010 +0300
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef AFSTORAGECLIENT_H
+#define AFSTORAGECLIENT_H
+#include <QObject>
+#include <afasyncrequestobserver.h>
+
+#ifdef ACTIVITY_LIB
+    #define ACTIVITY_EXPORT Q_DECL_EXPORT
+#else
+    #define ACTIVITY_EXPORT Q_DECL_IMPORT
+#endif
+
+class AfStorageClientPrivate;
+class AfStorageEntry;
+
+class ACTIVITY_EXPORT AfStorageClient: public QObject,
+                                       public MAfAsyncRequestObserver
+{
+    Q_OBJECT
+public:
+    AfStorageClient(QObject* =0);
+
+    ~AfStorageClient();
+
+    int connect();
+
+    int addActivity(const AfStorageEntry &entry, const QPixmap& imageSource = QPixmap());
+
+    int updateActivity(const AfStorageEntry &entry, const QPixmap& imageSource = QPixmap());
+
+    int removeActivity(const AfStorageEntry &entry);
+
+    int removeApplicationActivities(const AfStorageEntry &entry);
+
+    int activities(QList<AfStorageEntry> &dst);
+
+    int applicationActivities(QList<AfStorageEntry> &dst, 
+                              const AfStorageEntry &entry);
+
+    int activityData(AfStorageEntry &dst, const AfStorageEntry &entry);
+
+    int waitActivity();
+    
+    int launchActivity(const AfStorageEntry &entry);
+    
+    int getThumbnail(QSize size, QString imagePath, void* userDdata);
+    
+    int notifyDataChange();
+
+private:
+    void asyncRequestCompleated(int, int, const QString &);
+
+    void asyncRequestCompleated(int, int, const QPixmap&, void*);
+
+    void asyncRequestCompleated(int result,
+                                int requestType);
+
+signals:
+    void activityRequested(const QString &activityId);
+
+    void thumbnailRequested(QPixmap thumbnailPixmap, void *userData);
+    
+    void dataChanged();
+    
+private:
+    /**
+     * Private client implementation.
+     * Own.
+     */
+    AfStorageClientPrivate *d_ptr;
+    
+    friend class AfStorageClientPrivate;
+};
+
+#endif //AFSTORAGECLIENT_H