genericpositioningplugins/locationnpppsy/inc/npppsysingletonhandler.h
changeset 0 667063e416a2
child 16 380473e13443
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2006 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:  NPP PSY singleton objects handler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef NPPPSYSINGLETONHANDLER_H
       
    21 #define NPPPSYSINGLETONHANDLER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 
       
    28 // CLASS DECLARATION
       
    29 class CNppPsyStatusHandler;
       
    30 class CNppPsySettingHandler;
       
    31 class MPositionerStatus;
       
    32 
       
    33 /**
       
    34 *  This class implements the handler for singleton object
       
    35 *  
       
    36 *  The singleton object contains two PSY status handler and setting handler.
       
    37 *
       
    38 *  This class owns an instance of CNppPsyStatusHandler and CNppPsySettingHandler.
       
    39 *
       
    40 *  @lib nlanpppsy.dll
       
    41 *  @since 3.1
       
    42 */
       
    43 class CNppPsySingletonHandler : public CBase
       
    44     {
       
    45     public:  // Constructors and destructor
       
    46         
       
    47         /**
       
    48         * Get instance to singleton handler. Release reference function
       
    49         * must be called to release the reference
       
    50         * @param aStatusInterface Referece to MPositionerStatus to report module 
       
    51         *                         status.
       
    52         * @reuturn the pointer the the singleton handler
       
    53         */
       
    54         static CNppPsySingletonHandler* CNppPsySingletonHandler::GetInstanceL( 
       
    55             MPositionerStatus& aStatusInterface );
       
    56 
       
    57         /**
       
    58         * Release the reference to singleton handler. If there is no ojbect
       
    59         * has the reference of this object, it will delete itself.
       
    60         */
       
    61         void ReleaseInstance();
       
    62 
       
    63         /**
       
    64         * Destructor
       
    65         */
       
    66         ~CNppPsySingletonHandler();
       
    67 
       
    68         /**
       
    69         * Get reference to status handler
       
    70         * @return Reference to status handler
       
    71         */
       
    72         CNppPsyStatusHandler& StatusHandler();
       
    73 
       
    74         /**
       
    75         * Get reference to setting handler
       
    76         * @return Reference to setting handler
       
    77         */
       
    78         CNppPsySettingHandler& SettingHandler();
       
    79         
       
    80 
       
    81     private:
       
    82         /**
       
    83         * Second - phase constructor
       
    84         */
       
    85         void ConstructL( MPositionerStatus& aStatusInterface );
       
    86 
       
    87     private:
       
    88         //Reference count
       
    89         TInt iRefCount;
       
    90 
       
    91         //Status handler
       
    92         CNppPsyStatusHandler* iStatusHandler;
       
    93 
       
    94         //Setting handler
       
    95         CNppPsySettingHandler* iSettingHandler;
       
    96     };
       
    97 
       
    98 #endif      // NPPPSYSINGLETONHANDLER_H
       
    99             
       
   100 // End of File