phoneapp/phoneuiutils/inc/cphonecenrepeventhandler.h
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Central Repository event handler 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CPHONECENREPEVENTHANDLER_H
       
    20 #define __CPHONECENREPEVENTHANDLER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <centralrepository.h>
       
    25 #include <cenrepnotifyhandler.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32 * Class for observing central repository variable changes.
       
    33 */
       
    34 
       
    35 class CPhoneCenRepEventHandler : 
       
    36     public CBase, 
       
    37     public MCenRepNotifyHandlerCallback
       
    38     {
       
    39     public: // Constructors and destructor
       
    40         /**
       
    41         * Default constructor
       
    42         */
       
    43         static CPhoneCenRepEventHandler* NewL( const TUid& aUid );
       
    44 
       
    45         /**
       
    46         * Destructor.
       
    47         */
       
    48         virtual ~CPhoneCenRepEventHandler();
       
    49 
       
    50     private:
       
    51 
       
    52         /**
       
    53         * EPOC default constructor.
       
    54         * @return void
       
    55         */
       
    56         void ConstructL();
       
    57         
       
    58         /**
       
    59         * Constructor
       
    60         * @param aUid identifing the central repository UID.
       
    61         * @return void
       
    62         */         
       
    63         CPhoneCenRepEventHandler( const TUid& aUid );
       
    64     
       
    65         /**
       
    66         * C++ default constructor.
       
    67         * @param None
       
    68         * @return void
       
    69         */
       
    70         CPhoneCenRepEventHandler();
       
    71         
       
    72     public: // From MCenRepNotifyHandlerCallback
       
    73 
       
    74         /**
       
    75         * Notify the client about generic changes for the central repository
       
    76         * key.
       
    77         * @param aId Id of the key that has changed.
       
    78         * @return none
       
    79         */    
       
    80         void HandleNotifyGeneric( TUint32 aId );
       
    81 
       
    82         /**
       
    83         * Notify the client about errors in the handler. Any error in 
       
    84         * handling causes the handler to stop handling any more notifications. 
       
    85         * Handling can be restarted with a call to aHandler->StartListeningL(),
       
    86         * if the error is non-fatal. However, be careful to trap any errors 
       
    87         * from this call if this is done.
       
    88         * @param aId Id of the key this instance listens for or if 
       
    89         * notifications for whole repository are listened, could also be 
       
    90         * KInvalidNotificationId.
       
    91         * @param aError Error code.
       
    92         * @param aHandler Pointer to the handler instance. This pointer can 
       
    93         *        be used to identify the handler or restart the listening.
       
    94         * @return none
       
    95         */    
       
    96         void HandleNotifyError( 
       
    97             TUint32 aId, 
       
    98             TInt error, 
       
    99             CCenRepNotifyHandler* aHandler );
       
   100 
       
   101     private: // Data
       
   102 
       
   103         TUid                  iUid;
       
   104         CRepository*          iRepository;
       
   105         CCenRepNotifyHandler* iCenRepNotifyHandler;
       
   106     };
       
   107 
       
   108 #endif      // __CPHONECENREPEVENTHANDLER_H
       
   109             
       
   110 // End of File