53 |
48 |
54 Qt::Orientation orientation(); |
49 Qt::Orientation orientation(); |
55 |
50 |
56 // from base class BtCpUiBaseView |
51 // from base class BtCpUiBaseView |
57 virtual void setSoftkeyBack(); |
52 virtual void setSoftkeyBack(); |
58 virtual void activateView( const QVariant& value, int cmdId ); |
53 virtual void activateView( const QVariant& value, bool fromBackButton ); |
59 virtual void deactivateView(); |
54 virtual void deactivateView(); |
60 |
55 |
61 public slots: |
56 public slots: |
62 void commandCompleted( int cmdId, int err, const QString &diagnostic ); |
|
63 void changeOrientation( Qt::Orientation orientation ); |
57 void changeOrientation( Qt::Orientation orientation ); |
64 void itemActivated(QModelIndex index); |
|
65 void changePowerState(); |
58 void changePowerState(); |
|
59 void visibilityChanged (int index); |
|
60 void changeBtLocalName(); |
66 |
61 |
67 void updateSettingItems(const QModelIndex &topLeft, const QModelIndex &bottomRight); |
62 void updateSettingItems(const QModelIndex &topLeft, const QModelIndex &bottomRight); |
68 void deviceSelected(const QModelIndex& modelIndex); |
63 void deviceSelected(const QModelIndex& modelIndex); |
69 void goToDiscoveryView(); |
64 void goToDiscoveryView(); |
70 void goToDeviceView(const QModelIndex& modelIndex); |
65 void goToDeviceView(const QModelIndex& modelIndex); |
71 |
|
72 // from view manager |
|
73 void changeView(int targetViewId, bool fromBackButton, int cmdId, const QVariant& value = 0 ); |
|
74 void switchToPreviousViewReally(); |
|
75 virtual void switchToPreviousView(); |
66 virtual void switchToPreviousView(); |
76 |
67 |
77 void visibilityChanged (int index); |
|
78 void changeBtLocalName(); |
|
79 |
|
80 //from delegate classes |
68 //from delegate classes |
81 void powerDelegateCompleted(int status); |
69 void powerDelegateCompleted(int status); |
82 void visibilityDelegateCompleted(int status); |
70 void visibilityDelegateCompleted(int status); |
83 void btNameDelegateCompleted(int status, QVariant param); |
71 void btNameDelegateCompleted(int status, QVariant param); |
|
72 void allActionTriggered(); |
|
73 void pairActionTriggered(); |
84 |
74 |
85 protected: |
75 private slots: |
|
76 void changeView(int targetViewId, bool fromBackButton, const QVariant& value = 0 ); |
86 |
77 |
|
78 private: |
|
79 enum filterType { |
|
80 BtuiAll = 0, |
|
81 BtuiPaired |
|
82 }; |
87 |
83 |
88 private: |
84 private: |
89 VisibilityMode indexToVisibilityMode(int index); |
85 VisibilityMode indexToVisibilityMode(int index); |
90 int visibilityModeToIndex(VisibilityMode mode); |
86 int visibilityModeToIndex(VisibilityMode mode); |
91 BtCpUiBaseView * idToView(int targetViewId); |
87 BtCpUiBaseView * idToView(int targetViewId); |
92 |
88 |
93 //Functions to set the Previous Local settings in case of error |
89 //Functions to set the Previous Local settings in case of error |
94 void setPrevBtLocalName(); |
90 void setPrevBtLocalName(); |
95 void setPrevVisibilityMode(); |
91 void setPrevVisibilityMode(); |
96 |
92 |
|
93 void updateDeviceListFilter(BtCpUiMainView::filterType filter); |
|
94 |
97 private: |
95 private: |
98 QAbstractItemModel* mSubModel; |
96 |
99 HbDocumentLoader *mLoader; |
97 HbDocumentLoader *mLoader; |
|
98 |
100 HbLineEdit *mDeviceNameEdit; |
99 HbLineEdit *mDeviceNameEdit; |
101 HbPushButton *mPowerButton; |
100 HbPushButton *mPowerButton; |
102 HbComboBox *mVisibilityMode; |
101 HbComboBox *mVisibilityMode; |
103 HbListView *mDeviceList; |
102 HbListView *mDeviceList; |
104 |
103 |
105 // data structures for switching between views |
|
106 bool mEventFilterInstalled; |
|
107 int mAutoCmdId; |
|
108 Qt::Orientation mOrientation; |
104 Qt::Orientation mOrientation; |
109 |
105 |
110 // from view manager |
106 // from view manager |
111 HbMainWindow* mMainWindow; |
107 HbMainWindow* mMainWindow; |
112 BtCpUiBaseView* mMainView; |
108 BtCpUiBaseView* mMainView; |
113 BtCpUiBaseView* mDeviceView; |
109 BtCpUiBaseView* mDeviceView; |
114 BtCpUiBaseView* mSearchView; |
110 BtCpUiBaseView* mSearchView; |
115 BtCpUiBaseView* mCurrentView; |
111 BtCpUiBaseView* mCurrentView; |
116 int mCurrentViewId; |
112 int mCurrentViewId; |
117 HbAction *mBackAction; |
|
118 QList<int> mPreviousViewIds; |
113 QList<int> mPreviousViewIds; |
119 |
114 |
120 //poiter to abstract delegate, and it is instantiated at runtime |
115 //poiter to abstract delegate, and it is instantiated at runtime |
121 BtAbstractDelegate* mAbstractDelegate; |
116 BtAbstractDelegate* mAbstractDelegate; |
122 BtuiModelSortFilter *mMainFilterModel; |
117 BtuiModelSortFilter *mMainFilterModel; |
123 |
118 |
|
119 HbAction *mAllAction; |
|
120 HbAction *mPairAction; |
|
121 HbGroupBox *mGroupBox; |
124 }; |
122 }; |
125 #endif // BTCPUIMAINVIEW_H |
123 #endif // BTCPUIMAINVIEW_H |