31
|
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>
|
42
|
23 |
#include "btqtconstants.h"
|
31
|
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,
|
42
|
33 |
public MBTEngConnObserver, public MBluetoothPhysicalLinksNotifier
|
31
|
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 ¶ms );
|
|
45 |
|
|
46 |
virtual void cancel();
|
|
47 |
|
42
|
48 |
|
31
|
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 );
|
42
|
55 |
|
|
56 |
// from MBluetoothPhysicalLinksNotifier
|
|
57 |
virtual void HandleCreateConnectionCompleteL( TInt err );
|
|
58 |
|
|
59 |
virtual void HandleDisconnectCompleteL( TInt err );
|
|
60 |
|
|
61 |
virtual void HandleDisconnectAllCompleteL( TInt err );
|
31
|
62 |
|
42
|
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 |
|
31
|
80 |
|
|
81 |
private:
|
|
82 |
|
|
83 |
CBTEngConnMan *mBtengConnMan;
|
|
84 |
|
42
|
85 |
CBluetoothPhysicalLinks *mPhyLinks;
|
|
86 |
|
|
87 |
int mMajorRole;
|
|
88 |
bool mActiveHandling;
|
31
|
89 |
|
42
|
90 |
int mAddrArrayIndex;
|
|
91 |
DisconnectOption mDisconOpt;
|
|
92 |
|
|
93 |
RBTDevAddrArray mDevAddrArray;
|
|
94 |
TBTDevAddr mBtEngAddr;
|
31
|
95 |
|
42
|
96 |
QString mDeviceName;
|
|
97 |
int mCod;
|
|
98 |
|
|
99 |
RSocketServ mSocketServ;
|
|
100 |
|
31
|
101 |
Q_DISABLE_COPY(BtDelegateDisconnect)
|
|
102 |
|
|
103 |
};
|
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
#endif /* BTDELEGATEDISCONNECT_H */
|