browserutilities/favouritesengine/ClientServer/srvinc/FavouritesSrvDbNotifier.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *      Declaration of class RFavouritesSrvDbNotifier.
       
    16 *      
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef FAVOURITES_SRV_DB_NOTIFIER_H
       
    22 #define FAVOURITES_SRV_DB_NOTIFIER_H
       
    23 
       
    24 //  INCLUDES
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <d32dbms.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 
       
    31 class CFavouritesSrvDb;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 * Server side change notifier for the Favourites Engine.
       
    37 */
       
    38 NONSHARABLE_CLASS(CFavouritesSrvDbNotifier): public CActive
       
    39     {
       
    40     public:     // construct / destruct
       
    41 
       
    42         /**
       
    43         * Two phase constructor. Leaves on failure.
       
    44         * @param aDb The database to be watched.
       
    45         */
       
    46         static CFavouritesSrvDbNotifier* NewL( CFavouritesSrvDb& aDb );
       
    47 
       
    48         /**
       
    49         * Destructor.
       
    50         */
       
    51         virtual ~CFavouritesSrvDbNotifier();
       
    52 
       
    53     protected:  // construct
       
    54 
       
    55         /**
       
    56         * Constructor. Leaves on failure.
       
    57         */
       
    58         CFavouritesSrvDbNotifier();
       
    59 
       
    60         /**
       
    61         * Second phase constructor. Leaves on failure.
       
    62         * @param aDb The database to be watched.
       
    63         */
       
    64         void ConstructL( CFavouritesSrvDb& aDb );
       
    65 
       
    66     protected:  // from CActive
       
    67 
       
    68         /**
       
    69         * Invoked when the outstanding request completes.
       
    70         */
       
    71         void RunL();
       
    72 
       
    73         /**
       
    74         * Implementation of the Cancel protocol;
       
    75         * cancel any outstanding request.
       
    76         */
       
    77         void DoCancel();
       
    78 
       
    79     public:     // new methods
       
    80 
       
    81         /**
       
    82         * Request notification about all database events.
       
    83         * @param aMessage Message.
       
    84         */
       
    85         void NotifyAllEvents( const RMessage2& aMessage );
       
    86 
       
    87         /**
       
    88         * Request notification about database changes.
       
    89         * @param aMessage Message.
       
    90         */
       
    91         void NotifyChange( const RMessage2& aMessage );
       
    92 
       
    93     private:        // Data
       
    94 
       
    95         RDbNotifier iNotifier;  ///< DBMS notifier object.
       
    96         RMessage2 iMessage;     ///< The message.
       
    97     };
       
    98 
       
    99 #endif
       
   100             
       
   101 // End of File