|
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 * |
|
16 */ |
|
17 |
|
18 #ifndef PISETTINGSVIEW_H |
|
19 #define PISETTINGSVIEW_H |
|
20 |
|
21 #include <hbview.h> |
|
22 #include <qlist.h> |
|
23 |
|
24 #include "generalattributes.h" |
|
25 |
|
26 class PIProfilerEngine; |
|
27 class HbMainWindow; |
|
28 class HbDataForm; |
|
29 class HbDataFormModel; |
|
30 class HbDataFormModelItem; |
|
31 class PluginAttributes; |
|
32 class SettingItem; |
|
33 |
|
34 class PISettingsView: public HbView |
|
35 { |
|
36 Q_OBJECT |
|
37 |
|
38 public: |
|
39 |
|
40 enum OutputMode |
|
41 { |
|
42 OUTPUT_MODE_DEBUG, OUTPUT_MODE_FILE |
|
43 }; |
|
44 |
|
45 /** |
|
46 * Constructor |
|
47 */ |
|
48 PISettingsView(PIProfilerEngine *engine); |
|
49 |
|
50 /** |
|
51 * Destructor |
|
52 */ |
|
53 ~PISettingsView(); |
|
54 |
|
55 /** |
|
56 * Reads general settings from data form and returns GeneralAttributes |
|
57 */ |
|
58 GeneralAttributes& getGeneralAttributes(); |
|
59 |
|
60 /** |
|
61 * Reads plug-in specific settings from data form and saves them into mPluginlist |
|
62 */ |
|
63 void readPluginSettings(); |
|
64 |
|
65 /** |
|
66 * Sets plug-in specific settings and creates data form items for them |
|
67 */ |
|
68 void setPluginSettings(QList<PluginAttributes> *pluginList); |
|
69 |
|
70 /** |
|
71 * Expands one plug-ins settings group. Other groups are collapsed. |
|
72 */ |
|
73 void expandPluginGroup(int uid); |
|
74 |
|
75 private: |
|
76 |
|
77 /** |
|
78 * Creates general settings form items |
|
79 */ |
|
80 void createGeneralSettingForms(); |
|
81 |
|
82 /** |
|
83 * Creates plug-in specific form items |
|
84 */ |
|
85 void createPluginSpecificSettings(); |
|
86 |
|
87 /** |
|
88 * Loads general settings and updates them into form |
|
89 */ |
|
90 void loadGeneralSettings(); |
|
91 |
|
92 /** |
|
93 * Creates one plug-in setting item |
|
94 */ |
|
95 HbDataFormModelItem *createPluginSettingItem(const SettingItem *item, |
|
96 HbDataFormModelItem *parentGroup); |
|
97 |
|
98 /** |
|
99 * reads ont plug-in setting value and saves it into qstring value |
|
100 */ |
|
101 void readPluginSettingItemValue(HbDataFormModelItem *dataFormItem, SettingItem *settingItem); |
|
102 |
|
103 private slots: |
|
104 |
|
105 /** |
|
106 * Adds text validators into form items |
|
107 */ |
|
108 void addTextValidators(const QModelIndex index); |
|
109 |
|
110 private: |
|
111 |
|
112 // engine pointer |
|
113 PIProfilerEngine *mEngine; |
|
114 |
|
115 // General settings |
|
116 GeneralAttributes mGeneralAttributes; |
|
117 |
|
118 // list of plug-ins |
|
119 QList<PluginAttributes> *mPluginList; |
|
120 |
|
121 // setting form |
|
122 HbDataForm *mSettingForm; |
|
123 |
|
124 // model class |
|
125 HbDataFormModel *mModel; |
|
126 |
|
127 // data form groups |
|
128 HbDataFormModelItem *mGeneralSettingsGroup; |
|
129 HbDataFormModelItem *mPluginSettingsGroup; |
|
130 |
|
131 // general setting items |
|
132 HbDataFormModelItem *mOutputItem; |
|
133 HbDataFormModelItem *mFileLocation; |
|
134 HbDataFormModelItem *mPrefix; |
|
135 HbDataFormModelItem *mSamplingPeriod; |
|
136 |
|
137 HbDataFormModelItem *testItem;//TODO remove! |
|
138 }; |
|
139 |
|
140 #endif // PISETTINGSVIEW_H |