landmarksui/engine/inc/CLmkEventListenerSingleton.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     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 "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:    LandmarksUi Content File -    Singleton class for listening events
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef CLMKEVENTLISTENERSINGLETON_H
       
    26 #define CLMKEVENTLISTENERSINGLETON_H
       
    27 
       
    28 //  INCLUDES
       
    29 #include <coemain.h>        // CCoeStatic
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class CLmkDbEventListener;
       
    33 class CPosLandmarkDatabase;
       
    34 class MLmkDbObserver;
       
    35 
       
    36 // CLASS DECLARATION
       
    37 
       
    38 /**
       
    39 * CLmkEventListenerSingleton class.
       
    40 * It is mandatory that the user takes care of removing added observers
       
    41 * before they or the database becomes invalid, since this is a singleton
       
    42 * class and used with static methods.
       
    43 */
       
    44 class CLmkEventListenerSingleton : public CCoeStatic
       
    45     {
       
    46     public: // New methods
       
    47         /**
       
    48         * Add observer
       
    49         * @param aObserver
       
    50         * @param aDb
       
    51         */
       
    52         static void AddObserverL( MLmkDbObserver& aObserver,
       
    53                                   CPosLandmarkDatabase& aDb );
       
    54 
       
    55         /**
       
    56          * Remove observer
       
    57          * @param aObserver
       
    58          */
       
    59         static void RemoveObserver( MLmkDbObserver& aObserver );
       
    60 
       
    61     protected:  // Constructors and destructor
       
    62         /**
       
    63         * C++ constructor.
       
    64         * @return newly instantiated object
       
    65         */
       
    66         CLmkEventListenerSingleton();
       
    67 
       
    68         /**
       
    69         * By default Symbian 2nd phase constructor is private.
       
    70         */
       
    71         void ConstructL();
       
    72 
       
    73         /**
       
    74         * Destructor.
       
    75         */
       
    76         ~CLmkEventListenerSingleton();
       
    77 
       
    78     protected:    // Data
       
    79         ///Own:
       
    80         CLmkDbEventListener* iEventListener;
       
    81     };
       
    82 
       
    83 #endif      // CLMKEVENTLISTENERSINGLETON_H
       
    84 
       
    85 // End of File