author | William Roberts <williamr@symbian.org> |
Tue, 16 Mar 2010 16:12:26 +0000 | |
branch | Symbian2 |
changeset 2 | 2fe1408b6811 |
parent 1 | 666f914201fb |
child 4 | 837f303aceeb |
permissions | -rw-r--r-- |
williamr@2 | 1 |
/* |
williamr@2 | 2 |
* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 3 |
* All rights reserved. |
williamr@2 | 4 |
* This component and the accompanying materials are made available |
williamr@2 | 5 |
* under the terms of the License "Eclipse Public License v1.0" |
williamr@2 | 6 |
* which accompanies this distribution, and is available |
williamr@2 | 7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@2 | 8 |
* |
williamr@2 | 9 |
* Initial Contributors: |
williamr@2 | 10 |
* Nokia Corporation - initial contribution. |
williamr@2 | 11 |
* |
williamr@2 | 12 |
* Contributors: |
williamr@2 | 13 |
* |
williamr@2 | 14 |
* Description: Declaration of CActiveFavouritesDbNotifier. |
williamr@2 | 15 |
* |
williamr@2 | 16 |
*/ |
williamr@2 | 17 |
|
williamr@2 | 18 |
|
williamr@2 | 19 |
#ifndef ACTIVE_FAVOURITES_DB_NOTIFIER_H |
williamr@2 | 20 |
#define ACTIVE_FAVOURITES_DB_NOTIFIER_H |
williamr@2 | 21 |
|
williamr@2 | 22 |
// INCLUDES |
williamr@2 | 23 |
|
williamr@2 | 24 |
#include <e32base.h> |
williamr@2 | 25 |
#include <d32dbms.h> |
williamr@2 | 26 |
#include <FavouritesDbNotifier.h> |
williamr@2 | 27 |
|
williamr@2 | 28 |
// FORWARD DECLARATION |
williamr@2 | 29 |
|
williamr@2 | 30 |
class RFavouritesDb; |
williamr@2 | 31 |
class MFavouritesDbObserver; |
williamr@2 | 32 |
|
williamr@2 | 33 |
// CLASS DECLARATION |
williamr@2 | 34 |
|
williamr@2 | 35 |
/** |
williamr@2 | 36 |
* ActiveFavouritesDbNotifier is an Active object encapsulating a favourites database notifier. |
williamr@2 | 37 |
* Once this notifier is Start()-ed, it keeps watching the database and notifies the |
williamr@2 | 38 |
* observer, until the database is closed by all clients (i.e. released by |
williamr@2 | 39 |
* DBMS), or it is DoCancel()-led. |
williamr@2 | 40 |
*/ |
williamr@2 | 41 |
class CActiveFavouritesDbNotifier : public CActive |
williamr@2 | 42 |
{ |
williamr@2 | 43 |
public: // Constructor and destructor |
williamr@2 | 44 |
|
williamr@2 | 45 |
/** |
williamr@2 | 46 |
* Constructor. |
williamr@2 | 47 |
* @since 0.9 |
williamr@2 | 48 |
* @param aDb The favourites database to watch for. |
williamr@2 | 49 |
* @param aObserver The Observer to be notified about database events. |
williamr@2 | 50 |
*/ |
williamr@2 | 51 |
IMPORT_C CActiveFavouritesDbNotifier( RFavouritesDb& aDb, MFavouritesDbObserver& aObserver ); |
williamr@2 | 52 |
|
williamr@2 | 53 |
/** |
williamr@2 | 54 |
* Destructor. |
williamr@2 | 55 |
*/ |
williamr@2 | 56 |
IMPORT_C virtual ~CActiveFavouritesDbNotifier(); |
williamr@2 | 57 |
|
williamr@2 | 58 |
protected: // from CActive |
williamr@2 | 59 |
|
williamr@2 | 60 |
/** |
williamr@2 | 61 |
* Invoked when the outstanding request completes. |
williamr@2 | 62 |
* @since 0.9 |
williamr@2 | 63 |
* @return void |
williamr@2 | 64 |
*/ |
williamr@2 | 65 |
IMPORT_C void RunL(); |
williamr@2 | 66 |
|
williamr@2 | 67 |
/** |
williamr@2 | 68 |
* Cancel any outstading request. It's implementation of the Cancel protocol; |
williamr@2 | 69 |
* @since 0.9 |
williamr@2 | 70 |
* @return void |
williamr@2 | 71 |
*/ |
williamr@2 | 72 |
IMPORT_C void DoCancel(); |
williamr@2 | 73 |
|
williamr@2 | 74 |
public: // new methods |
williamr@2 | 75 |
|
williamr@2 | 76 |
/** |
williamr@2 | 77 |
* Start the notifier. The notification request is automatically |
williamr@2 | 78 |
* renewed until it is cancelled, or the database is closed by |
williamr@2 | 79 |
* all clients (i.e. released by DBMS). |
williamr@2 | 80 |
* @since 0.9 |
williamr@2 | 81 |
* @return Error code. |
williamr@2 | 82 |
*/ |
williamr@2 | 83 |
IMPORT_C TInt Start(); |
williamr@2 | 84 |
|
williamr@2 | 85 |
private: |
williamr@2 | 86 |
|
williamr@2 | 87 |
/** |
williamr@2 | 88 |
* Request database change notification from the Favourites Engine. |
williamr@2 | 89 |
* @since 0.9 |
williamr@2 | 90 |
* @return void |
williamr@2 | 91 |
*/ |
williamr@2 | 92 |
void NotifyChange(); |
williamr@2 | 93 |
|
williamr@2 | 94 |
private: // data |
williamr@2 | 95 |
|
williamr@2 | 96 |
RFavouritesDbNotifier iNotifier; ///< Notifier object. |
williamr@2 | 97 |
RFavouritesDb& iDb; ///< Handle to the database. |
williamr@2 | 98 |
MFavouritesDbObserver* iObserver; ///< Pointer to observer. |
williamr@2 | 99 |
}; |
williamr@2 | 100 |
|
williamr@2 | 101 |
#endif |
williamr@2 | 102 |
|
williamr@2 | 103 |
// End of File |