videocollection/videofiledetailsview/tsrc/testplugin/stub/src/hbmessagebox.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 27 May 2010 12:53:14 +0300
changeset 24 7d93ee07fb27
parent 15 cf5481c2bc0b
child 44 518105d52e45
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 hbmessagebox
* 
*/

#include "hbmessagebox.h"

QString HbMessageBox::mLatestTxt = "";
int HbMessageBox::mType = -1;
int HbMessageBox::mAttribute = -1;
int HbMessageBox::mOpenCallCount = 0;
int HbMessageBox::mShowCallCount = 0;

HbMessageBox::HbMessageBox(MessageBoxType type, QGraphicsItem *parent)
{
    Q_UNUSED(parent);
    HbMessageBox::mType = type;
    
    HbAction *action = new HbAction();
    mActions.append(action);
    action = new HbAction();
    mActions.append(action);   
}

HbMessageBox::HbMessageBox(const QString &text, MessageBoxType type, QGraphicsItem *parent)
{
    Q_UNUSED(parent);
    HbMessageBox::mLatestTxt = text;
    HbMessageBox::mType = type;
    
    HbAction *action = new HbAction();
    mActions.append(action);
    action = new HbAction();
    mActions.append(action);   
}

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

void HbMessageBox::show()
{
    HbMessageBox::mShowCallCount++;
}

void HbMessageBox::open( QObject* receiver, const char* member )
{
    Q_UNUSED(receiver);
    Q_UNUSED(member);
    HbMessageBox::mOpenCallCount++;
}

void HbMessageBox::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 HbMessageBox::setAttribute(int attribute)
{
    HbMessageBox::mAttribute = attribute;
}