videocollection/tsrc/stubs/src/hbinputdialog.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 27 May 2010 12:53:14 +0300
changeset 24 7d93ee07fb27
parent 17 69946d1824c4
child 28 c48470be1ba7
permissions -rw-r--r--
Revision: 201019 Kit: 2010121

/*
* Copyright (c) 2009 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: stub hbinputdialog
* 
*/

#include "hbinputdialog.h"
#include "testobjectstore.h"

int HbInputDialog::mGetTextCallCount = 0;
int HbInputDialog::mAttribute = -1;
QString HbInputDialog::mLastHeading = "";
QString HbInputDialog::mLastText = "";
QVariant HbInputDialog::mValueReturnValue = QVariant();
int HbInputDialog::mValueCallCount = 0;

HbInputDialog::HbInputDialog(QGraphicsItem *parent) : HbWidget(parent) 
{
    HbAction *action = new HbAction();
    mActions.append(action);
    action = new HbAction();
    mActions.append(action);
    
    TestObjectStore::instance().addObject(this);
}

HbInputDialog::~HbInputDialog()
{
    while(!mActions.isEmpty())
    {
        delete mActions.takeFirst();
    }
}   

void HbInputDialog::getText(const QString &heading
        ,QObject *receiver
        ,const char *member
        ,const QString &text
        ,QGraphicsScene *scene
        ,QGraphicsItem *parent)
{
    Q_UNUSED(receiver);
    Q_UNUSED(member);
    Q_UNUSED(scene);
    Q_UNUSED(parent);
    
    mLastHeading = heading;
    mLastText = text;
    mGetTextCallCount++;
}

void HbInputDialog::emitDialogFinished( QObject* receiver, const char* member, int actionNum )
{
    if(connect(this, SIGNAL(finished(HbAction *)), receiver, member))
    {
        emit finished(mActions.value(actionNum));
        disconnect(this, SIGNAL(finished(HbAction *)), receiver, member);
    }
}

void HbInputDialog::setAttribute(int attribute)
{
    HbInputDialog::mAttribute = attribute;
}