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
|
50
|
33 |
|
|
34 |
Q_FLAGS(StandardButton StandardButtons)
|
|
35 |
Q_ENUMS(MessageBoxType StandardButton)
|
38
|
36 |
|
34
|
37 |
public:
|
50
|
38 |
|
38
|
39 |
enum MessageBoxType {
|
|
40 |
MessageTypeInformation,
|
|
41 |
MessageTypeQuestion,
|
|
42 |
MessageTypeWarning
|
|
43 |
};
|
44
|
44 |
|
|
45 |
enum StandardButton {
|
|
46 |
NoButton = 0x00000000,
|
|
47 |
Ok = 0x00000400,
|
|
48 |
Save = 0x00000800,
|
|
49 |
Open = 0x00001000,
|
|
50 |
Yes = 0x00002000,
|
|
51 |
Continue = 0x00004000,
|
|
52 |
Delete = 0x00008000,
|
|
53 |
No = 0x00010000,
|
|
54 |
Retry = 0x00020000,
|
|
55 |
Close = 0x00040000,
|
|
56 |
Cancel = 0x00080000,
|
|
57 |
Help = 0x00100000,
|
|
58 |
Apply = 0x00200000,
|
|
59 |
Reset = 0x00400000
|
|
60 |
};
|
|
61 |
|
|
62 |
Q_DECLARE_FLAGS(StandardButtons, StandardButton)
|
50
|
63 |
|
38
|
64 |
HbMessageBox(MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
|
|
65 |
HbMessageBox(const QString &text, MessageBoxType type = MessageTypeInformation, QGraphicsItem *parent = 0);
|
|
66 |
~HbMessageBox();
|
|
67 |
|
|
68 |
/**
|
|
69 |
* Create new HbMessageBox and call emitDialogFinished after this one to finish the sequence.
|
|
70 |
*/
|
|
71 |
void open( QObject* receiver = 0, const char* member = 0 );
|
|
72 |
|
|
73 |
void emitDialogFinished( QObject* receiver, const char* member, int actionNum );
|
|
74 |
|
|
75 |
void show();
|
|
76 |
|
|
77 |
void setAttribute(int attribute);
|
|
78 |
|
34
|
79 |
/** stubbed from HbMessgeBox */
|
38
|
80 |
/* static void question(const QString &questionText,
|
|
81 |
QObject *receiver,
|
|
82 |
const char *member,
|
|
83 |
const QString &primaryButtonText = tr("Yes"),
|
|
84 |
const QString &secondaryButtonText = tr("No"),
|
|
85 |
QGraphicsWidget *headWidget = 0,
|
|
86 |
QGraphicsScene *scene = 0,
|
|
87 |
QGraphicsItem *parent = 0 );*/
|
34
|
88 |
|
|
89 |
/** stubbed from HbMessgeBox */
|
|
90 |
static void information(const QString &informationText,
|
|
91 |
QGraphicsWidget *headWidget = 0,
|
|
92 |
QGraphicsScene *scene = 0,
|
|
93 |
QGraphicsItem *parent = 0);
|
|
94 |
|
|
95 |
/** stubbed from HbMessgeBox */
|
|
96 |
static void warning(const QString &warningText,
|
|
97 |
QGraphicsWidget *headWidget = 0,
|
|
98 |
QGraphicsScene *scene = 0,
|
|
99 |
QGraphicsItem *parent = 0 );
|
38
|
100 |
|
44
|
101 |
static void setStandardButtons(StandardButtons buttons);
|
|
102 |
|
38
|
103 |
QList<HbAction*> actions() const
|
|
104 |
{
|
|
105 |
return mActions;
|
|
106 |
}
|
|
107 |
|
|
108 |
signals:
|
|
109 |
|
44
|
110 |
void finished(int action);
|
38
|
111 |
|
|
112 |
public:
|
|
113 |
|
|
114 |
QList<HbAction*> mActions;
|
|
115 |
|
34
|
116 |
};
|
|
117 |
|
50
|
118 |
Q_DECLARE_OPERATORS_FOR_FLAGS(HbMessageBox::StandardButtons)
|
|
119 |
|
34
|
120 |
#endif // HBMESSAGEBOX_H
|