securitydialogs/lockapp/inc/lockappobserverlist.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2007 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:  Controls observers and publishes state changes
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __LOCKAPPOBSERVERLIST_H__
       
    20 #define __LOCKAPPOBSERVERLIST_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <coecntrl.h>
       
    24 #include "lockapp.hrh"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MLockAppStateObserver;
       
    28 
       
    29 /**
       
    30  *  CLockAppObserverList class publishes lock state changes to all implemented state 
       
    31  *  observers. The list owns all childs and it is responsible for deleting them.
       
    32  *
       
    33  *  @lib    lockapp
       
    34  *  @since  5.0
       
    35  *  @author Joona Petrell
       
    36  *  @author Tamas Koteles
       
    37  */
       
    38 class CLockAppObserverList : public CCoeControl
       
    39     {
       
    40     public:
       
    41 
       
    42         /**
       
    43          * C++ default constructor.
       
    44          */
       
    45         CLockAppObserverList( );
       
    46 
       
    47         /**
       
    48          * Destructor.
       
    49          */
       
    50         virtual ~CLockAppObserverList( );
       
    51 
       
    52     public:
       
    53 
       
    54         /**
       
    55          * Add new state observer.
       
    56          * @param aObserver lock state observer
       
    57          */
       
    58         void AddObserverL( MLockAppStateObserver* aObserver );
       
    59 
       
    60         /**
       
    61          * Remove lock state observer.
       
    62          * @param aObserver lock state observer
       
    63          */
       
    64         void RemoveObserver( MLockAppStateObserver* aObserver );
       
    65 
       
    66     protected:
       
    67 
       
    68         /**
       
    69          * Has to be called by the derived class in the construction.
       
    70          */
       
    71         void BaseConstructL( );
       
    72 
       
    73         /**
       
    74          * Informs all observers about the status change.
       
    75          *
       
    76          * @param aStatusChange the new lock state.
       
    77          */
       
    78         void PostStatusChangeL( TLockStatus aStatusChange );
       
    79 
       
    80         /**
       
    81          * Class that derives from observer list will have first
       
    82          * notification about the lock status chane.
       
    83          *
       
    84          * @param aLockStatus the new lock state.
       
    85          */
       
    86         virtual void HandleLockStatusChangedL( TLockStatus aLockStatus );
       
    87 
       
    88     private:
       
    89 
       
    90         /**
       
    91          * Dynamic list storing observers. Both the list and observers are owned.
       
    92          * Own.
       
    93          */
       
    94         RPointerArray<MLockAppStateObserver>* iObserverList;
       
    95 
       
    96     };
       
    97 
       
    98 #endif // __LOCKAPPOBSERVERLIST_H__
       
    99 // End of File