00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef CCENREPNOTIFYHANDLER_H
00023 #define CCENREPNOTIFYHANDLER_H
00024
00025
00026 #include <e32std.h>
00027 #include <e32base.h>
00028
00029
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
00230
00231
00232 TInt OrderNotification();
00233
00234 private:
00235
00236 CRepository& iSession;
00237 MCenRepNotifyHandlerCallback& iCallback;
00238 TCenRepKeyType iKeyType;
00239 TUint32 iId;
00240 TBool iWholeRepository;
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
00328 #endif
00329
00330