1 #ifndef ADOPTERWINDOW_H
2 #define ADOPTERWINDOW_H
14 * A toplevel window that can adopt a BookView and other children.
15 * On Maemo, it can also grab the volume keys.
17 class AdopterWindow: public QMainWindow
22 explicit AdopterWindow(QWidget *parent = 0);
24 /** Adopt children "bookView" and "others". */
25 void takeChildren(BookView *bookView, const QList<QWidget *> &others);
27 /** Release current children (adopted in @see takeChildren). */
30 /** Return true if a child is currently adopted. */
31 bool hasChild(QWidget *child);
34 * Add action that is visible on the tool bar.
35 * @param receiver Object receiving "activated" signal.
36 * @param slot Slot receiving "activated" signal.
37 * @param iconName Base name of tool bar icon in resource file.
38 * @param text Tool bar item text.
39 * @param important On Symbian, only "important" actions are added to
40 * the tool bar. All actions are added to the Options
43 QAction *addToolBarAction(QObject *receiver, const char *slot,
44 const QString &iconName, const QString &text,
45 bool important = false);
47 /** Add spacing to tool bar. */
48 void addToolBarSpace();
53 /** If grab is true, volume keys will generate pageUp/Down key events. */
54 void grabVolumeKeys(bool grab);
57 /** Handle settings changes. */
58 void onSettingsChanged(const QString &key);
61 void keyPressEvent(QKeyEvent *event);
63 void showEvent(QShowEvent *event);
64 void doGrabVolumeKeys(bool grab);
67 bool grabbingVolumeKeys;/**< True, if volume keys should be grabbed. */
71 #endif // ADOPTERWINDOW_H