|
1 /* |
|
2 * Copyright (c) 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 * Dialog implementation for the CM Manager Application Settings UI. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef CMRADIODIALOG_H |
|
20 #define CMRADIODIALOG_H |
|
21 |
|
22 // System includes |
|
23 |
|
24 #include <QObject> |
|
25 #include <QSet> |
|
26 #include <QStringList> |
|
27 #include <QSharedPointer> |
|
28 |
|
29 // User includes |
|
30 |
|
31 // Forward declarations |
|
32 |
|
33 class HbDialog; |
|
34 class HbLabel; |
|
35 class HbRadioButtonList; |
|
36 class HbAction; |
|
37 class HbDocumentLoader; |
|
38 class TestCmApplSettingsUi; |
|
39 |
|
40 // External data types |
|
41 |
|
42 // Constants |
|
43 |
|
44 // Supported dialog types |
|
45 enum CmRadioDialogType { |
|
46 CmRadioDialogTypeDestination = 1, //!< Destination selection dialog |
|
47 CmRadioDialogTypeAccessPoint //!< Access point selection dialog |
|
48 }; |
|
49 |
|
50 // Supported options |
|
51 enum CmRadioDialogOpt { |
|
52 CmRadioDialogOptDedicatedAP = 1 //!< Append "Dedicated access point" |
|
53 }; |
|
54 |
|
55 // Class declaration |
|
56 |
|
57 class CmRadioDialog : public QObject |
|
58 { |
|
59 Q_OBJECT |
|
60 |
|
61 public: |
|
62 |
|
63 // Data types |
|
64 |
|
65 explicit CmRadioDialog(QObject *parent = 0); |
|
66 |
|
67 ~CmRadioDialog(); |
|
68 |
|
69 void setType(CmRadioDialogType type); |
|
70 |
|
71 void setOptions(const QSet<CmRadioDialogOpt> &options); |
|
72 |
|
73 void setItems(const QStringList &list); |
|
74 |
|
75 void setSelected(int index); |
|
76 |
|
77 int selected() const; |
|
78 |
|
79 void open(); |
|
80 |
|
81 signals: |
|
82 |
|
83 /*! |
|
84 * Signal used for informing that the dialog has finished. |
|
85 * |
|
86 * @param[in] success Dialog run success. This is true if OK was pressed. |
|
87 */ |
|
88 void finished(bool success); |
|
89 |
|
90 public slots: |
|
91 |
|
92 void dialogClosed(HbAction *action); |
|
93 |
|
94 protected: |
|
95 |
|
96 protected slots: |
|
97 |
|
98 private: |
|
99 |
|
100 void setHeading(); |
|
101 |
|
102 private slots: |
|
103 |
|
104 void loadDocml(); |
|
105 |
|
106 private: // data |
|
107 |
|
108 // Owned data |
|
109 CmRadioDialogType mType; //!< Radio dialog type |
|
110 QSet<CmRadioDialogOpt> mOptions; //!< Radio dialog options |
|
111 QSharedPointer<HbDocumentLoader> mLoader; //!< Dialog document loader |
|
112 QStringList mListItems; //!< Dialog radio button items |
|
113 QSharedPointer<HbDialog> mDialog; //!< Dialog reference |
|
114 |
|
115 // Not owned data |
|
116 HbLabel *mHeading; //!< Dialog title |
|
117 HbRadioButtonList *mList; //!< Dialog's radio button list |
|
118 HbAction *mOkAction; //!< Dialog's OK button action |
|
119 |
|
120 // Friend classes |
|
121 |
|
122 // Test class needs direct access |
|
123 friend class TestCmApplSettingsUi; |
|
124 }; |
|
125 |
|
126 #endif // CMRADIODIALOG_H |