30 class HbIcon; |
29 class HbIcon; |
31 class HbDocumentLoader; |
30 class HbDocumentLoader; |
32 class HbDataForm; |
31 class HbDataForm; |
33 |
32 |
34 class HbDataFormModel; |
33 class HbDataFormModel; |
35 //class HbDataFormModelItem; |
34 class HbDataFormModelItem; |
36 class CpSettingFormItemData; |
35 class CpSettingFormItemData; |
37 class BtAbstractDelegate; |
36 class BtAbstractDelegate; |
38 class BtCpUiDeviceDetail; |
37 class BtCpUiDeviceDetail; |
39 |
38 |
40 class BtCpUiDeviceView : public BtCpUiBaseView |
39 class BtcpuiDeviceView : public BtcpuiBaseView |
41 { |
40 { |
42 Q_OBJECT |
41 Q_OBJECT |
43 |
42 |
44 public: |
43 public: |
45 explicit BtCpUiDeviceView( |
44 explicit BtcpuiDeviceView(BtSettingModel &settingModel, |
46 BtSettingModel &settingModel, |
|
47 BtDeviceModel &deviceModel, |
45 BtDeviceModel &deviceModel, |
48 QGraphicsItem *parent = 0); |
46 QGraphicsItem *parent = 0); |
49 virtual ~BtCpUiDeviceView(); |
47 |
50 virtual void activateView( const QVariant& value, bool fromBackButton ); |
48 virtual ~BtcpuiDeviceView(); |
|
49 virtual void activateView( const QVariant& value, bool backNavi); |
51 virtual void deactivateView(); |
50 virtual void deactivateView(); |
52 virtual void setSoftkeyBack(); |
|
53 |
51 |
54 public slots: |
52 public slots: |
55 |
53 |
56 virtual void switchToPreviousView(); |
54 void backToPreviousView(); |
57 void changeOrientation( Qt::Orientation orientation ); |
55 void changeOrientation( Qt::Orientation orientation ); |
58 void updateDeviceData(); |
56 void updateDeviceData(); |
59 void changeBtDeviceName(); |
57 void changeBtDeviceName(); |
60 void pairUnpair(); |
58 void pairDevice(); |
61 void connectDisconnect(); |
59 void unpairDevice(); |
|
60 void connectDevice(); |
|
61 void disconnectDevice(); |
62 void pairDelegateCompleted(int status); |
62 void pairDelegateCompleted(int status); |
63 void unpairDelegateCompleted(int status); |
63 void unpairDelegateCompleted(int status); |
64 void connectDelegateCompleted(int status); |
64 void connectDelegateCompleted(int status); |
65 void disconnectDelegateCompleted(int status); |
65 void disconnectDelegateCompleted(int status); |
66 void changeDevNameDelegateCompleted(int status, QVariant param); |
66 void changeDevNameDelegateCompleted(int status); |
67 void handleDeviceSetting(); |
67 void handleDeviceSetting(); |
68 void handleDeviceSettingsChange(bool status); |
68 void handleDeviceSettingsChange(bool status); |
|
69 void connectionPreferenceChanged(int index); |
69 |
70 |
70 private: |
71 private: |
|
72 enum connectionSelection { |
|
73 ConnectionAutomatic = 0, |
|
74 ConnectionAlwaysAsk, |
|
75 ConnectionBlocked |
|
76 }; |
71 void clearViewData(); |
77 void clearViewData(); |
72 void pairDevice(); |
|
73 void unpairDevice(); |
|
74 void connectDevice(); |
|
75 void disconnectDevice(); |
|
76 void setDeviceCategory(int cod, int majorRole);//cod:class of device |
78 void setDeviceCategory(int cod, int majorRole);//cod:class of device |
77 void setDeviceStatus(int majorRole); |
79 void setDeviceStatus(int majorRole); |
78 void setConnectionCombobox(); |
80 void setConnectionCombobox(); |
79 void setTextAndVisibilityOfButtons(); |
81 void setTextAndVisibilityOfButtons(int majorProperty); |
80 void updateStatusVariables(int majorRole); |
|
81 void loadDeviceDetails(); |
82 void loadDeviceDetails(); |
82 void unloadDeviceDetails(); |
83 void unloadDeviceDetails(); |
83 void setPrevBtDeviceName(); |
84 void setPrevBtDeviceName(); |
|
85 void setDeviceAuthorised(); |
|
86 void setDeviceAlwaysAsk(); |
|
87 void setDeviceBlocked(); |
|
88 void updateButton(HbPushButton *button, const QString &iconName, const QString &text); |
84 |
89 |
85 private: |
90 private: |
86 HbDocumentLoader *mLoader; |
91 HbDocumentLoader *mLoader; |
87 //HbGroupBox *mGroupBox; |
|
88 HbLabel *mDeviceIcon; |
92 HbLabel *mDeviceIcon; |
89 HbLineEdit *mDeviceName; |
93 HbLineEdit *mDeviceName; |
90 HbLabel *mDeviceCategory; |
94 HbLabel *mDeviceCategory; |
91 HbLabel *mDeviceStatus; |
95 HbLabel *mDeviceStatus; |
92 |
96 |
93 HbDataForm *mConnectionCombobox; |
97 HbDataForm *mConnectionDataForm; |
94 HbDataFormModel *mConnectionComboboxModel; |
98 HbDataFormModel *mConnectionComboboxModel; |
|
99 HbDataFormModelItem *mCombobox; |
95 |
100 |
96 HbPushButton *mPair_Unpair; |
101 HbPushButton *mPair_Unpair; |
97 HbPushButton *mConnect_Disconnect; |
102 HbPushButton *mConnect_Disconnect; |
98 HbPushButton *mDeviceSetting; |
103 HbPushButton *mDeviceSetting; |
99 |
104 |
100 |
|
101 // data structures for switching between views |
|
102 bool mEventFilterInstalled; |
|
103 int mAutoCmdId; |
|
104 Qt::Orientation mOrientation; |
|
105 |
|
106 HbMainWindow* mMainWindow; |
|
107 BtCpUiBaseView* mMainView; |
|
108 //BtCpUiBaseView* mDeviceView; |
|
109 HbAction *mSoftKeyBackAction; |
|
110 |
|
111 QModelIndex mDeviceIndex; |
105 QModelIndex mDeviceIndex; |
112 QVariant mDeviceBdAddr; |
106 QVariant mDeviceBdAddr; |
113 |
|
114 //true -> device is paired; false -> device is unpaired |
|
115 bool mPairedStatus; |
|
116 |
|
117 //true-> device is connected; false -> device is disconnected |
|
118 bool mConnectedStatus; |
|
119 bool mPreviousConnectedStatus; |
|
120 bool mTrustedStatus; |
|
121 bool mBlockedStatus; |
|
122 |
107 |
123 //true -> device is connectable |
108 int mComboboxIndex; |
124 //e.g. not possible to connect to a phone, but possible to connect to a headset |
|
125 bool mConnectable; |
|
126 |
109 |
127 BtAbstractDelegate* mAbstractDelegate; |
110 BtAbstractDelegate* mAbstractDelegate; |
128 |
111 |
129 BtCpUiDeviceDetail* mDeviceDetail; |
112 BtCpUiDeviceDetail* mDeviceDetail; |
130 |
113 |