2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Class for registering CPbkContactEngine observers.
20 #ifndef __CPbkContactChangeNotifier_H__
21 #define __CPbkContactChangeNotifier_H__
24 #include <e32base.h> // CBase
26 // FORWARD DECLARATIONS
27 class CPbkContactEngine;
28 class MPbkContactDbObserver;
34 * A class used for registering as an observer for contact database
37 class CPbkContactChangeNotifier : public CBase
39 public: // Constructors and destructor
41 * Creates a new instance of this class and registers aObserver as an
42 * observer of aEngine.
44 * @param aEngine The observed object.
45 * @param aObserver The observer to call when database changes occur.
46 * @return A contact change notifier instance.
48 IMPORT_C static CPbkContactChangeNotifier* NewL
49 (CPbkContactEngine& aEngine, MPbkContactDbObserver* aObserver);
52 * Removes the aObserver from aEngine given as paramters to NewL and
53 * destructs this object.
55 ~CPbkContactChangeNotifier();
57 private: // Implementation
58 CPbkContactChangeNotifier
59 (MPbkContactDbObserver* aObserver);
60 void ConstructL(CPbkContactEngine& aEngine);
63 /// Ref: Phonebook engine
64 CPbkContactEngine* iEngine;
66 MPbkContactDbObserver* iObserver;
70 #endif // __CPbkContactChangeNotifier_H__