1/*
2
3Dialog class that handles input focus in absence of a wm
4
5Copyright (C) 1997, 1998 Steffen Hansen <hansen@kde.org>
6Copyright (C) 2000-2003 Oswald Buddenhagen <ossi@kde.org>
7
8
9This program is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2 of the License, or
12(at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
23*/
24
25
26#ifndef FDIALOG_H
27#define FDIALOG_H
28
29#include <QDialog>
30#include <QMessageBox>
31
32class QFrame;
33
34class FDialog : public QDialog {
35 Q_OBJECT
36 typedef QDialog inherited;
37
38 public:
39 FDialog(QWidget *parent = 0, bool framed = true);
40 virtual int exec();
41 static void fitInto(const QRect &scr, QRect &grt);
42
43 signals:
44 void ready();
45
46 protected:
47 virtual void resizeEvent(QResizeEvent *e);
48 virtual void paintEvent(QPaintEvent *e);
49 void adjustGeometry();
50
51 private:
52 QFrame *winFrame;
53 bool readyEmitted;
54};
55
56#define errorbox QMessageBox::Critical
57#define sorrybox QMessageBox::Warning
58#define infobox QMessageBox::Information
59
60class KFMsgBox : public FDialog {
61 typedef FDialog inherited;
62
63 private:
64 KFMsgBox(QWidget *parent, QMessageBox::Icon type, const QString &text);
65
66 public:
67 static void box(QWidget *parent, QMessageBox::Icon type,
68 const QString &text);
69};
70
71#endif /* FDIALOG_H */
72