controlpanelui/src/cpplugins/devicelockplugin/src/cpremotelockdataformviewitem.cpp
changeset 10 0a74be98a8bc
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 "cpremotelockdataformviewitem.h"
       
    18 #include <hblabel.h>
       
    19 
       
    20 CpRemoteLockDataFormViewItem::CpRemoteLockDataFormViewItem(QGraphicsItem *parent )
       
    21 : HbDataFormViewItem(parent)
       
    22 {
       
    23 }
       
    24 
       
    25 CpRemoteLockDataFormViewItem::~CpRemoteLockDataFormViewItem()
       
    26 {
       
    27 }
       
    28 
       
    29 HbAbstractViewItem* CpRemoteLockDataFormViewItem::createItem()
       
    30 {
       
    31 	return new CpRemoteLockDataFormViewItem(*this);
       
    32 }
       
    33 
       
    34 bool CpRemoteLockDataFormViewItem::canSetModelIndex(const QModelIndex &index) const
       
    35 {
       
    36 	int type = index.data(HbDataFormModelItem::ItemTypeRole).toInt();
       
    37 	return type == CpRemoteLockItem;
       
    38 }
       
    39 
       
    40 HbWidget *CpRemoteLockDataFormViewItem::createCustomWidget()
       
    41 {
       
    42     int type = modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt();
       
    43 
       
    44 	if (type == CpRemoteLockItem) {
       
    45 		HbLabel *label = new HbLabel("Device can be locked remotely by sending lock code to the device as SMS.");
       
    46 		label->setElideMode  (Qt::ElideNone );
       
    47 		label->setTextWrapping(Hb::TextWordWrap);
       
    48 		return label;
       
    49 	}
       
    50 
       
    51 	return 0;
       
    52 }
       
    53