idlefw/plugins/sapidataplugin/inc/sapidataobserver.h
changeset 0 79c6a41cd166
child 1 844b978f8d5e
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Plug-in main class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef SAPIDATAOBSERVER_H
       
    20 #define SAPIDATAOBSERVER_H
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include <LiwCommon.h>
       
    24 
       
    25 class CSapiData;
       
    26 
       
    27 class CSapiDataObserver : public CBase, public MLiwNotifyCallback
       
    28     {
       
    29 public:
       
    30 
       
    31     /**
       
    32     * Part of the two phased constuction
       
    33     *
       
    34     * @param aInterface reference of the interface 
       
    35     * @param aData reference of the sapi data object
       
    36     * @return none
       
    37     */
       
    38     static CSapiDataObserver* NewL( MLiwInterface* aInterface, CSapiData* aData );
       
    39     
       
    40     /**
       
    41     * Destructor
       
    42     *
       
    43     * @param none
       
    44     * @return none
       
    45     */   
       
    46     ~CSapiDataObserver();
       
    47 
       
    48 private :
       
    49     
       
    50     /**
       
    51     * Constructor
       
    52     *
       
    53     * @param none
       
    54     * @return none
       
    55     */
       
    56     CSapiDataObserver();
       
    57     
       
    58     /**
       
    59     * Part of the two phased construction
       
    60     *
       
    61     * @param aInterface reference of the interface
       
    62     * @param aData reference of the sapi data object
       
    63     * @return void
       
    64     */
       
    65     void ConstructL( MLiwInterface* aInterface, CSapiData* aData );
       
    66        
       
    67 public:  //from MLiwNotifyCallbackc
       
    68     
       
    69     /**
       
    70     * Handles notifications caused by an asynchronous Execute*CmdL call
       
    71     * or an event.
       
    72     *
       
    73     * @param aCmdId The service command associated to the event.
       
    74     * @param aEventId occurred event, see LiwCommon.hrh.
       
    75     * @param aEventParamList Event parameters, if any, as defined per
       
    76     *        each event.
       
    77     * @param aInParamList Input parameters, if any, given in the
       
    78     *        related HandleCommmandL.
       
    79     * @return Error code for the call back.
       
    80     */
       
    81     virtual TInt HandleNotifyL(
       
    82         TInt aCmdId,
       
    83         TInt /*aEventId*/,
       
    84         CLiwGenericParamList& aEventParamList,
       
    85         const CLiwGenericParamList& /*aInParamList*/);
       
    86 
       
    87 public:
       
    88     
       
    89     /**
       
    90     * Registers to CPS for add, delete , update and execute notifications
       
    91     * @aFilter - filter for input parameter list
       
    92     * @return void.
       
    93     */
       
    94     void RegisterL( CLiwDefaultMap* aFilter, const TDesC& aRegistry );
       
    95 
       
    96     /**
       
    97     * Cancel all the registered notifications. 
       
    98     * @return void.
       
    99     */
       
   100     void ReleaseL();
       
   101         
       
   102 private:
       
   103         
       
   104     // Reference of 
       
   105     // Not owned
       
   106     MLiwInterface* iInterface;
       
   107     
       
   108     // Reference of the sapi data
       
   109     // Not owned
       
   110     CSapiData* iData;
       
   111     
       
   112     // Call back error code
       
   113     TInt iError;
       
   114         
       
   115     };
       
   116 
       
   117 #endif /*SAPIDATAOBSERVER_H*/