controlpanelui/src/cpcategorymodel/src/cpcategorysettingformitemdata.cpp
changeset 10 0a74be98a8bc
child 14 23411a3be0db
equal deleted inserted replaced
0:254040eb3b7d 10:0a74be98a8bc
       
     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 #include "cpcategorysettingformitemdata.h"
       
    18 #include <QString>
       
    19 #include "cputility.h"
       
    20 
       
    21 class CpCategorySettingFormItemDataPrivate
       
    22 {
       
    23 public:
       
    24 	CpCategorySettingFormItemDataPrivate(const QString &configFile) : 
       
    25 	  mInitialized(false),
       
    26 	  mConfigFile(configFile)
       
    27 	{
       
    28 	}
       
    29 
       
    30 	~CpCategorySettingFormItemDataPrivate()
       
    31 	{
       
    32 	}
       
    33 
       
    34 public:
       
    35 	bool mInitialized;
       
    36 	QString mConfigFile;
       
    37 };
       
    38 
       
    39 
       
    40 CpCategorySettingFormItemData::CpCategorySettingFormItemData(
       
    41                HbDataFormModelItem::DataItemType type,
       
    42 	           const QString &label,
       
    43 			   const QString &configFile,
       
    44 			   const HbDataFormModelItem *parent /*= 0*/) : 
       
    45 			   CpSettingFormItemData(type,label,parent),
       
    46 			   d(new CpCategorySettingFormItemDataPrivate(configFile))
       
    47 {
       
    48 }
       
    49 
       
    50 CpCategorySettingFormItemData::CpCategorySettingFormItemData(
       
    51 			   const QString &configFile /*= QString()*/,
       
    52 			   const HbDataFormModelItem *parent /*= 0*/) : 
       
    53 	           CpSettingFormItemData(parent),
       
    54 			   d(new CpCategorySettingFormItemDataPrivate(configFile))
       
    55 {
       
    56 }
       
    57 
       
    58 CpCategorySettingFormItemData::~CpCategorySettingFormItemData()
       
    59 {
       
    60 	delete d;
       
    61 }
       
    62 
       
    63 void CpCategorySettingFormItemData::initialize(CpItemDataHelper &itemDataHelper)
       
    64 {
       
    65     //avoid to be called twice
       
    66     if (!d->mInitialized) {
       
    67         //give derived class a change do their special things before loading config plugins
       
    68         beforeLoadingConfigPlugins(itemDataHelper);
       
    69         //load plugins which are configured
       
    70 		CpUtility::buildConfigPluginItems(this,d->mConfigFile,itemDataHelper);
       
    71         //give derived class a change do their special things after loading config plugins
       
    72         afterLoadingConfigPlugins(itemDataHelper);
       
    73 
       
    74         d->mInitialized = true;
       
    75     }
       
    76 }
       
    77 
       
    78 
       
    79 void CpCategorySettingFormItemData::beforeLoadingConfigPlugins(CpItemDataHelper &/*itemDataHelper*/)
       
    80 {
       
    81 }
       
    82 
       
    83 void CpCategorySettingFormItemData::afterLoadingConfigPlugins(CpItemDataHelper &/*itemDataHelper*/)
       
    84 {
       
    85 }
       
    86