activityfw/activitydatabase/inc/hsactivitydbclientinterface.h
changeset 61 8e5041d13c84
child 66 32469d7d46ff
equal deleted inserted replaced
60:f62f87b200ec 61:8e5041d13c84
       
     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 #ifndef HSACTIVITYDBCLIENTINTERFACE_H
       
    18 #define HSACTIVITYDBCLIENTINTERFACE_H
       
    19 #include <qvariant.h>
       
    20 
       
    21 /**
       
    22  * Enumerate supported functions
       
    23  */
       
    24 enum ClientFunctions 
       
    25 {
       
    26     AddActivity =0,
       
    27     UpdateActivity,
       
    28     RemoveActivity,
       
    29     RemoveApplicationActivities,
       
    30     RequestedActivityName,
       
    31     Activities,
       
    32     ApplicationActivities,
       
    33     WaitActivity,
       
    34     LaunchActivity,
       
    35     GetData,
       
    36     CancelWait
       
    37 };
       
    38 
       
    39 const char ActivityApplicationKeyword [] = ":ApplicationId";
       
    40 const char ActivityActivityKeyword [] = ":ActivityName";
       
    41 
       
    42 class HsActivityDbClientInterface
       
    43 {
       
    44 public:
       
    45     
       
    46     /**
       
    47      * Function save provided avtivity in activity storage
       
    48      * @param activity - activity to store
       
    49      * @return 0 on succees, error code otherwise 
       
    50      */
       
    51     virtual int addActivity(const QVariantHash &activity) =0;
       
    52     
       
    53     /**
       
    54      * Function update exiting activity
       
    55      * @param activity - filtering rules
       
    56      * @return 0 on succees, error code otherwise 
       
    57      */
       
    58     virtual int updateActivity(const QVariantHash &activity) =0;
       
    59     
       
    60     /**
       
    61      * Function delete activity
       
    62      * @param activity - filtering rules
       
    63      * @return 0 on succees, error code otherwise 
       
    64      */
       
    65     virtual int removeActivity(const QVariantHash &activity) =0;
       
    66     
       
    67     /**
       
    68      * Function delete activity for application
       
    69      * @param activity - filtering rules
       
    70      * @return 0 on succees, error code otherwise 
       
    71      */
       
    72     virtual int removeApplicationActivities(const QVariantHash &activity) =0;
       
    73     
       
    74     /**
       
    75      * Function return list of all activity
       
    76      * @param result - destination list
       
    77      * @return 0 on succees, error code otherwise 
       
    78      */
       
    79     virtual int activities(QList<QVariantHash>& result) =0;
       
    80     
       
    81     /**
       
    82      * Function return list of all activity
       
    83      * @param result - destination list,
       
    84      * @param activity - filtering rules
       
    85      * @return 0 on succees, error code otherwise 
       
    86      */
       
    87     virtual int applicationActivities(QList<QVariantHash>& result, 
       
    88                                       const QVariantHash &activity) =0;
       
    89     
       
    90     /**
       
    91      * Function subscribe to activity
       
    92      * @param  activity - filtering rules
       
    93      * @return 0 on succees, error code otherwise 
       
    94      */
       
    95     virtual int waitActivity(const QVariantHash &activity)=0;
       
    96     
       
    97     /**
       
    98      * Function launch application activity
       
    99      * @param activity - filtering rules 
       
   100      * @return 0 on succees, error code otherwise 
       
   101      */
       
   102     virtual int launchActivity(const QVariantHash &activity)=0;
       
   103 };
       
   104 #endif //HSACTIVITYDBCLIENTINTERFACE_H