idlefw/plugins/sapidataplugin/inc/sapidataobserver.h
branchRCL_3
changeset 114 a5a39a295112
equal deleted inserted replaced
113:0efa10d348c0 114:a5a39a295112
       
     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 // System includes
       
    23 #include <liwcommon.h>
       
    24 
       
    25 // User includes
       
    26 
       
    27 // Forward declarations
       
    28 class CSapiData;
       
    29 
       
    30 /**
       
    31  * @ingroup group_sapidataplugin
       
    32  *
       
    33  * Sapi data observer
       
    34  *
       
    35  * @since S60 5.0
       
    36  */
       
    37 NONSHARABLE_CLASS( CSapiDataObserver ) : public CBase, 
       
    38     public MLiwNotifyCallback
       
    39     {
       
    40 public: // constructor and destructor
       
    41     
       
    42     /**
       
    43     * Part of the two phased constuction
       
    44     *
       
    45     * @param aInterface reference of the interface 
       
    46     * @param aData reference of the sapi data object
       
    47     * @return none
       
    48     */
       
    49     static CSapiDataObserver* NewL( MLiwInterface* aInterface, CSapiData* aData );
       
    50     
       
    51     /**
       
    52     * Destructor
       
    53     *
       
    54     * @param none
       
    55     * @return none
       
    56     */   
       
    57     ~CSapiDataObserver();
       
    58 
       
    59 private:  // construtors
       
    60     
       
    61     /**
       
    62     * Constructor
       
    63     *
       
    64     * @param none
       
    65     * @return none
       
    66     */
       
    67     CSapiDataObserver();
       
    68     
       
    69     /**
       
    70     * Part of the two phased construction
       
    71     *
       
    72     * @param aInterface reference of the interface
       
    73     * @param aData reference of the sapi data object
       
    74     * @return void
       
    75     */
       
    76     void ConstructL( MLiwInterface* aInterface, CSapiData* aData );
       
    77        
       
    78 public: //from MLiwNotifyCallback
       
    79     
       
    80     /**
       
    81     * Handles notifications caused by an asynchronous Execute*CmdL call
       
    82     * or an event.
       
    83     *
       
    84     * @param aCmdId The service command associated to the event.
       
    85     * @param aEventId occurred event, see LiwCommon.hrh.
       
    86     * @param aEventParamList Event parameters, if any, as defined per
       
    87     *        each event.
       
    88     * @param aInParamList Input parameters, if any, given in the
       
    89     *        related HandleCommmandL.
       
    90     * @return Error code for the call back.
       
    91     */
       
    92     virtual TInt HandleNotifyL(
       
    93         TInt aCmdId,
       
    94         TInt /*aEventId*/,
       
    95         CLiwGenericParamList& aEventParamList,
       
    96         const CLiwGenericParamList& /*aInParamList*/);
       
    97 
       
    98 public:  // new functions
       
    99     
       
   100     /**
       
   101     * Registers to CPS for add, delete , update and execute notifications
       
   102     * 
       
   103     * @param aFilter filter for input parameter list
       
   104     * @param aRegistry Publisher or content registry
       
   105     * @param aOptions Options for the registration
       
   106     * 
       
   107     * @return void.
       
   108     */
       
   109     void RegisterL( CLiwDefaultMap* aFilter, 
       
   110                     const TDesC& aRegistry, 
       
   111                     TUint aOptions = 0 );
       
   112 
       
   113     /**
       
   114     * Cancel all the registered notifications. 
       
   115     * @return void.
       
   116     */
       
   117     void ReleaseL();
       
   118         
       
   119 private: // data
       
   120     
       
   121     /** Interface Reference, not owned */    
       
   122     MLiwInterface* iInterface;   
       
   123     /** Reference of the sapi data, not owned */
       
   124     CSapiData* iData;
       
   125     /** Transaction Id */
       
   126     TInt32 iTransactionId;
       
   127     };
       
   128 
       
   129 #endif // SAPIDATAOBSERVER_H
       
   130 
       
   131 // End of file
       
   132