coreapplicationuis/powersaveutilities/cppsmplugin/src/cppsmplugin.cpp
branchRCL_3
changeset 19 924385140d98
equal deleted inserted replaced
18:0818dd463d41 19:924385140d98
       
     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 #include "cppsmplugin.h"
       
    18 #include "cppsmview.h"
       
    19 #include <cpsettingformentryitemdataimpl.h>
       
    20 #include <e32debug.h>
       
    21 
       
    22 
       
    23 CpPsmPlugin::CpPsmPlugin()
       
    24 {
       
    25 	RDebug::Print( _L("CpPsmPlugin::constructor:Begin") );
       
    26     iTrans=new  HbTranslator("powermanagement");
       
    27     RDebug::Print( _L("CpPsmPlugin::constructor:end") );
       
    28 }
       
    29 
       
    30 CpPsmPlugin::~CpPsmPlugin()
       
    31 {
       
    32 	RDebug::Print( _L("CpPsmPlugin::destructor:Begin") );
       
    33     delete iTrans;
       
    34     RDebug::Print( _L("CpPsmPlugin::destructor:end"));  
       
    35 }
       
    36 QList<CpSettingFormItemData*> CpPsmPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const
       
    37 {
       
    38    //QList<T> is represented as an array of pointers to items of type T,here T is CpSettingFormItemData 
       
    39    //and here the << function is used which appends object to the list
       
    40    RDebug::Print( _L("CpPsmPlugin::createSettingFormItemData:Begin") );
       
    41    return QList<CpSettingFormItemData*>() 
       
    42             << new CpSettingFormEntryItemDataImpl<CpPsmView>(
       
    43 			   itemDataHelper,
       
    44                hbTrId("txt_power_management_subhead_power_management"), 
       
    45 			   hbTrId("txt_power_list_power_save_mode"),
       
    46 			   QString("qtg_large_power_management"));
       
    47     
       
    48 }
       
    49 
       
    50 CpBaseSettingView *CpPsmPlugin::createSettingView(const QVariant &hint) const
       
    51 {
       
    52     RDebug::Print( _L("CpPsmPlugin::createSettingView:Begin") );
       
    53     if (hint.toString().compare("psm_view",Qt::CaseInsensitive) == 0) {
       
    54         return new CpPsmView;
       
    55     }
       
    56     RDebug::Print( _L("CpPsmPlugin::createSettingView:end") );
       
    57     return 0;
       
    58 }
       
    59 
       
    60 Q_EXPORT_PLUGIN2(cppsmplugin, CpPsmPlugin);