30 \class BtDelegatePower |
30 \class BtDelegatePower |
31 \brief the base class for handling Bluetooth power management. |
31 \brief the base class for handling Bluetooth power management. |
32 |
32 |
33 \\sa btuidelegate |
33 \\sa btuidelegate |
34 */ |
34 */ |
35 class BtDelegatePower : public BtAbstractDelegate, public MBTEngSettingsObserver, |
35 class BtDelegatePower : public BtAbstractDelegate, public MBTEngSettingsObserver |
36 public MBTEngConnObserver |
|
37 { |
36 { |
38 Q_OBJECT |
37 Q_OBJECT |
39 |
38 |
40 public: |
39 public: |
41 explicit BtDelegatePower( |
40 explicit BtDelegatePower( |
42 BtSettingModel* settingModel, |
41 BtSettingModel* settingModel, |
43 BtDeviceModel* deviceModel, QObject *parent = 0 ); |
42 BtDeviceModel* deviceModel, QObject *parent = 0 ); |
44 |
43 |
45 virtual ~BtDelegatePower(); |
44 virtual ~BtDelegatePower(); |
46 |
45 |
|
46 int supportedEditorTypes() const; |
|
47 |
47 virtual void exec( const QVariant ¶ms ); |
48 virtual void exec( const QVariant ¶ms ); |
48 |
49 |
49 //from MBTEngSettingsObserver |
50 //from MBTEngSettingsObserver |
50 |
51 |
51 virtual void PowerStateChanged( TBTPowerStateValue aState ); |
52 virtual void PowerStateChanged( TBTPowerStateValue state ); |
52 |
53 |
53 virtual void VisibilityModeChanged( TBTVisibilityMode aState ); |
54 virtual void VisibilityModeChanged( TBTVisibilityMode state ); |
54 |
55 |
55 public slots: |
56 public slots: |
56 void btOnQuestionClose(int action); |
57 void btOnQuestionClose(int action); |
57 |
58 |
58 void btOnWarningClose(); |
59 void btOnWarningClose(); |
59 |
60 |
60 void disconnectDelegateCompleted(int err); |
61 void disconnectCompleted(int err, BtAbstractDelegate *delegate); |
61 |
|
62 |
|
63 protected: |
|
64 //From MBTEngConnObserver |
|
65 virtual void ConnectComplete( TBTDevAddr& aAddr, TInt aErr, |
|
66 RBTDevAddrArray* aConflicts ); |
|
67 virtual void DisconnectComplete( TBTDevAddr& aAddr, TInt aErr ); |
|
68 |
|
69 |
62 |
70 private: |
63 private: |
71 void switchBTOn(); |
64 void switchBTOn(); |
72 |
65 |
73 void switchBTOff(); |
66 void switchBTOff(); |
74 |
67 |
75 bool checkOfflineMode(bool& btEnabledInOffline); |
68 bool checkOfflineMode(bool& btEnabledInOffline); |
76 |
69 |
77 void disconnectOngoingConnections(); |
70 void disconnectConnections(); |
78 |
71 |
79 |
|
80 private: |
72 private: |
81 CBTEngSettings* mBtengSettings; |
73 CBTEngSettings* mBtengSettings; |
82 bool mActiveHandling; |
74 TBTPowerStateValue mReqPowerState; |
83 TBTPowerStateValue mReqPowerState; |
|
84 |
|
85 BtAbstractDelegate* mDisconnectDelegate; |
75 BtAbstractDelegate* mDisconnectDelegate; |
86 |
76 |
87 |
|
88 private: |
77 private: |
89 |
78 |
90 Q_DISABLE_COPY(BtDelegatePower) |
79 Q_DISABLE_COPY(BtDelegatePower) |
91 |
80 |
92 }; |
81 }; |