clock2/clockui/uimodel/inc/clkuilistenerbase.h
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2008 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 "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:  The header file for CClkUiMdlListenerBase class.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CLKUI_LISTENER_BASE_H__
       
    19 #define __CLKUI_LISTENER_BASE_H__
       
    20 
       
    21 // System includes
       
    22 #include <e32base.h>
       
    23 
       
    24 // User includes
       
    25 
       
    26 // Forward declarations
       
    27 class CClkUiModelBase;
       
    28 
       
    29 // Class declaration
       
    30 /**
       
    31 * @class CClkUiMdlListenerBase
       
    32 * @brief The base class for all the listeners.
       
    33 * @dll clkuimodel.dll
       
    34 */
       
    35 class CClkUiMdlListenerBase : public CActive
       
    36     {
       
    37     public:         // New functions
       
    38         
       
    39         /**
       
    40         * @brief Destructor
       
    41         */
       
    42         virtual ~CClkUiMdlListenerBase();
       
    43         
       
    44         /**
       
    45         * @brief Start the listener.
       
    46         */
       
    47         void Start();
       
    48         
       
    49         /**
       
    50         * @brief Needs to be implemented in the derived class. This subscribes for notification from
       
    51         *        the service provider.
       
    52         */
       
    53         virtual void DoStart() = 0;
       
    54         
       
    55     public:         // Functions from base classes
       
    56         
       
    57         /**
       
    58         * @brief From CActive. Called when the value of iStatus changes.
       
    59         */
       
    60         IMPORT_C void RunL();
       
    61         
       
    62         /**
       
    63         * @brief From CActive. Needs to be implemented by the derived class. This cancel any 
       
    64         *        subscriptions made with the service provider.
       
    65         */
       
    66         virtual void DoCancel() = 0;
       
    67         
       
    68     protected:      // New functions
       
    69         
       
    70         /**
       
    71         * @brief C++ default constructor.
       
    72         * @param aModel The model object, which is using the listener.
       
    73         * @param aPriority The AO priority, passed onto CActive while construction.
       
    74         */
       
    75         IMPORT_C CClkUiMdlListenerBase( CClkUiModelBase& aModel, TInt aPriority );
       
    76         
       
    77     private:        // New functions
       
    78         
       
    79         /**
       
    80         * @brief Funnels the notification to the model.
       
    81         * @param aReason The cause for the notification.
       
    82         */
       
    83         void NotifyModelL( TInt aReason );
       
    84         
       
    85     private:        // Data
       
    86         
       
    87         /**
       
    88         * @var iModel
       
    89         * @brief The model that's using the services of the listener.
       
    90         */
       
    91         CClkUiModelBase*                iModel;
       
    92     };
       
    93 
       
    94 #endif          // __CLKUI_LISTENER_BASE_H__
       
    95 
       
    96 // End of file