Add minimal documentation.
[dorian] / widgets / adopterwindow.h
1 #ifndef ADOPTERWINDOW_H
2 #define ADOPTERWINDOW_H
3
4 #include <QMainWindow>
5 #include <QList>
6
7 class QWidget;
8 class QToolBar;
9 class QAction;
10
11 /**
12   * A main window that can adopt other windows' children, and grabs the
13   * zoom (volume) keys on Maemo.
14   */
15 class AdopterWindow: public QMainWindow
16 {
17     Q_OBJECT
18 public:
19     explicit AdopterWindow(QWidget *parent = 0);
20     void grabZoomKeys(bool grab);
21     void takeChildren(QWidget *main, const QList<QWidget *> &others);
22     void leaveChildren();
23
24     /**
25      * Add action that is visible on the tool bar (except on Symbian, where
26      * it is visible on the Options menu.
27      */
28     QAction *addToolBarAction(QObject *receiver, const char *slot,
29                               const QString &iconName, const QString &text);
30
31     /** Add space. */
32     void addToolBarSpace();
33
34     /** Add action that is visible on the menu. */
35     QAction *addAction(QObject *receiver, const char *slot,
36                        const QString &text);
37
38     /** Show window. */
39     void show();
40
41 signals:
42
43 public slots:
44
45 protected:
46     void showEvent(QShowEvent *e);
47     void doGrabZoomKeys(bool grab);
48     bool grabbingZoomKeys;
49     QWidget *mainChild;
50 #ifndef Q_OS_SYMBIAN
51     QToolBar *toolBar;
52 #endif
53 };
54
55 #endif // ADOPTERWINDOW_H