idlefw/plugins/wrtdataplugin/inc/wrtdataobserver.h
changeset 3 ff572005ac23
parent 1 844b978f8d5e
child 8 d0529222e3f0
equal deleted inserted replaced
2:b7904b40483f 3:ff572005ac23
    20 #define WRTDATAOBSERVER_H
    20 #define WRTDATAOBSERVER_H
    21 
    21 
    22 // INCLUDE FILES
    22 // INCLUDE FILES
    23 #include <liwcommon.h>
    23 #include <liwcommon.h>
    24 
    24 
       
    25 // FORWARD DECLARATIONS
    25 class CWrtData;
    26 class CWrtData;
    26 
    27 
       
    28 // CLASS DECLARATION
    27 /**
    29 /**
    28  *  @ingroup group_wrtdataplugin
    30  *  @ingroup group_wrtdataplugin
    29  *
    31  *
    30  *  Wrt data observer
    32  *  Wrt data observer
    31  *
    33  *
    32  *  @since S60 v3.2
    34  *  @since S60 v3.2
    33  */
    35  */
    34 class CWrtDataObserver : public CBase, public MLiwNotifyCallback
    36 class CWrtDataObserver : public CBase, public MLiwNotifyCallback
    35     {
    37     {
    36 public:
    38     public:
    37 
    39 
    38     /**
    40         /**
    39     * Part of the two phased constuction
    41         * Part of the two phased constuction
    40     *
    42         *
    41     * @param aInterface reference of the interface 
    43         * @param aInterface reference of the interface 
    42     * @param aData reference of the wrt data object
    44         * @param aData reference of the wrt data object
    43     * @return none
    45         * @return none
    44     */
    46         */
    45     static CWrtDataObserver* NewL( MLiwInterface* aInterface, CWrtData* aData );
    47         static CWrtDataObserver* NewL( MLiwInterface* aInterface, CWrtData* aData );
    46     
    48     
    47     /**
    49         /**
    48     * Destructor
    50         * Destructor
    49     *
    51         *
    50     * @param none
    52         * @param none
    51     * @return none
    53         * @return none
    52     */   
    54         */   
    53     ~CWrtDataObserver();
    55         ~CWrtDataObserver();
    54 
    56 
    55 private :
    57     private :
    56     
    58     
    57     /**
    59         /**
    58     * Constructor
    60         * Constructor
    59     *
    61         *
    60     * @param none
    62         * @param none
    61     * @return none
    63         * @return none
    62     */
    64         */
    63     CWrtDataObserver();
    65         CWrtDataObserver();
       
    66         
       
    67         /**
       
    68         * Part of the two phased construction
       
    69         *
       
    70         * @param aInterface reference of the interface
       
    71         * @param aData reference of the wrt data object
       
    72         * @return void
       
    73         */
       
    74         void ConstructL( MLiwInterface* aInterface, CWrtData* aData );
       
    75        
       
    76     public:  //from MLiwNotifyCallbackc
    64     
    77     
    65     /**
    78         /**
    66     * Part of the two phased construction
    79         * Handles notifications caused by an asynchronous Execute*CmdL call
    67     *
    80         * or an event.
    68     * @param aInterface reference of the interface
    81         *
    69     * @param aData reference of the wrt data object
    82         * @param aCmdId The service command associated to the event.
    70     * @return void
    83         * @param aEventId occurred event, see LiwCommon.hrh.
    71     */
    84         * @param aEventParamList Event parameters, if any, as defined per
    72     void ConstructL( MLiwInterface* aInterface, CWrtData* aData );
    85         *        each event.
    73        
    86         * @param aInParamList Input parameters, if any, given in the
    74 public:  //from MLiwNotifyCallbackc
    87         *        related HandleCommmandL.
       
    88         * @return Error code for the call back.
       
    89         */
       
    90         virtual TInt HandleNotifyL(
       
    91             TInt aCmdId,
       
    92             TInt /*aEventId*/,
       
    93             CLiwGenericParamList& aEventParamList,
       
    94             const CLiwGenericParamList& /*aInParamList*/);
       
    95 
       
    96     public:
    75     
    97     
    76     /**
    98         /**
    77     * Handles notifications caused by an asynchronous Execute*CmdL call
    99         * Registers to CPS for add, delete , update and execute notifications
    78     * or an event.
   100         * @aFilter - filter for input parameter list
    79     *
   101         * @return void.
    80     * @param aCmdId The service command associated to the event.
   102         */
    81     * @param aEventId occurred event, see LiwCommon.hrh.
   103         void RegisterL( CLiwDefaultMap* aFilter );
    82     * @param aEventParamList Event parameters, if any, as defined per
       
    83     *        each event.
       
    84     * @param aInParamList Input parameters, if any, given in the
       
    85     *        related HandleCommmandL.
       
    86     * @return Error code for the call back.
       
    87     */
       
    88     virtual TInt HandleNotifyL(
       
    89         TInt aCmdId,
       
    90         TInt /*aEventId*/,
       
    91         CLiwGenericParamList& aEventParamList,
       
    92         const CLiwGenericParamList& /*aInParamList*/);
       
    93 
       
    94 public:
       
    95     
   104     
    96     /**
   105         /**
    97     * Registers to CPS for add, delete , update and execute notifications
   106         * Cancel all the registered notifications. 
    98     * @aFilter - filter for input parameter list
   107         * @return void.
    99     * @return void.
   108         */
   100     */
   109         void ReleaseL();
   101     void RegisterL( CLiwDefaultMap* aFilter );
   110             
   102 
   111     private:
   103     /**
   112             
   104     * Cancel all the registered notifications. 
   113         // Reference of 
   105     * @return void.
   114         // Not owned
   106     */
   115         MLiwInterface* iInterface;
   107     void ReleaseL();
       
   108         
   116         
   109 private:
   117         // Reference of the wrt data
       
   118         // Not owned
       
   119         CWrtData* iData;
   110         
   120         
   111     // Reference of 
   121         // Call back error code
   112     // Not owned
   122         TInt iError;
   113     MLiwInterface* iInterface;
       
   114     
       
   115     // Reference of the wrt data
       
   116     // Not owned
       
   117     CWrtData* iData;
       
   118     
       
   119     // Call back error code
       
   120     TInt iError;
       
   121         
   123         
   122     };
   124     };
   123 
   125 
   124 #endif /*WRTDATAOBSERVER_H*/
   126 #endif /*WRTDATAOBSERVER_H*/