2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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.
14 * Description: Declaration of CActiveFavouritesDbNotifier.
19 #ifndef ACTIVE_FAVOURITES_DB_NOTIFIER_H
20 #define ACTIVE_FAVOURITES_DB_NOTIFIER_H
26 #include <favouritesdbnotifier.h>
28 // FORWARD DECLARATION
31 class MFavouritesDbObserver;
36 * ActiveFavouritesDbNotifier is an Active object encapsulating a favourites database notifier.
37 * Once this notifier is Start()-ed, it keeps watching the database and notifies the
38 * observer, until the database is closed by all clients (i.e. released by
39 * DBMS), or it is DoCancel()-led.
41 class CActiveFavouritesDbNotifier : public CActive
43 public: // Constructor and destructor
48 * @param aDb The favourites database to watch for.
49 * @param aObserver The Observer to be notified about database events.
51 IMPORT_C CActiveFavouritesDbNotifier( RFavouritesDb& aDb, MFavouritesDbObserver& aObserver );
56 IMPORT_C virtual ~CActiveFavouritesDbNotifier();
58 protected: // from CActive
61 * Invoked when the outstanding request completes.
68 * Cancel any outstading request. It's implementation of the Cancel protocol;
72 IMPORT_C void DoCancel();
74 public: // new methods
77 * Start the notifier. The notification request is automatically
78 * renewed until it is cancelled, or the database is closed by
79 * all clients (i.e. released by DBMS).
83 IMPORT_C TInt Start();
88 * Request database change notification from the Favourites Engine.
96 RFavouritesDbNotifier iNotifier; ///< Notifier object.
97 RFavouritesDb& iDb; ///< Handle to the database.
98 MFavouritesDbObserver* iObserver; ///< Pointer to observer.