bluetoothengine/btui/btuidelegate/btabstractdelegate.cpp
author hgs
Mon, 12 Jul 2010 18:51:05 +0300
changeset 42 b72428996822
parent 31 a0ea99b6fa53
child 57 5ebadcda06cb
permissions -rw-r--r--
201025

/*
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: 
*
*/


#include "btabstractdelegate.h"
#include "btqtconstants.h"

#include <btsettingmodel.h>
#include <btdevicemodel.h>

/*!
    Constructor.
 */
BtAbstractDelegate::BtAbstractDelegate( BtSettingModel *settingModel, 
        BtDeviceModel *deviceModel, QObject *parent )
    : QObject( parent ), mSettingModel(settingModel),mDeviceModel(deviceModel)
{
}

/*!
    Destructor.
 */
BtAbstractDelegate::~BtAbstractDelegate()
{
}

BtSettingModel *BtAbstractDelegate::getSettingModel()
{
    return mSettingModel;
}

BtDeviceModel *BtAbstractDelegate::getDeviceModel()
{
    return mDeviceModel;
}

void BtAbstractDelegate::cancel()
{
    
}

bool BtAbstractDelegate::isBtPowerOn()
{
    QModelIndex powerIndex = getSettingModel()->index(BtSettingModel::PowerStateRow, 0);
    PowerStateQtValue powerState = (PowerStateQtValue)getSettingModel()->data(powerIndex, BtSettingModel::SettingValueRole).toInt();
    
    return (BtPowerOn == powerState);
}