camerauis/cameraapp/generic/inc/CamObserverHandler.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 0 1ddebce53859
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
       
     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:  observer handler class
       
    15 *
       
    16 *  Copyright © 2007 Nokia.  All rights reserved.
       
    17 *  This material, including documentation and any related computer
       
    18 *  programs, is protected by copyright controlled by Nokia.  All
       
    19 *  rights are reserved.  Copying, including reproducing, storing,
       
    20 *  adapting or translating, any or all of this material requires the
       
    21 *  prior written consent of Nokia.  This material also contains
       
    22 *  confidential information which may not be disclosed to others
       
    23 *  without the prior written consent of Nokia.
       
    24 
       
    25 *
       
    26 *
       
    27 */
       
    28 
       
    29 
       
    30 #include <e32base.h>
       
    31 #include "CamObservable.h"
       
    32 
       
    33 #ifndef CAMOBSERVERHANDLER_H
       
    34 #define CAMOBSERVERHANDLER_H
       
    35 
       
    36 class CCamObserverHandler : public CBase, public MCamObservable
       
    37     {
       
    38 public:
       
    39 	/**
       
    40 	*	Static factory construction function
       
    41     *   @since 2.8
       
    42 	*	@return pointer to constructed instance of CCamNaviCounterModel
       
    43 	*/
       
    44 	static CCamObserverHandler* NewL();
       
    45 
       
    46     /**
       
    47     * Destructor.
       
    48     */
       
    49     ~CCamObserverHandler();
       
    50     
       
    51     
       
    52 public:
       
    53     /**
       
    54     * Registers an observer if not previously registered
       
    55     * @param aObserver The observer concerned
       
    56     * @since 3.0
       
    57     */
       
    58     void RegisterObserverL(MCamObserver* aObserver);
       
    59     
       
    60     /**
       
    61     * Deregisters an observer if previously registered
       
    62     * @param aObserver The observer concerned
       
    63     * @since 3.0
       
    64     */
       
    65     void DeregisterObserver(MCamObserver* aObserver);
       
    66     
       
    67     /**
       
    68     * Broadcasts an event code to all registered observers
       
    69     * @param aEvent The event code
       
    70     */    
       
    71     void BroadcastEvent(TCamObserverEvent aEvent);
       
    72 
       
    73 protected:
       
    74     /**
       
    75     * C++ Constructor
       
    76     */
       
    77     CCamObserverHandler();
       
    78     
       
    79     /**
       
    80     * Second-phase constructor
       
    81     */
       
    82     void ConstructL();
       
    83     
       
    84 private:
       
    85     // Internal list of observers
       
    86     RPointerArray<MCamObserver> iObservers;
       
    87     };
       
    88         
       
    89 #endif // CAMOBSERVERHANDLER_H