coreapplicationuis/powersaveutilities/cppsmplugin/src/cppsmplugin.cpp
author hgs
Fri, 16 Jul 2010 10:30:52 +0300
changeset 51 50b444048a8d
permissions -rw-r--r--
201027_02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
51
50b444048a8d 201027_02
hgs
parents:
diff changeset
     1
/*
50b444048a8d 201027_02
hgs
parents:
diff changeset
     2
 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
50b444048a8d 201027_02
hgs
parents:
diff changeset
     3
 * All rights reserved.
50b444048a8d 201027_02
hgs
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
50b444048a8d 201027_02
hgs
parents:
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0""
50b444048a8d 201027_02
hgs
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
50b444048a8d 201027_02
hgs
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
50b444048a8d 201027_02
hgs
parents:
diff changeset
     8
 *
50b444048a8d 201027_02
hgs
parents:
diff changeset
     9
 * Initial Contributors:
50b444048a8d 201027_02
hgs
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
50b444048a8d 201027_02
hgs
parents:
diff changeset
    11
 *
50b444048a8d 201027_02
hgs
parents:
diff changeset
    12
 * Contributors:
50b444048a8d 201027_02
hgs
parents:
diff changeset
    13
 *
50b444048a8d 201027_02
hgs
parents:
diff changeset
    14
 * Description:  
50b444048a8d 201027_02
hgs
parents:
diff changeset
    15
 *
50b444048a8d 201027_02
hgs
parents:
diff changeset
    16
 */
50b444048a8d 201027_02
hgs
parents:
diff changeset
    17
#include "cppsmplugin.h"
50b444048a8d 201027_02
hgs
parents:
diff changeset
    18
#include "cppsmview.h"
50b444048a8d 201027_02
hgs
parents:
diff changeset
    19
#include <cpsettingformentryitemdataimpl.h>
50b444048a8d 201027_02
hgs
parents:
diff changeset
    20
#include <e32debug.h>
50b444048a8d 201027_02
hgs
parents:
diff changeset
    21
50b444048a8d 201027_02
hgs
parents:
diff changeset
    22
50b444048a8d 201027_02
hgs
parents:
diff changeset
    23
CpPsmPlugin::CpPsmPlugin()
50b444048a8d 201027_02
hgs
parents:
diff changeset
    24
{
50b444048a8d 201027_02
hgs
parents:
diff changeset
    25
	RDebug::Print( _L("CpPsmPlugin::constructor:Begin") );
50b444048a8d 201027_02
hgs
parents:
diff changeset
    26
    iTrans=new  HbTranslator("powermanagement");
50b444048a8d 201027_02
hgs
parents:
diff changeset
    27
    RDebug::Print( _L("CpPsmPlugin::constructor:end") );
50b444048a8d 201027_02
hgs
parents:
diff changeset
    28
}
50b444048a8d 201027_02
hgs
parents:
diff changeset
    29
50b444048a8d 201027_02
hgs
parents:
diff changeset
    30
CpPsmPlugin::~CpPsmPlugin()
50b444048a8d 201027_02
hgs
parents:
diff changeset
    31
{
50b444048a8d 201027_02
hgs
parents:
diff changeset
    32
	RDebug::Print( _L("CpPsmPlugin::destructor:Begin") );
50b444048a8d 201027_02
hgs
parents:
diff changeset
    33
    delete iTrans;
50b444048a8d 201027_02
hgs
parents:
diff changeset
    34
    RDebug::Print( _L("CpPsmPlugin::destructor:end"));  
50b444048a8d 201027_02
hgs
parents:
diff changeset
    35
}
50b444048a8d 201027_02
hgs
parents:
diff changeset
    36
QList<CpSettingFormItemData*> CpPsmPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const
50b444048a8d 201027_02
hgs
parents:
diff changeset
    37
{
50b444048a8d 201027_02
hgs
parents:
diff changeset
    38
   //QList<T> is represented as an array of pointers to items of type T,here T is CpSettingFormItemData 
50b444048a8d 201027_02
hgs
parents:
diff changeset
    39
   //and here the << function is used which appends object to the list
50b444048a8d 201027_02
hgs
parents:
diff changeset
    40
   RDebug::Print( _L("CpPsmPlugin::createSettingFormItemData:Begin") );
50b444048a8d 201027_02
hgs
parents:
diff changeset
    41
   return QList<CpSettingFormItemData*>() 
50b444048a8d 201027_02
hgs
parents:
diff changeset
    42
            << new CpSettingFormEntryItemDataImpl<CpPsmView>(
50b444048a8d 201027_02
hgs
parents:
diff changeset
    43
			   itemDataHelper,
50b444048a8d 201027_02
hgs
parents:
diff changeset
    44
               hbTrId("txt_power_management_subhead_power_management"), 
50b444048a8d 201027_02
hgs
parents:
diff changeset
    45
			   hbTrId("txt_power_list_power_save_mode"),
50b444048a8d 201027_02
hgs
parents:
diff changeset
    46
			   QString("qtg_large_power_management"));
50b444048a8d 201027_02
hgs
parents:
diff changeset
    47
    
50b444048a8d 201027_02
hgs
parents:
diff changeset
    48
}
50b444048a8d 201027_02
hgs
parents:
diff changeset
    49
50b444048a8d 201027_02
hgs
parents:
diff changeset
    50
CpBaseSettingView *CpPsmPlugin::createSettingView(const QVariant &hint) const
50b444048a8d 201027_02
hgs
parents:
diff changeset
    51
{
50b444048a8d 201027_02
hgs
parents:
diff changeset
    52
    RDebug::Print( _L("CpPsmPlugin::createSettingView:Begin") );
50b444048a8d 201027_02
hgs
parents:
diff changeset
    53
    if (hint.toString().compare("psm_view",Qt::CaseInsensitive) == 0) {
50b444048a8d 201027_02
hgs
parents:
diff changeset
    54
        return new CpPsmView;
50b444048a8d 201027_02
hgs
parents:
diff changeset
    55
    }
50b444048a8d 201027_02
hgs
parents:
diff changeset
    56
    RDebug::Print( _L("CpPsmPlugin::createSettingView:end") );
50b444048a8d 201027_02
hgs
parents:
diff changeset
    57
    return 0;
50b444048a8d 201027_02
hgs
parents:
diff changeset
    58
}
50b444048a8d 201027_02
hgs
parents:
diff changeset
    59
50b444048a8d 201027_02
hgs
parents:
diff changeset
    60
Q_EXPORT_PLUGIN2(cppsmplugin, CpPsmPlugin);