datasourcemodules/bluetoothgpspositioningmodule/btgpspsy/inc/Connecting/BTGPSDeviceInfoHandler.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 04 Oct 2010 02:39:19 +0300
changeset 62 a72da175c1b9
parent 0 9cfd9a3ee49c
permissions -rw-r--r--
Revision: 201039 Kit: 201039

/*
* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/




#ifndef BTGPSDEVICEINFOHANDLER_H
#define BTGPSDEVICEINFOHANDLER_H

//  INCLUDES
 
#include "btgpsdevman.h"
#include "BTGPSConnectManagerExt.h"
#include <bt_sock.h>

// FORWARD DECLARATIONS
class MBTGPSConnectManagerExt;

// CLASS DECLARATION

/**
*  The handler that handles finding bonded BT devices. This class is responsible
*  to find if the device in device manager is paired. If the device is paired, 
*  KErrNone is returned through MBTGPSConnectManagerExt interface. If it's not
*  paired or any other failure, KErrNotFound is returned.
*
*/
class CBTGPSDeviceInfoHandler: public CBase, private MBTGPSDevManObserver
    {
    public: 

        /**
        * Two-phase construction.
        */
        static CBTGPSDeviceInfoHandler* NewL(
            MBTGPSConnectManagerExt& aManagerExt);

        /**
        * Destructor
        */
        virtual ~CBTGPSDeviceInfoHandler();

    private:
        /**
        * from MBTGPSDevManObserver
        */
        virtual void HandleGetDevicesComplete(TInt aErr, RBTDeviceArray* aDeviceArray);
        
        /**
        * from MBTGPSDevManObserver
        */
        virtual void HandleAddDeviceComplete(TInt aErr);

        /**
        * from MBTGPSDevManObserver
        */
        virtual void HandleDeleteDevicesComplete(TInt aErr);

    private:

        /**
        * Second phase of the construction
        */
        void ConstructL();

        /**
        * Private constructor
        * @param aManagerExt Reference to manager ext
        */
        CBTGPSDeviceInfoHandler(
            MBTGPSConnectManagerExt& aManagerExt);
            
        /**
        * Handler complete static callback function
        * @param aAny Pointer to this
        */
        static TInt HandlerCompleteCallback(TAny* aAny);
        
        /**
        * Handler complete notify function
        */
        void HandlerCompleteNotify();
        
    private:
        //Manager Ext
        MBTGPSConnectManagerExt& iManagerExt;

        //BT Device Manager
        CBTGPSDevMan* iBtDevMan;
        
        // result array needed when using CBTGPSDevMan
        RBTDeviceArray* iDeviceArray;
        
        //complet idle object
        CIdle* iIdle;
        

        //BT Scoket addr
        TBTSockAddr iBtSockAddr;
        
        //BT address validity
        TInt iValid;
        
        //Operation error code
        TInt iErrCode;

    };
#endif

// End of File