1 /* |
|
2 * Copyright (c) 2009-2010 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 #ifndef CXUISETTINGRADIOBUTTONLIST_H_ |
|
18 #define CXUISETTINGRADIOBUTTONLIST_H_ |
|
19 |
|
20 #include <QVariantList> |
|
21 #include <hbradiobuttonlist.h> |
|
22 |
|
23 class CxeEngine; |
|
24 namespace CxUiSettings { |
|
25 class RadioButtonListParams; |
|
26 } |
|
27 class CxuiSettingRadioButtonListModel; |
|
28 |
|
29 |
|
30 class CxuiSettingRadioButtonList : public HbRadioButtonList |
|
31 { |
|
32 Q_OBJECT |
|
33 |
|
34 public: |
|
35 |
|
36 enum ListBoxType |
|
37 { |
|
38 SingleLine = 1, |
|
39 TwoLine = 2 |
|
40 }; |
|
41 |
|
42 public: |
|
43 explicit CxuiSettingRadioButtonList(QGraphicsItem *parent, CxeEngine *engine); |
|
44 void init(CxUiSettings::RadioButtonListParams *data); |
|
45 |
|
46 void setOriginalSelectedItemByValue(const QVariant &value); |
|
47 signals: |
|
48 void valueSelected(int value); |
|
49 void selectionCommitted(); |
|
50 |
|
51 public slots: |
|
52 void handleSelectionAccepted(); |
|
53 void handleClose(); |
|
54 |
|
55 protected slots: |
|
56 void handleItemSelected(int index); |
|
57 |
|
58 private: |
|
59 // helper methods |
|
60 void setSettingId(const QString &id); |
|
61 void setItems(const QStringList &list); |
|
62 void setListBoxType(int type); |
|
63 void commit(int index); |
|
64 |
|
65 protected: |
|
66 CxeEngine *mEngine; |
|
67 CxuiSettingRadioButtonListModel *mListModel; |
|
68 QString mSettingId; |
|
69 QVariantList mSettingValues; |
|
70 int mOriginalIndex; |
|
71 bool mPreview; |
|
72 |
|
73 private: |
|
74 Q_DISABLE_COPY(CxuiSettingRadioButtonList) |
|
75 |
|
76 }; |
|
77 |
|
78 #endif /* CXUISETTINGRADIOBUTTONLIST_H_ */ |
|