datasourcemodules/bluetoothgpspositioningmodule/btgpspsy/inc/Utils/BTGPSModuleStatusHandler.h
changeset 36 b47902b73a93
parent 0 9cfd9a3ee49c
equal deleted inserted replaced
35:a2efdd544abf 36:b47902b73a93
       
     1 /*
       
     2 * Copyright (c) 2005-2009 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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef BTGPSMODULESTATUSHANDLER_H
       
    22 #define BTGPSMODULESTATUSHANDLER_H
       
    23 
       
    24 //  INCLUDES
       
    25 
       
    26 #include <e32base.h> 
       
    27 #include "BTGPSDeviceListener.h"
       
    28 #include "BTGPSLocationFixListener.h"
       
    29 #include "BTGPSPsyConnectionListener.h"
       
    30 
       
    31 // CONSTANTS
       
    32 
       
    33 // MACROS
       
    34 
       
    35 // DATA TYPES
       
    36 
       
    37 // FUNCTION PROTOTYPES
       
    38 
       
    39 // FORWARD DECLARATIONS
       
    40 class CBTGPSPsyConnectionManager;
       
    41 class CBTGPSDeviceManager;
       
    42 class CBTGPSRequestManager;
       
    43 
       
    44 // CLASS DECLARATION
       
    45 
       
    46 /**
       
    47 *  This class manages module status report according to device
       
    48 *  connection status and fix information status.
       
    49 *  
       
    50 */
       
    51 class CBTGPSModuleStatusHandler: 
       
    52         public CBase, 
       
    53         private MBTGPSDeviceListener,
       
    54         private MBTGPSLocationFixListener,
       
    55         private MBTGPSPsyConnectionListener
       
    56     {
       
    57     public: 
       
    58 
       
    59         /**
       
    60         * Two-phase construction.
       
    61         * @param aPsyConnectionManager Reference to PSY connection manager
       
    62         * @param aDeviceManager Reference to device manager
       
    63         * @param aRequestManager Reference to request manager
       
    64         */
       
    65         static CBTGPSModuleStatusHandler * NewL(
       
    66             CBTGPSPsyConnectionManager& aPsyConnectionManager,
       
    67             CBTGPSDeviceManager& aDeviceManager,
       
    68             CBTGPSRequestManager& aRequestManager);
       
    69 
       
    70         /**
       
    71         * Destructor
       
    72         */
       
    73         virtual ~CBTGPSModuleStatusHandler();
       
    74 
       
    75     private:
       
    76 
       
    77         /**
       
    78         * From MBTGPSDeviceListener
       
    79         */
       
    80         virtual void BTDeviceStatusChanged(
       
    81             TInt aConnectStatus, 
       
    82             TInt aDeviceType,
       
    83             TInt aErr=KErrNone);
       
    84 
       
    85         /**
       
    86         * From MBTGPSLocationFixListener
       
    87         */
       
    88         virtual void HandleLocationFixUpdate(
       
    89             const CBTGPSFix& aFix);
       
    90 
       
    91         /**
       
    92         * From MBTGPSPsyConnectionListener
       
    93         */
       
    94         virtual void HandlePsyConnectionChange();
       
    95             
       
    96     private:
       
    97 
       
    98         /**
       
    99         * Second phase of the construction
       
   100         */
       
   101         void ConstructL();
       
   102 
       
   103         /**
       
   104         * Private constructor
       
   105         */
       
   106         CBTGPSModuleStatusHandler(
       
   107             CBTGPSPsyConnectionManager& aPsyConnectionManager,
       
   108             CBTGPSDeviceManager& aDeviceManager,
       
   109             CBTGPSRequestManager& aRequestManager);
       
   110         
       
   111         /**
       
   112         * Check device status
       
   113         */
       
   114         TPositionModuleStatus::TDeviceStatus GetDeviceStatus();
       
   115         
       
   116     private:
       
   117         //Positioner ext
       
   118         CBTGPSPsyConnectionManager& iPsyConnectionManager;
       
   119         
       
   120         //Device manager
       
   121         CBTGPSDeviceManager& iDeviceManager;
       
   122         
       
   123         //Request manager
       
   124         CBTGPSRequestManager& iRequestManager;
       
   125         
       
   126         //Module status
       
   127         TPositionModuleStatus iModuleStatus;
       
   128         
       
   129         //Indicate the device has been initialised
       
   130         TBool iInitialized;
       
   131     };
       
   132 #endif
       
   133 // End of File
       
   134