bluetoothengine/btui/btuidelegate/btdelegatedisconnect.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 BTDELEGATEDISCONNECT_H
       
    19 #define BTDELEGATEDISCONNECT_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <btengconnman.h>
       
    23 #include "btqtconstants.h"
       
    24 #include "btabstractdelegate.h"
       
    25 
       
    26 class BtuiModel;
       
    27 
       
    28 /*!
       
    29     \class BtDelegateDisconnect
       
    30     \brief the base class for Disconnecting Bluetooth Connection.
       
    31  */
       
    32 class BtDelegateDisconnect : public BtAbstractDelegate,
       
    33         public MBTEngConnObserver, public MBluetoothPhysicalLinksNotifier
       
    34 {
       
    35     Q_OBJECT
       
    36 
       
    37 public:
       
    38     explicit BtDelegateDisconnect(            
       
    39             BtSettingModel* settingModel, 
       
    40             BtDeviceModel* deviceModel, QObject *parent = 0 );
       
    41     
       
    42     virtual ~BtDelegateDisconnect();
       
    43 
       
    44     virtual void exec( const QVariant &params );
       
    45     
       
    46     virtual void cancel();
       
    47     
       
    48 
       
    49 
       
    50 protected:
       
    51     //From MBTEngConnObserver
       
    52     virtual void ConnectComplete( TBTDevAddr& aAddr, TInt aErr, 
       
    53                                    RBTDevAddrArray* aConflicts );
       
    54     virtual void DisconnectComplete( TBTDevAddr& aAddr, TInt aErr );
       
    55     
       
    56     // from MBluetoothPhysicalLinksNotifier
       
    57     virtual void HandleCreateConnectionCompleteL( TInt err );
       
    58 
       
    59     virtual void HandleDisconnectCompleteL( TInt err );
       
    60 
       
    61     virtual void HandleDisconnectAllCompleteL( TInt err );
       
    62 
       
    63     void DisplayCommandCompleteNotif(int error);
       
    64     
       
    65 private:
       
    66     
       
    67     void disconnectAllConnections_service();
       
    68     
       
    69     void disconnectAllConnections_physical();
       
    70     
       
    71     void disconnectSeviceLevel();
       
    72         
       
    73     void disconnectPhysicalLink();
       
    74     
       
    75     void disconnectServiceLevelCompleted(int err);
       
    76 
       
    77     void disconnectPhysicalLinkCompleted(int err);
       
    78     
       
    79     
       
    80     
       
    81 private:
       
    82 
       
    83     CBTEngConnMan *mBtengConnMan;
       
    84 
       
    85     CBluetoothPhysicalLinks *mPhyLinks;
       
    86 
       
    87     int mMajorRole;
       
    88     bool mActiveHandling;
       
    89     
       
    90     int mAddrArrayIndex;
       
    91     DisconnectOption mDisconOpt;
       
    92 
       
    93     RBTDevAddrArray mDevAddrArray;
       
    94     TBTDevAddr mBtEngAddr;
       
    95     
       
    96     QString mDeviceName;
       
    97     int mCod;
       
    98       
       
    99     RSocketServ mSocketServ;
       
   100        
       
   101     Q_DISABLE_COPY(BtDelegateDisconnect)
       
   102 
       
   103 };
       
   104 
       
   105 
       
   106 
       
   107 #endif /* BTDELEGATEDISCONNECT_H */