videocollection/tsrc/stubs/inc/hbmessagebox.h
author hgs
Fri, 06 Aug 2010 09:43:48 +0300
changeset 50 21fe8338c6bf
parent 44 518105d52e45
child 63 4707a0db12f6
permissions -rw-r--r--
201031
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  HbMessageBox class declaration.
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
#ifndef HBMESSAGEBOX_H
hgs
parents:
diff changeset
    20
#define HBMESSAGEBOX_H
hgs
parents:
diff changeset
    21
38
hgs
parents: 34
diff changeset
    22
#include <qobject.h>
34
hgs
parents:
diff changeset
    23
#include <qstring.h>
38
hgs
parents: 34
diff changeset
    24
#include "hbaction.h"
34
hgs
parents:
diff changeset
    25
hgs
parents:
diff changeset
    26
class QGraphicsWidget;
hgs
parents:
diff changeset
    27
class QGraphicsScene;
hgs
parents:
diff changeset
    28
class QGraphicsItem;
hgs
parents:
diff changeset
    29
38
hgs
parents: 34
diff changeset
    30
class HbMessageBox : public QObject
34
hgs
parents:
diff changeset
    31
{   
38
hgs
parents: 34
diff changeset
    32
    Q_OBJECT
50
hgs
parents: 44
diff changeset
    33
hgs
parents: 44
diff changeset
    34
    Q_FLAGS(StandardButton StandardButtons)
hgs
parents: 44
diff changeset
    35
    Q_ENUMS(MessageBoxType StandardButton)
38
hgs
parents: 34
diff changeset
    36
    
34
hgs
parents:
diff changeset
    37
public:
50
hgs
parents: 44
diff changeset
    38
38
hgs
parents: 34
diff changeset
    39
    enum MessageBoxType {
hgs
parents: 34
diff changeset
    40
        MessageTypeInformation,
hgs
parents: 34
diff changeset
    41
        MessageTypeQuestion,
hgs
parents: 34
diff changeset
    42
        MessageTypeWarning
hgs
parents: 34
diff changeset
    43
    };
44
hgs
parents: 38
diff changeset
    44
hgs
parents: 38
diff changeset
    45
    enum StandardButton {
hgs
parents: 38
diff changeset
    46
        NoButton           = 0x00000000,
hgs
parents: 38
diff changeset
    47
        Ok                 = 0x00000400,
hgs
parents: 38
diff changeset
    48
        Save               = 0x00000800,
hgs
parents: 38
diff changeset
    49
        Open               = 0x00001000,
hgs
parents: 38
diff changeset
    50
        Yes                = 0x00002000,
hgs
parents: 38
diff changeset
    51
        Continue           = 0x00004000,
hgs
parents: 38
diff changeset
    52
        Delete             = 0x00008000,
hgs
parents: 38
diff changeset
    53
        No                 = 0x00010000,
hgs
parents: 38
diff changeset
    54
        Retry              = 0x00020000,
hgs
parents: 38
diff changeset
    55
        Close              = 0x00040000,
hgs
parents: 38
diff changeset
    56
        Cancel             = 0x00080000,
hgs
parents: 38
diff changeset
    57
        Help               = 0x00100000,
hgs
parents: 38
diff changeset
    58
        Apply              = 0x00200000,
hgs
parents: 38
diff changeset
    59
        Reset              = 0x00400000
hgs
parents: 38
diff changeset
    60
    };    
hgs
parents: 38
diff changeset
    61
hgs
parents: 38
diff changeset
    62
    Q_DECLARE_FLAGS(StandardButtons, StandardButton)
50
hgs
parents: 44
diff changeset
    63
38
hgs
parents: 34
diff changeset
    64
    HbMessageBox(MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
hgs
parents: 34
diff changeset
    65
    HbMessageBox(const QString &text, MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
hgs
parents: 34
diff changeset
    66
    ~HbMessageBox();
hgs
parents: 34
diff changeset
    67
    
hgs
parents: 34
diff changeset
    68
    /**
hgs
parents: 34
diff changeset
    69
    * Create new HbMessageBox and call emitDialogFinished after this one to finish the sequence.
hgs
parents: 34
diff changeset
    70
     */
hgs
parents: 34
diff changeset
    71
    void open( QObject* receiver = 0, const char* member = 0 );
hgs
parents: 34
diff changeset
    72
    
hgs
parents: 34
diff changeset
    73
    void emitDialogFinished( QObject* receiver, const char* member, int actionNum );
hgs
parents: 34
diff changeset
    74
hgs
parents: 34
diff changeset
    75
    void show();
hgs
parents: 34
diff changeset
    76
    
hgs
parents: 34
diff changeset
    77
    void setAttribute(int attribute);
hgs
parents: 34
diff changeset
    78
    
34
hgs
parents:
diff changeset
    79
    /** stubbed from HbMessgeBox */
38
hgs
parents: 34
diff changeset
    80
/*    static void question(const QString &questionText,
hgs
parents: 34
diff changeset
    81
                            QObject *receiver,
hgs
parents: 34
diff changeset
    82
                            const char *member,
hgs
parents: 34
diff changeset
    83
                            const QString &primaryButtonText = tr("Yes"),
hgs
parents: 34
diff changeset
    84
                            const QString &secondaryButtonText = tr("No"),
hgs
parents: 34
diff changeset
    85
                            QGraphicsWidget *headWidget = 0,
hgs
parents: 34
diff changeset
    86
                            QGraphicsScene *scene = 0,
hgs
parents: 34
diff changeset
    87
                            QGraphicsItem *parent = 0 );*/
34
hgs
parents:
diff changeset
    88
hgs
parents:
diff changeset
    89
    /** stubbed from HbMessgeBox */
hgs
parents:
diff changeset
    90
    static void information(const QString &informationText,
hgs
parents:
diff changeset
    91
        QGraphicsWidget *headWidget = 0,
hgs
parents:
diff changeset
    92
        QGraphicsScene *scene = 0,
hgs
parents:
diff changeset
    93
        QGraphicsItem *parent = 0);
hgs
parents:
diff changeset
    94
hgs
parents:
diff changeset
    95
    /** stubbed from HbMessgeBox */
hgs
parents:
diff changeset
    96
    static void warning(const QString &warningText,
hgs
parents:
diff changeset
    97
        QGraphicsWidget *headWidget = 0,
hgs
parents:
diff changeset
    98
        QGraphicsScene *scene = 0,
hgs
parents:
diff changeset
    99
        QGraphicsItem *parent = 0 );
38
hgs
parents: 34
diff changeset
   100
    
44
hgs
parents: 38
diff changeset
   101
    static void setStandardButtons(StandardButtons buttons);
hgs
parents: 38
diff changeset
   102
38
hgs
parents: 34
diff changeset
   103
    QList<HbAction*> actions() const
hgs
parents: 34
diff changeset
   104
    {
hgs
parents: 34
diff changeset
   105
        return mActions;
hgs
parents: 34
diff changeset
   106
    }
hgs
parents: 34
diff changeset
   107
hgs
parents: 34
diff changeset
   108
signals:
hgs
parents: 34
diff changeset
   109
44
hgs
parents: 38
diff changeset
   110
    void finished(int action);
38
hgs
parents: 34
diff changeset
   111
    
hgs
parents: 34
diff changeset
   112
public:
hgs
parents: 34
diff changeset
   113
    
hgs
parents: 34
diff changeset
   114
    QList<HbAction*> mActions;
hgs
parents: 34
diff changeset
   115
    
34
hgs
parents:
diff changeset
   116
};
hgs
parents:
diff changeset
   117
50
hgs
parents: 44
diff changeset
   118
Q_DECLARE_OPERATORS_FOR_FLAGS(HbMessageBox::StandardButtons)
hgs
parents: 44
diff changeset
   119
34
hgs
parents:
diff changeset
   120
#endif // HBMESSAGEBOX_H