|
1 /* |
|
2 * Copyright (c) 2009 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 |
|
19 #ifndef BTDEVICESEARCHDIALOGWIDGET_H |
|
20 #define BTDEVICESEARCHDIALOGWIDGET_H |
|
21 |
|
22 #include <QObject> |
|
23 #include <QVariantMap> |
|
24 #include <hbdialog.h> |
|
25 #include <hbdevicedialoginterface.h> |
|
26 #include <hbpopup.h> |
|
27 #include <hbdocumentloader.h> |
|
28 #include <qstandarditemmodel.h> |
|
29 #include <hbradiobuttonlist.h> |
|
30 #include <hblistwidget.h> |
|
31 |
|
32 |
|
33 struct device |
|
34 { |
|
35 QString mDeviceName; |
|
36 QString mDeviceType; |
|
37 int mDeviceIdx; |
|
38 }; |
|
39 |
|
40 class BTDeviceSearchDialogWidget : public HbDialog, |
|
41 public HbDeviceDialogInterface |
|
42 { |
|
43 Q_OBJECT |
|
44 |
|
45 public: |
|
46 BTDeviceSearchDialogWidget(const QVariantMap ¶meters); |
|
47 ~BTDeviceSearchDialogWidget(); |
|
48 |
|
49 public: // from HbDeviceDialogInterface |
|
50 bool setDeviceDialogParameters(const QVariantMap ¶meters); |
|
51 int deviceDialogError() const; |
|
52 void closeDeviceDialog(bool byClient); |
|
53 HbPopup *deviceDialogWidget() const; |
|
54 |
|
55 public slots: |
|
56 void stopClicked(); |
|
57 void retryClicked(); |
|
58 // void viewByClicked(); |
|
59 void deviceSelected(const QModelIndex& modelIndex); |
|
60 // void viewByItemSelected(int index); |
|
61 |
|
62 private: |
|
63 bool constructDialog(const QVariantMap ¶meters); |
|
64 void hideEvent(QHideEvent *event); |
|
65 void showEvent(QShowEvent *event); |
|
66 void appendToDeviceList(const QString deviceName); |
|
67 bool appendToDeviceTypeList(const QString deviceType); |
|
68 QIcon icon(); |
|
69 |
|
70 signals: |
|
71 void deviceDialogClosed(); |
|
72 void deviceDialogData(QVariantMap data); |
|
73 |
|
74 private: |
|
75 HbDocumentLoader *mLoader; |
|
76 |
|
77 /** |
|
78 * |
|
79 * item model for content list view. |
|
80 */ |
|
81 |
|
82 QStandardItemModel* mContentItemModel; |
|
83 HbDialog* mViewByDialog; |
|
84 HbRadioButtonList* mRbl; |
|
85 QList<QString> mDeviceTypeList; |
|
86 QList<device> mDeviceList; |
|
87 HbListView* mListView; |
|
88 bool mViewByChosen; |
|
89 QList<device> mDeviceLstOfType; |
|
90 int mDeviceLstIdx; |
|
91 int mSelectedType; |
|
92 int mDeviceDialogData; |
|
93 |
|
94 Q_DISABLE_COPY(BTDeviceSearchDialogWidget) |
|
95 }; |
|
96 |
|
97 #endif /* BTDEVICESEARCHDIALOGWIDGET_H */ |