bluetoothengine/btui/btuidelegate/btdelegatepair.h
branchRCL_3
changeset 56 9386f31cc85b
parent 55 613943a21004
child 61 269724087bed
equal deleted inserted replaced
55:613943a21004 56:9386f31cc85b
     1 /*
       
     2 * Copyright (c) 2010 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 #ifndef BTDELEGATEPAIR_H
       
    19 #define BTDELEGATEPAIR_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <btengconnman.h>
       
    23 #include <hbdialog.h>
       
    24 #include <hbdocumentloader.h>
       
    25 #include "btabstractdelegate.h"
       
    26 
       
    27 class BtuiModel;
       
    28 
       
    29 /*!
       
    30     \class BtDelegatePair
       
    31     \brief the base class for handling Bluetooth Pair functionality.
       
    32  */
       
    33 class BtDelegatePair : public BtAbstractDelegate,
       
    34         public MBTEngConnObserver
       
    35 {
       
    36     Q_OBJECT
       
    37 
       
    38 public:
       
    39     explicit BtDelegatePair(             
       
    40             BtSettingModel* settingModel, 
       
    41             BtDeviceModel* deviceModel, QObject *parent = 0 );
       
    42     
       
    43     virtual ~BtDelegatePair();
       
    44 
       
    45     virtual void exec( const QVariant &params );
       
    46     
       
    47     virtual void cancel();
       
    48     
       
    49 public slots:
       
    50     void powerDelegateCompleted(int error);
       
    51 protected:
       
    52     //From MBTEngConnObserver
       
    53     virtual void ConnectComplete( TBTDevAddr& aAddr, TInt aErr, 
       
    54                                    RBTDevAddrArray* aConflicts );
       
    55     virtual void DisconnectComplete( TBTDevAddr& aAddr, TInt aErr );
       
    56     virtual void PairingComplete( TBTDevAddr& aAddr, TInt aErr );
       
    57 
       
    58 private:
       
    59     void launchWaitDialog();
       
    60     void emitCommandComplete(int error);
       
    61     void exec_pair();
       
    62     
       
    63 private:
       
    64 
       
    65     CBTEngConnMan *mBtengConnMan;
       
    66     HbDialog *mWaitDialog;
       
    67     QString mdeviceName;
       
    68     
       
    69     HbDocumentLoader *mLoader;
       
    70     BtAbstractDelegate* mAbstractDelegate;
       
    71     QModelIndex deviceIndex;
       
    72     
       
    73     Q_DISABLE_COPY(BtDelegatePair)
       
    74 
       
    75 };
       
    76 
       
    77 #endif /* BTDELEGATEPAIR_H */