activityfw/storage/client/inc/afstorageclient.h
changeset 107 b34d53f6acdf
parent 99 7aaf39b772ac
child 116 305818acdca4
equal deleted inserted replaced
106:e78d6e055a5b 107:b34d53f6acdf
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #ifndef AFSTORAGECLIENT_H
    18 #ifndef AFSTORAGECLIENT_H
    19 #define AFSTORAGECLIENT_H
    19 #define AFSTORAGECLIENT_H
    20 #include <QObject>
       
    21 #include <afasyncrequestobserver.h>
       
    22 
    20 
    23 #ifdef ACTIVITY_LIB
    21 #include "afasyncrequestobserver.h"
    24     #define ACTIVITY_EXPORT Q_DECL_EXPORT
       
    25 #else
       
    26     #define ACTIVITY_EXPORT Q_DECL_IMPORT
       
    27 #endif
       
    28 
    22 
    29 class AfStorageClientPrivate;
    23 class CAfStorageClientPrivate;
    30 class AfStorageEntry;
    24 class CAfEntry;
    31 
    25 
    32 class ACTIVITY_EXPORT AfStorageClient: public QObject,
    26 NONSHARABLE_CLASS(CAfStorageClient) : public CBase
    33                                        public MAfAsyncRequestObserver
       
    34 {
    27 {
    35     Q_OBJECT
       
    36 public:
    28 public:
    37     AfStorageClient(QObject* =0);
    29     IMPORT_C static CAfStorageClient *NewL(MAfAsyncRequestObserver &observer);
    38 
    30     IMPORT_C static CAfStorageClient *NewLC(MAfAsyncRequestObserver &observer);
    39     ~AfStorageClient();
    31     IMPORT_C virtual ~CAfStorageClient();
    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 
    32 
    66 private:
    33 private:
    67     void asyncRequestCompleated(int, int, const QString &);
    34     CAfStorageClient();
       
    35     void ConstructL(MAfAsyncRequestObserver &observer);
       
    36     
       
    37 public:    
       
    38     IMPORT_C int addActivity(const CAfEntry &entry, TInt imageHandle);
       
    39     IMPORT_C int updateActivity(const CAfEntry &entry, TInt imageHandle);
       
    40     IMPORT_C int saveActivity(const CAfEntry &entry, TInt imageHandle);
       
    41     IMPORT_C int removeActivity(const CAfEntry &entry);
       
    42     IMPORT_C int removeApplicationActivities(const CAfEntry &entry);
       
    43     IMPORT_C int activities(RPointerArray<CAfEntry> &dst);
       
    44     IMPORT_C int applicationActivities(RPointerArray<CAfEntry> &dst, const CAfEntry &entry);
       
    45     IMPORT_C int activityData(CAfEntry *&dst, const CAfEntry &entry);
       
    46     IMPORT_C int waitActivity();
       
    47     IMPORT_C int launchActivity(const CAfEntry &entry);
       
    48     IMPORT_C int getThumbnail(const TSize &size, const TDesC &imagePath, void *userData);
       
    49     IMPORT_C int notifyDataChange();
    68 
    50 
    69     void asyncRequestCompleated(int, int, const QPixmap&, void*);
    51 private: 
    70 
    52     CAfStorageClientPrivate *d_ptr;
    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     
    53     
    79     void dataChanged();
       
    80     
       
    81 private:
       
    82     /**
       
    83      * Private client implementation.
       
    84      * Own.
       
    85      */
       
    86     AfStorageClientPrivate *d_ptr;
       
    87     
       
    88     friend class AfStorageClientPrivate;
       
    89 };
    54 };
    90 
    55 
    91 #endif //AFSTORAGECLIENT_H
    56 #endif //AFSTORAGECLIENT_H