34
|
1 |
/*
|
|
2 |
* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: HbMessageBox class declaration.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef HBMESSAGEBOX_H
|
|
20 |
#define HBMESSAGEBOX_H
|
|
21 |
|
38
|
22 |
#include <qobject.h>
|
34
|
23 |
#include <qstring.h>
|
38
|
24 |
#include "hbaction.h"
|
34
|
25 |
|
|
26 |
class QGraphicsWidget;
|
|
27 |
class QGraphicsScene;
|
|
28 |
class QGraphicsItem;
|
|
29 |
|
38
|
30 |
class HbMessageBox : public QObject
|
34
|
31 |
{
|
38
|
32 |
Q_OBJECT
|
|
33 |
|
34
|
34 |
public:
|
38
|
35 |
enum MessageBoxType {
|
|
36 |
MessageTypeInformation,
|
|
37 |
MessageTypeQuestion,
|
|
38 |
MessageTypeWarning
|
|
39 |
};
|
|
40 |
|
|
41 |
HbMessageBox(MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
|
|
42 |
HbMessageBox(const QString &text, MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
|
|
43 |
~HbMessageBox();
|
|
44 |
|
|
45 |
/**
|
|
46 |
* Create new HbMessageBox and call emitDialogFinished after this one to finish the sequence.
|
|
47 |
*/
|
|
48 |
void open( QObject* receiver = 0, const char* member = 0 );
|
|
49 |
|
|
50 |
void emitDialogFinished( QObject* receiver, const char* member, int actionNum );
|
|
51 |
|
|
52 |
void show();
|
|
53 |
|
|
54 |
void setAttribute(int attribute);
|
|
55 |
|
34
|
56 |
/** stubbed from HbMessgeBox */
|
38
|
57 |
/* static void question(const QString &questionText,
|
|
58 |
QObject *receiver,
|
|
59 |
const char *member,
|
|
60 |
const QString &primaryButtonText = tr("Yes"),
|
|
61 |
const QString &secondaryButtonText = tr("No"),
|
|
62 |
QGraphicsWidget *headWidget = 0,
|
|
63 |
QGraphicsScene *scene = 0,
|
|
64 |
QGraphicsItem *parent = 0 );*/
|
34
|
65 |
|
|
66 |
/** stubbed from HbMessgeBox */
|
|
67 |
static void information(const QString &informationText,
|
|
68 |
QGraphicsWidget *headWidget = 0,
|
|
69 |
QGraphicsScene *scene = 0,
|
|
70 |
QGraphicsItem *parent = 0);
|
|
71 |
|
|
72 |
/** stubbed from HbMessgeBox */
|
|
73 |
static void warning(const QString &warningText,
|
|
74 |
QGraphicsWidget *headWidget = 0,
|
|
75 |
QGraphicsScene *scene = 0,
|
|
76 |
QGraphicsItem *parent = 0 );
|
38
|
77 |
|
|
78 |
QList<HbAction*> actions() const
|
|
79 |
{
|
|
80 |
return mActions;
|
|
81 |
}
|
|
82 |
|
|
83 |
signals:
|
|
84 |
|
|
85 |
void finished(HbAction *action);
|
|
86 |
|
|
87 |
public:
|
|
88 |
|
|
89 |
QList<HbAction*> mActions;
|
|
90 |
|
34
|
91 |
};
|
|
92 |
|
|
93 |
#endif // HBMESSAGEBOX_H
|