9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: |
14 * Description: An extension to CpSettingFormItemData, can be filled with model items comes from controlpanel plugins. |
15 * |
15 * |
16 */ |
16 */ |
17 #include "cpcategorysettingformitemdata.h" |
17 #include "cpcategorysettingformitemdata.h" |
18 #include <QString> |
18 #include <QString> |
19 #include "cpcategorymodelutility.h" |
19 #include "cpcategorymodelutility.h" |
20 |
20 |
|
21 /* |
|
22 * Private implementation |
|
23 */ |
21 class CpCategorySettingFormItemDataPrivate |
24 class CpCategorySettingFormItemDataPrivate |
22 { |
25 { |
23 public: |
26 public: |
24 CpCategorySettingFormItemDataPrivate(const QString &configFile) : |
27 CpCategorySettingFormItemDataPrivate(const QString &configFile) : |
25 mInitialized(false), |
28 mInitialized(false), |
34 public: |
37 public: |
35 bool mInitialized; |
38 bool mInitialized; |
36 QString mConfigFile; |
39 QString mConfigFile; |
37 }; |
40 }; |
38 |
41 |
39 |
42 /* |
|
43 * Constructor |
|
44 */ |
40 CpCategorySettingFormItemData::CpCategorySettingFormItemData( |
45 CpCategorySettingFormItemData::CpCategorySettingFormItemData( |
41 HbDataFormModelItem::DataItemType type, |
46 HbDataFormModelItem::DataItemType type, |
42 const QString &label, |
47 const QString &label, |
43 const QString &configFile, |
48 const QString &configFile, |
44 const HbDataFormModelItem *parent /*= 0*/) : |
49 const HbDataFormModelItem *parent /*= 0*/) : |
45 CpSettingFormItemData(type,label,parent), |
50 CpSettingFormItemData(type,label,parent), |
46 d(new CpCategorySettingFormItemDataPrivate(configFile)) |
51 d(new CpCategorySettingFormItemDataPrivate(configFile)) |
47 { |
52 { |
48 } |
53 } |
49 |
54 |
|
55 /* |
|
56 * Overloaded constructor |
|
57 */ |
50 CpCategorySettingFormItemData::CpCategorySettingFormItemData( |
58 CpCategorySettingFormItemData::CpCategorySettingFormItemData( |
51 const QString &configFile /*= QString()*/, |
59 const QString &configFile /*= QString()*/, |
52 const HbDataFormModelItem *parent /*= 0*/) : |
60 const HbDataFormModelItem *parent /*= 0*/) : |
53 CpSettingFormItemData(parent), |
61 CpSettingFormItemData(parent), |
54 d(new CpCategorySettingFormItemDataPrivate(configFile)) |
62 d(new CpCategorySettingFormItemDataPrivate(configFile)) |
55 { |
63 { |
56 } |
64 } |
57 |
65 |
|
66 /* |
|
67 * Desctructor |
|
68 */ |
58 CpCategorySettingFormItemData::~CpCategorySettingFormItemData() |
69 CpCategorySettingFormItemData::~CpCategorySettingFormItemData() |
59 { |
70 { |
60 delete d; |
71 delete d; |
61 } |
72 } |
62 |
73 |
|
74 /* |
|
75 * Initialize |
|
76 */ |
63 void CpCategorySettingFormItemData::initialize(CpItemDataHelper &itemDataHelper) |
77 void CpCategorySettingFormItemData::initialize(CpItemDataHelper &itemDataHelper) |
64 { |
78 { |
65 //avoid to be called twice |
79 //avoid to be called twice |
66 if (!d->mInitialized) { |
80 if (!d->mInitialized) { |
67 //give derived class a chance do their special things before loading config plugins |
81 //give derived class a chance do their special things before loading config plugins |
80 |
94 |
81 d->mInitialized = true; |
95 d->mInitialized = true; |
82 } |
96 } |
83 } |
97 } |
84 |
98 |
85 |
99 /* |
|
100 * Derived class can override this function to do some specific work before loading config plugins |
|
101 */ |
86 void CpCategorySettingFormItemData::beforeLoadingConfigPlugins(CpItemDataHelper &/*itemDataHelper*/) |
102 void CpCategorySettingFormItemData::beforeLoadingConfigPlugins(CpItemDataHelper &/*itemDataHelper*/) |
87 { |
103 { |
88 } |
104 } |
89 |
105 /* |
|
106 * Derived class can override this function to do some specific work before loading config plugins |
|
107 */ |
90 void CpCategorySettingFormItemData::afterLoadingConfigPlugins(CpItemDataHelper &/*itemDataHelper*/) |
108 void CpCategorySettingFormItemData::afterLoadingConfigPlugins(CpItemDataHelper &/*itemDataHelper*/) |
91 { |
109 { |
92 } |
110 } |
93 |
111 |
|
112 //End of File |