videocollection/tsrc/stubs/inc/hbmessagebox.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 11 Jun 2010 13:39:54 +0300
changeset 28 c48470be1ba7
parent 24 7d93ee07fb27
child 44 518105d52e45
child 52 e3cecb93e76a
permissions -rw-r--r--
Revision: 201021 Kit: 2010123

/*
* Copyright (c) 2008-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:  HbMessageBox class declaration.
*
*/


#ifndef HBMESSAGEBOX_H
#define HBMESSAGEBOX_H

#include <qobject.h>
#include <qstring.h>
#include "hbaction.h"

class QGraphicsWidget;
class QGraphicsScene;
class QGraphicsItem;

class HbMessageBox : public QObject
{   
    Q_OBJECT
    
public:
    enum MessageBoxType {
        MessageTypeInformation,
        MessageTypeQuestion,
        MessageTypeWarning
    };
    
    HbMessageBox(MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
    HbMessageBox(const QString &text, MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
    ~HbMessageBox();
    
    /**
    * Create new HbMessageBox and call emitDialogFinished after this one to finish the sequence.
     */
    void open( QObject* receiver = 0, const char* member = 0 );
    
    void emitDialogFinished( QObject* receiver, const char* member, int actionNum );

    void show();
    
    void setAttribute(int attribute);
    
    /** stubbed from HbMessgeBox */
/*    static void question(const QString &questionText,
                            QObject *receiver,
                            const char *member,
                            const QString &primaryButtonText = tr("Yes"),
                            const QString &secondaryButtonText = tr("No"),
                            QGraphicsWidget *headWidget = 0,
                            QGraphicsScene *scene = 0,
                            QGraphicsItem *parent = 0 );*/

    /** stubbed from HbMessgeBox */
    static void information(const QString &informationText,
        QGraphicsWidget *headWidget = 0,
        QGraphicsScene *scene = 0,
        QGraphicsItem *parent = 0);

    /** stubbed from HbMessgeBox */
    static void warning(const QString &warningText,
        QGraphicsWidget *headWidget = 0,
        QGraphicsScene *scene = 0,
        QGraphicsItem *parent = 0 );
    
    QList<HbAction*> actions() const
    {
        return mActions;
    }

signals:

    void finished(HbAction *action);
    
public:
    
    QList<HbAction*> mActions;
    
};

#endif // HBMESSAGEBOX_H