cenrepnotifyhandler.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : CenRepNotifyHandler.h
00004 *  Part of     : Common Services / Common Engine
00005 *  Interface   : SDK, Central Repository Notification Handler API
00006 *  Description : Active object wrapper for Central Repository one-shot 
00007 *                Notification handling.
00008 *  Version     : %version: ou1s60rt#14 %
00009 *
00010 *  Copyright © 2004-2007 Nokia. All rights reserved.
00011 *  This material, including documentation and any related 
00012 *  computer programs, is protected by copyright controlled by 
00013 *  Nokia. All rights are reserved. Copying, including 
00014 *  reproducing, storing, adapting or translating, any 
00015 *  or all of this material requires the prior written consent of 
00016 *  Nokia. This material also contains confidential 
00017 *  information which may not be disclosed to others without the 
00018 *  prior written consent of Nokia.
00019 * ==============================================================================
00020 */
00021 
00022 #ifndef CCENREPNOTIFYHANDLER_H
00023 #define CCENREPNOTIFYHANDLER_H
00024 
00025 // INCLUDES
00026 #include <e32std.h>
00027 #include <e32base.h>
00028 
00029 // FORWARD DECLARATIONS
00030 class MCenRepNotifyHandlerCallback;
00031 class CRepository;
00032 
00073 class CCenRepNotifyHandler : public CActive
00074     {
00075     public:
00080         enum TCenRepKeyType
00081         {
00082             EIntKey,    
00083             ERealKey,   
00084             EStringKey, 
00085             EBinaryKey  
00086         };
00087 
00102         IMPORT_C static CCenRepNotifyHandler* NewL( MCenRepNotifyHandlerCallback& aCallback, 
00103                                                     CRepository& aSession, 
00104                                                     TCenRepKeyType aKeyType, 
00105                                                     TUint32 aId );
00106 
00121         IMPORT_C static CCenRepNotifyHandler* NewL( MCenRepNotifyHandlerCallback& aCallback, 
00122                                                     CRepository& aSession );
00123 
00139         IMPORT_C static CCenRepNotifyHandler* NewLC( MCenRepNotifyHandlerCallback& aCallback, 
00140                                                      CRepository& aSession, 
00141                                                      TCenRepKeyType aKeyType, 
00142                                                      TUint32 aId );
00158         IMPORT_C static CCenRepNotifyHandler* NewLC( MCenRepNotifyHandlerCallback& aCallback, 
00159                                                      CRepository& aSession );
00168         IMPORT_C void StartListeningL();
00169 
00174         IMPORT_C void StopListening();
00175 
00176 
00180         IMPORT_C virtual ~CCenRepNotifyHandler();
00181 
00182     protected:
00183 
00189         void RunL();
00190     
00196         TInt RunError( TInt aError );
00197 
00203         void DoCancel();
00204 
00205     private:
00206 
00215         CCenRepNotifyHandler( MCenRepNotifyHandlerCallback& aCallback, 
00216                               CRepository& aSession, 
00217                               TCenRepKeyType aKeyType, 
00218                               TUint32 aId );
00219                                                    
00226         CCenRepNotifyHandler( MCenRepNotifyHandlerCallback& aCallback, 
00227                               CRepository& aSession );
00228         /* 
00229         * Order notification
00230         * @return error code from CenRep
00231         */
00232         TInt OrderNotification();
00233        
00234     private:
00235         
00236         CRepository& iSession;  // not owned by this class
00237         MCenRepNotifyHandlerCallback& iCallback; // not owned by this class
00238         TCenRepKeyType iKeyType;
00239         TUint32 iId;        
00240         TBool iWholeRepository;  // The flag to indicate if listening is for whole repository
00241     };
00242 
00243 
00255 class MCenRepNotifyHandlerCallback
00256     {
00257 
00258     public:
00259 
00267     IMPORT_C virtual void HandleNotifyInt( TUint32 aId, TInt aNewValue );
00268 
00276     IMPORT_C virtual void HandleNotifyReal( TUint32 aId, TReal aNewValue );
00277 
00285     IMPORT_C virtual void HandleNotifyString( TUint32 aId, const TDesC16& aNewValue );
00286 
00294     IMPORT_C virtual void HandleNotifyBinary( TUint32 aId, const TDesC8& aNewValue );
00295 
00308     IMPORT_C virtual void HandleNotifyGeneric( TUint32 aId );
00309 
00323     IMPORT_C virtual void HandleNotifyError( TUint32 aId, TInt aError, 
00324                                             CCenRepNotifyHandler* aHandler );
00325     };
00326 
00327 // CCENREPNOTIFYHANDLER_H
00328 #endif
00329 
00330 // End of File

Copyright © Nokia Corporation 2001-2008
Back to top