activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbclient_p.h
changeset 66 32469d7d46ff
parent 61 8e5041d13c84
child 73 4bc7b118b3df
equal deleted inserted replaced
61:8e5041d13c84 66:32469d7d46ff
    21 #include <e32base.h>
    21 #include <e32base.h>
    22 #include <hsactivitydbasyncrequestobserver.h>
    22 #include <hsactivitydbasyncrequestobserver.h>
    23 
    23 
    24 class HsActivityDbAsyncRequestPrivate;
    24 class HsActivityDbAsyncRequestPrivate;
    25 /**
    25 /**
    26  * Class implemets HsActivityDbClientInterface and is responsible for 
    26  * Class implemets HsActivityDbClientInterface and is responsible for
    27  * activity data management on S60 enviroment.
    27  * activity data management on S60 enviroment.
    28  */
    28  */
    29 class HsActivityDbClientPrivate : protected RSessionBase,
    29 class HsActivityDbClientPrivate : protected RSessionBase,
    30                                   public HsActivityDbClientInterface
    30                                   public HsActivityDbClientInterface
    31 {
    31 {
    32 public:
    32 public:
    33     /**
    33     /**
    34      * Constructor
    34      * Constructor
    35      */
    35      */
    36     HsActivityDbClientPrivate(HsActivityDbAsyncRequestObserver&);
    36     HsActivityDbClientPrivate(HsActivityDbAsyncRequestObserver &);
    37     
    37 
    38     /**
    38     /**
    39      * Destructor
    39      * Destructor
    40      */
    40      */
    41     ~HsActivityDbClientPrivate();
    41     ~HsActivityDbClientPrivate();
    42     
    42 
    43     /**
    43     /**
    44      * Function establish connection to activity server
    44      * Function establish connection to activity server
    45      * @return 0 on succees, error code otherwise
    45      * @return 0 on succees, error code otherwise
    46      */
    46      */
    47     int connect();
    47     int connect();
    48     
    48 
    49     /**
    49     /**
    50      * Interface implementation.
    50      * Interface implementation.
    51      * @see int HsActivityDbClientInterface::addActivity(const QVariantHash &)
    51      * @see int HsActivityDbClientInterface::addActivity(const QVariantHash &)
    52      */
    52      */
    53     int addActivity(const QVariantHash &);
    53     int addActivity(const QVariantHash &);
    54     
    54 
    55     /**
    55     /**
    56      * Interface implementation.
    56      * Interface implementation.
    57      * @see int HsActivityDbClientInterface::updateActivity(const QVariantHash &)
    57      * @see int HsActivityDbClientInterface::updateActivity(const QVariantHash &)
    58      */
    58      */
    59     int updateActivity(const QVariantHash &);
    59     int updateActivity(const QVariantHash &);
    60     
    60 
    61     /**
    61     /**
    62      * Interface implementation.
    62      * Interface implementation.
    63      * @see int HsActivityDbClientInterface::removeActivity(const QVariantHash &)
    63      * @see int HsActivityDbClientInterface::removeActivity(const QVariantHash &)
    64      */
    64      */
    65     int removeActivity(const QVariantHash &activity);
    65     int removeActivity(const QVariantHash &activity);
    66     
    66 
    67     /**
    67     /**
    68      * Interface implementation.
    68      * Interface implementation.
    69      * @see int HsActivityDbClientInterface::removeApplicationActivities(const QVariantHash &)
    69      * @see int HsActivityDbClientInterface::removeApplicationActivities(const QVariantHash &)
    70     */
    70     */
    71     int removeApplicationActivities(const QVariantHash &activity);
    71     int removeApplicationActivities(const QVariantHash &activity);
    72     
    72 
    73     /**
    73     /**
    74      * Interface implementation.
    74      * Interface implementation.
    75      * @see int HsActivityDbClientInterface::requestedActivityName(QString &, const QVariantHash &);
    75      * @see int HsActivityDbClientInterface::requestedActivityName(QString &, const QVariantHash &);
    76      */
    76      */
    77     int requestedActivityName(QString &, const QVariantHash &);
    77     int requestedActivityName(QString &, const QVariantHash &);
    78     
    78 
    79     /**
    79     /**
    80      * Interface implementation.
    80      * Interface implementation.
    81      * @see int HsActivityDbClientInterface::activities(QList<QVariantHash> &);
    81      * @see int HsActivityDbClientInterface::activities(QList<QVariantHash> &);
    82      */
    82      */
    83     int activities(QList<QVariantHash> &);
    83     int activities(QList<QVariantHash> &);
    84     
    84 
    85     /**
    85     /**
    86      * Interface implementation.
    86      * Interface implementation.
    87      * @see int HsActivityDbClientInterface::applicationActivities(QList<QVariantHash> &, const QVariantHash &)
    87      * @see int HsActivityDbClientInterface::applicationActivities(QList<QVariantHash> &, const QVariantHash &)
    88      */
    88      */
    89     int applicationActivities(QList<QVariantHash>&, const QVariantHash &);
    89     int applicationActivities(QList<QVariantHash>&, const QVariantHash &);
    90     
    90 
    91     /**
    91     /**
    92      * Interface implementation.
    92      * Interface implementation.
    93      * @see int HsActivityDbClientInterface::waitActivity(const QVariantHash &)
    93      * @see int HsActivityDbClientInterface::waitActivity(const QVariantHash &)
    94      */
    94      */
    95     int waitActivity(const QVariantHash &activity);
    95     int waitActivity(const QVariantHash &activity);
    96     
    96 
    97     /**
    97     /**
    98      * Interface implementation.
    98      * Interface implementation.
    99      * @see int HsActivityDbClientInterface::launchActivity(const QVariantHash &)
    99      * @see int HsActivityDbClientInterface::launchActivity(const QVariantHash &)
   100      */
   100      */
   101     int launchActivity(const QVariantHash &);
   101     int launchActivity(const QVariantHash &);
   104      * Interface implementation.
   104      * Interface implementation.
   105      * @see int HsActivityDbClientInterface::cancelWaitActivity()
   105      * @see int HsActivityDbClientInterface::cancelWaitActivity()
   106      */
   106      */
   107     int cancelWaitActivity();
   107     int cancelWaitActivity();
   108     
   108     
       
   109     /**
       
   110      * Read thumbnail from file
       
   111      * @param dst - destination QPixmap instance
       
   112      * @param src - thumbnail file path
       
   113      * @return 0 on success, error code otherwise
       
   114      */
       
   115     int getThumbnail(QPixmap &dst, const QString & src);
       
   116 
   109 public:
   117 public:
   110     /**
   118     /**
   111      * Function get cached data from server
   119      * Function get cached data from server
   112      * @param dst - destination, preallocated buffer
   120      * @param dst - destination, preallocated buffer
   113      */
   121      */
   114     void getData(RBuf8 & dst);
   122     void getData(RBuf8 &dst);
   115     
   123 
   116     /**
   124     /**
   117      * Function initialize aync request
   125      * Function initialize aync request
   118      * @param func - requested function
   126      * @param func - requested function
   119      * @param data - request data
   127      * @param data - request data
   120      * @param status - request status
   128      * @param status - request status
   121      */
   129      */
   122     void sendDataAsync(int func,const TIpcArgs & data, TRequestStatus& status);
   130     void sendDataAsync(int func,const TIpcArgs &data, TRequestStatus &status);
   123     
   131 
   124 private:
   132 private:
   125     /**
   133     /**
   126      * Function start activity server process.
   134      * Function start activity server process.
   127      * Function can leave on failure.
   135      * Function can leave on failure.
   128      */
   136      */
   129     void startServerL();
   137     void startServerL();
   130     
   138 
   131     /**
   139     /**
   132      * Function establish connection to activity server.
   140      * Function establish connection to activity server.
   133      * Function can leave on failure
   141      * Function can leave on failure
   134      */
   142      */
   135     void connectL();
   143     void connectL();
   136     
   144 
   137     /**
   145     /**
   138      * Function execute remote call request.
   146      * Function execute remote call request.
   139      * @param function - remote function identyfier
   147      * @param function - remote function identyfier
   140      * @param activity - remote function parameters  
   148      * @param activity - remote function parameters
   141      */
   149      */
   142     void execSimpleRequestL( int function, const QVariantHash &activity);
   150     void execSimpleRequestL(int function, const QVariantHash &activity);
   143     
   151 
   144     /**
   152     /**
   145      * Function retrieve current activity name for application.
   153      * Function retrieve current activity name for application.
   146      * Function can leave on failure
   154      * Function can leave on failure
   147      * @param  result - activity name
   155      * @param  result - activity name
   148      * @param activity - request filtering rules 
   156      * @param activity - request filtering rules
   149      */
   157      */
   150     void requestedActivityNameL(QString& result, 
   158     void requestedActivityNameL(QString &result,
   151                                 const QVariantHash &activity);
   159                                 const QVariantHash &activity);
   152     
   160 
   153     /**
       
   154      * Function retrieve all stored activity
       
   155      * Function can leave on failure
       
   156      * @param result - list of activity 
       
   157      */
       
   158     void activitiesL(QList<QVariantHash>& result);
       
   159     
       
   160     /**
   161     /**
   161      * Function retrieve all stored activity
   162      * Function retrieve all stored activity
   162      * Function can leave on failure
   163      * Function can leave on failure
   163      * @param result - list of activity
   164      * @param result - list of activity
   164      * @param cond - request conditions  
       
   165      */
   165      */
   166     void applicationActivitiesL(QList<QVariantHash>& result, 
   166     void activitiesL(QList<QVariantHash>& result);
   167                                 const QVariantHash & cond);
   167 
   168     
   168     /**
       
   169      * Function retrieve all stored activity
       
   170      * Function can leave on failure
       
   171      * @param result - list of activity
       
   172      * @param cond - request conditions
       
   173      */
       
   174     void applicationActivitiesL(QList<QVariantHash>& result,
       
   175                                 const QVariantHash &cond);
       
   176 
   169     void waitActivityL(const QVariantHash &activity);
   177     void waitActivityL(const QVariantHash &activity);
   170 private:
   178 private:
   171     /**
   179     /**
   172      * Async request handler
   180      * Async request handler
   173      * Own
   181      * Own
   174      */
   182      */
   175     HsActivityDbAsyncRequestPrivate* mAsyncDataHandler; 
   183     HsActivityDbAsyncRequestPrivate *mAsyncDataHandler;
   176 
   184 
   177 };
   185 };
   178 #endif // HSACTIVITYDBCLIENTPRIVATE_H
   186 #endif // HSACTIVITYDBCLIENTPRIVATE_H