18 #ifndef BTDELEGATEDISCONNECT_H |
18 #ifndef BTDELEGATEDISCONNECT_H |
19 #define BTDELEGATEDISCONNECT_H |
19 #define BTDELEGATEDISCONNECT_H |
20 |
20 |
21 #include <e32base.h> |
21 #include <e32base.h> |
22 #include <btengconnman.h> |
22 #include <btengconnman.h> |
|
23 #include "btqtconstants.h" |
23 #include "btabstractdelegate.h" |
24 #include "btabstractdelegate.h" |
24 |
25 |
25 class BtuiModel; |
26 class BtuiModel; |
26 |
27 |
27 /*! |
28 /*! |
28 \class BtDelegateDisconnect |
29 \class BtDelegateDisconnect |
29 \brief the base class for Disconnecting Bluetooth Connection. |
30 \brief the base class for Disconnecting Bluetooth Connection. |
30 */ |
31 */ |
31 class BtDelegateDisconnect : public BtAbstractDelegate, |
32 class BtDelegateDisconnect : public BtAbstractDelegate, |
32 public MBTEngConnObserver |
33 public MBTEngConnObserver, public MBluetoothPhysicalLinksNotifier |
33 { |
34 { |
34 Q_OBJECT |
35 Q_OBJECT |
35 |
36 |
36 public: |
37 public: |
37 explicit BtDelegateDisconnect( |
38 explicit BtDelegateDisconnect( |
42 |
43 |
43 virtual void exec( const QVariant ¶ms ); |
44 virtual void exec( const QVariant ¶ms ); |
44 |
45 |
45 virtual void cancel(); |
46 virtual void cancel(); |
46 |
47 |
47 public slots: |
48 |
48 |
49 |
49 protected: |
50 protected: |
50 //From MBTEngConnObserver |
51 //From MBTEngConnObserver |
51 virtual void ConnectComplete( TBTDevAddr& aAddr, TInt aErr, |
52 virtual void ConnectComplete( TBTDevAddr& aAddr, TInt aErr, |
52 RBTDevAddrArray* aConflicts ); |
53 RBTDevAddrArray* aConflicts ); |
53 virtual void DisconnectComplete( TBTDevAddr& aAddr, TInt aErr ); |
54 virtual void DisconnectComplete( TBTDevAddr& aAddr, TInt aErr ); |
54 virtual void PairingComplete( TBTDevAddr& aAddr, TInt aErr ); |
55 |
|
56 // from MBluetoothPhysicalLinksNotifier |
|
57 virtual void HandleCreateConnectionCompleteL( TInt err ); |
55 |
58 |
56 void emitCommandComplete(int error); |
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 |
57 |
80 |
58 private: |
81 private: |
59 |
82 |
60 CBTEngConnMan *mBtengConnMan; |
83 CBTEngConnMan *mBtengConnMan; |
61 |
84 |
62 TBTDevAddr mBtEngddr; |
85 CBluetoothPhysicalLinks *mPhyLinks; |
|
86 |
|
87 int mMajorRole; |
|
88 bool mActiveHandling; |
63 |
89 |
64 QString mdeviceName; |
90 int mAddrArrayIndex; |
|
91 DisconnectOption mDisconOpt; |
|
92 |
|
93 RBTDevAddrArray mDevAddrArray; |
|
94 TBTDevAddr mBtEngAddr; |
65 |
95 |
|
96 QString mDeviceName; |
|
97 int mCod; |
|
98 |
|
99 RSocketServ mSocketServ; |
|
100 |
66 Q_DISABLE_COPY(BtDelegateDisconnect) |
101 Q_DISABLE_COPY(BtDelegateDisconnect) |
67 |
102 |
68 }; |
103 }; |
69 |
104 |
70 |
105 |