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 BTDELEGATECONNECT_H |
|
19 #define BTDELEGATECONNECT_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <btengconnman.h> |
|
23 #include "btabstractdelegate.h" |
|
24 #include <hbaction.h> |
|
25 |
|
26 class BtuiModel; |
|
27 |
|
28 /*! |
|
29 \class BtDelegateConnect |
|
30 \brief the base class for handling Bluetooth Connection. |
|
31 */ |
|
32 class BtDelegateConnect : public BtAbstractDelegate, |
|
33 public MBTEngConnObserver |
|
34 { |
|
35 Q_OBJECT |
|
36 |
|
37 public: |
|
38 explicit BtDelegateConnect( |
|
39 BtSettingModel* settingModel, |
|
40 BtDeviceModel* deviceModel, |
|
41 QObject *parent = 0 ); |
|
42 |
|
43 virtual ~BtDelegateConnect(); |
|
44 virtual void exec( const QVariant ¶ms ); |
|
45 virtual void cancel(); |
|
46 |
|
47 public slots: |
|
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 private slots: |
|
57 void handleUserAnswer( int answer ); |
|
58 void powerDelegateCompleted(int status); |
|
59 void disconnectDelegateCompleted(int status); |
|
60 |
|
61 private: |
|
62 void exec_connect(); |
|
63 void emitCommandComplete(int error); |
|
64 bool callOngoing(); |
|
65 |
|
66 private: |
|
67 QModelIndex mIndex; |
|
68 QModelIndex mConflictDevIndex; |
|
69 CBTEngConnMan *mBtengConnMan; |
|
70 QString mDeviceName; |
|
71 int mMajorProperty; |
|
72 int mCod; |
|
73 BtAbstractDelegate* mAbstractDelegate; |
|
74 bool mActiveHandling; |
|
75 TBTDevAddr mAddr; |
|
76 |
|
77 Q_DISABLE_COPY(BtDelegateConnect) |
|
78 |
|
79 }; |
|
80 |
|
81 |
|
82 #endif /* BTDELEGATECONNECT_H */ |
|