1 #ifndef ADOPTERWINDOW_H
2 #define ADOPTERWINDOW_H
13 class TranslucentButton;
16 * A toplevel window that can adopt a BookView and other children.
17 * On Maemo, it can also grab the volume keys.
19 class AdopterWindow: public QMainWindow
24 explicit AdopterWindow(QWidget *parent = 0);
26 /** Adopt book view and decorations. */
27 void takeBookView(BookView *bookView, Progress *prog,
28 TranslucentButton *prev, TranslucentButton *next);
30 /** Release book view and decorations. */
33 /** Return true if the book view is currently adopted. */
37 * Add action that is visible on the tool bar.
38 * @param receiver Object receiving "activated" signal.
39 * @param slot Slot receiving "activated" signal.
40 * @param iconName Base name of tool bar icon in resource file.
41 * @param text Tool bar item text.
42 * @param important On Symbian, only "important" actions are added to
43 * the tool bar. All actions are added to the Options
46 QAction *addToolBarAction(QObject *receiver, const char *slot,
47 const QString &iconName, const QString &text,
48 bool important = false);
50 /** Add spacing to tool bar. */
51 void addToolBarSpace();
56 /** If grab is true, volume keys will navigate the book view. */
57 void grabVolumeKeys(bool grab);
60 /** Handle settings changes. */
61 void onSettingsChanged(const QString &key);
64 /** Handle key press events. */
65 void keyPressEvent(QKeyEvent *event);
69 * On Symbian, volume keys can only be grabbed, if the window is shown.
71 void showEvent(QShowEvent *event);
73 /** Handle resize events. */
74 void resizeEvent(QResizeEvent *event);
77 /** Update toolbar visibility. */
80 /** Return true in portrait mode. */
82 #endif // Q_OS_SYMBIAN
85 /** Actually grab the volume keys. */
86 void doGrabVolumeKeys(bool grab);
87 #endif // Q_WS_MAEMO_5
90 void placeDecorations();
93 BookView *bookView; /**< Book view widget. */
94 bool grabbingVolumeKeys;/**< True, if volume keys should be grabbed. */
95 QToolBar *toolBar; /**< Tool bar. */
96 Progress *progress; /**< Reading progress indicator. */
97 TranslucentButton *previousButton; /**< Previous page indicator. */
98 TranslucentButton *nextButton; /**< Next page indicator. */
101 #endif // ADOPTERWINDOW_H