18 #ifndef BTCPUIMAINVIEW_H |
18 #ifndef BTCPUIMAINVIEW_H |
19 #define BTCPUIMAINVIEW_H |
19 #define BTCPUIMAINVIEW_H |
20 |
20 |
21 #include "btcpuibaseview.h" |
21 #include "btcpuibaseview.h" |
22 #include <btqtconstants.h> |
22 #include <btqtconstants.h> |
23 #include <QStringListModel> |
23 #include <btuimodelsortfilter.h> |
24 |
24 |
25 class HbLabel; |
25 class HbLabel; |
26 class HbLineEdit; |
26 class HbLineEdit; |
27 class HbPushButton; |
27 class HbPushButton; |
28 class HbIcon; |
28 class HbIcon; |
29 class HbComboBox; |
29 class HbComboBox; |
30 class HbDocumentLoader; |
30 class HbDocumentLoader; |
31 class HbGridView; |
31 class HbGridView; |
32 class BtAbstractDelegate; |
32 class BtAbstractDelegate; |
33 |
33 class HbListView; |
34 |
34 |
35 class BtCpUiMainView : public BtCpUiBaseView |
35 class BtCpUiMainView : public BtCpUiBaseView |
36 { |
36 { |
37 Q_OBJECT |
37 Q_OBJECT |
38 |
38 |
39 public: |
39 public: |
40 enum ViewIndex { |
40 // enum ViewIndex { |
41 MainView, |
41 // MainView, |
42 SearchView, |
42 // SearchView, |
43 DeviceView, |
43 // DeviceView, |
44 LastView |
44 // LastView |
45 }; |
45 // }; |
46 explicit BtCpUiMainView( BtuiModel &model, QGraphicsItem *parent = 0 ); |
46 explicit BtCpUiMainView( |
|
47 BtSettingModel &settingModel, |
|
48 BtDeviceModel &deviceModel, |
|
49 QGraphicsItem *parent = 0 ); |
47 ~BtCpUiMainView(); |
50 ~BtCpUiMainView(); |
48 // from view manager |
51 // from view manager |
49 void createViews(); |
52 void createViews(); |
50 |
53 |
51 Qt::Orientation orientation(); |
54 Qt::Orientation orientation(); |
58 public slots: |
61 public slots: |
59 void commandCompleted( int cmdId, int err, const QString &diagnostic ); |
62 void commandCompleted( int cmdId, int err, const QString &diagnostic ); |
60 void changeOrientation( Qt::Orientation orientation ); |
63 void changeOrientation( Qt::Orientation orientation ); |
61 void itemActivated(QModelIndex index); |
64 void itemActivated(QModelIndex index); |
62 void changePowerState(); |
65 void changePowerState(); |
|
66 |
63 void updateSettingItems(const QModelIndex &topLeft, const QModelIndex &bottomRight); |
67 void updateSettingItems(const QModelIndex &topLeft, const QModelIndex &bottomRight); |
64 |
68 void deviceSelected(const QModelIndex& modelIndex); |
65 void goToDiscoveryView(); |
69 void goToDiscoveryView(); |
|
70 void goToDeviceView(const QModelIndex& modelIndex); |
66 |
71 |
67 // from view manager |
72 // from view manager |
68 void changeView(int targetViewId, bool fromBackButton, int cmdId, const QVariant& value = 0 ); |
73 void changeView(int targetViewId, bool fromBackButton, int cmdId, const QVariant& value = 0 ); |
69 void switchToPreviousViewReally(); |
74 void switchToPreviousViewReally(); |
70 virtual void switchToPreviousView(); |
75 virtual void switchToPreviousView(); |
93 QAbstractItemModel* mSubModel; |
98 QAbstractItemModel* mSubModel; |
94 HbDocumentLoader *mLoader; |
99 HbDocumentLoader *mLoader; |
95 HbLineEdit *mDeviceNameEdit; |
100 HbLineEdit *mDeviceNameEdit; |
96 HbPushButton *mPowerButton; |
101 HbPushButton *mPowerButton; |
97 HbComboBox *mVisibilityMode; |
102 HbComboBox *mVisibilityMode; |
98 QStringListModel *mVisiListModel; |
103 HbListView *mDeviceList; |
99 HbGridView *mDeviceList; |
|
100 |
104 |
101 // data structures for switching between views |
105 // data structures for switching between views |
102 bool mEventFilterInstalled; |
106 bool mEventFilterInstalled; |
103 int mAutoCmdId; |
107 int mAutoCmdId; |
104 Qt::Orientation mOrientation; |
108 Qt::Orientation mOrientation; |
113 HbAction *mBackAction; |
117 HbAction *mBackAction; |
114 QList<int> mPreviousViewIds; |
118 QList<int> mPreviousViewIds; |
115 |
119 |
116 //poiter to abstract delegate, and it is instantiated at runtime |
120 //poiter to abstract delegate, and it is instantiated at runtime |
117 BtAbstractDelegate* mAbstractDelegate; |
121 BtAbstractDelegate* mAbstractDelegate; |
|
122 BtuiModelSortFilter *mMainFilterModel; |
118 |
123 |
119 }; |
124 }; |
120 #endif // BTCPUIMAINVIEW_H |
125 #endif // BTCPUIMAINVIEW_H |