activityfw/activitydatabase/inc/hsactivitydbclientinterface.h
changeset 109 e0aa398e6810
parent 104 9b022b1f357c
child 115 3ab5c078b490
equal deleted inserted replaced
104:9b022b1f357c 109:e0aa398e6810
     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 #include <activitycmd.h>
       
    21 /**
       
    22  * Enumerate supported functions
       
    23  */
       
    24 
       
    25 const char ActivityApplicationKeyword [] = ":ApplicationId";
       
    26 const char ActivityActivityKeyword [] = ":ActivityName";
       
    27 const char ActivityParametersKeyword [] = ":ActivityParams";
       
    28 const char ActivityPersistence [] = ":ActivityPersistence";
       
    29 const char ActivityVisibility [] = ":ActivityVisibility";
       
    30 const char ActivityScreenshotKeyword [] = "screenshot";
       
    31 const char ActivityDataKeyword [] = ":ActivityData";
       
    32 const char ActivityApplicationName[] = ":ApplicationName";
       
    33 
       
    34 class HsActivityDbClientInterface
       
    35 {
       
    36 public:
       
    37 
       
    38     /**
       
    39      * Function save provided avtivity in activity storage
       
    40      * @param activity - activity to store
       
    41      * @return 0 on succees, error code otherwise
       
    42      */
       
    43     virtual int addActivity(const QVariantHash &privateData,
       
    44                             const QVariantHash &publicData) =0;
       
    45 
       
    46     /**
       
    47      * Function update exiting activity
       
    48      * @param activity - filtering rules
       
    49      * @return 0 on succees, error code otherwise
       
    50      */
       
    51     virtual int updateActivity(const QVariantHash &privateData,
       
    52                                const QVariantHash &publicData) =0;
       
    53 
       
    54     /**
       
    55      * Function delete activity
       
    56      * @param activity - filtering rules
       
    57      * @return 0 on succees, error code otherwise
       
    58      */
       
    59     virtual int removeActivity(const QVariantHash &activity) =0;
       
    60 
       
    61     /**
       
    62      * Function delete activity for application
       
    63      * @param activity - filtering rules
       
    64      * @return 0 on succees, error code otherwise
       
    65      */
       
    66     virtual int removeApplicationActivities(const QVariantHash &activity) =0;
       
    67 
       
    68     /**
       
    69      * Function return list of all activity
       
    70      * @param result - destination list
       
    71      * @return 0 on succees, error code otherwise
       
    72      */
       
    73     virtual int activities(QList<QVariantHash>& result) =0;
       
    74 
       
    75     /**
       
    76      * Function return list of all activity
       
    77      * @param result - destination list,
       
    78      * @param activity - filtering rules
       
    79      * @return 0 on succees, error code otherwise
       
    80      */
       
    81     virtual int applicationActivities(QList<QVariantHash>& result,
       
    82                                       const QVariantHash &activity) =0;
       
    83 
       
    84     /**
       
    85      * Function returns data for activity
       
    86      * @param result - activity data
       
    87      * @param activity - filtering rules
       
    88      * @return 0 on succees, error code otherwise
       
    89      */
       
    90     virtual int activityData(QVariant &result, const QVariantHash &activity) = 0;
       
    91                                       
       
    92     /**
       
    93      * Function subscribe to activity
       
    94      * @param  activity - filtering rules
       
    95      * @return 0 on succees, error code otherwise
       
    96      */
       
    97     virtual int waitActivity(const QVariantHash &activity)=0;
       
    98 
       
    99     /**
       
   100      * Function launch application activity
       
   101      * @param activity - filtering rules
       
   102      * @return 0 on succees, error code otherwise
       
   103      */
       
   104     virtual int launchActivity(const QVariantHash &activity)=0;
       
   105 };
       
   106 #endif //HSACTIVITYDBCLIENTINTERFACE_H