1 #ifndef ADOPTERWINDOW_H
2 #define ADOPTERWINDOW_H
11 class TranslucentButton;
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 MainBase
22 explicit AdopterWindow(QWidget *parent = 0);
24 /** Adopt book view and decorations. */
25 void takeBookView(BookView *bookView, Progress *prog,
26 TranslucentButton *prev, TranslucentButton *next);
28 /** Release book view and decorations. */
31 /** Return true if the book view is currently adopted. */
34 /** If grab is true, volume keys will navigate the book view. */
35 void grabVolumeKeys(bool grab);
38 /** Handle settings changes. */
39 void onSettingsChanged(const QString &key);
42 /** Emitted when Page Up or Volume Up pressed. */
45 /** Emitted when Page Down or Volume Down pressed. */
49 /** Handle key press events. */
50 void keyPressEvent(QKeyEvent *event);
54 * On Symbian, volume keys can only be grabbed, if the window is shown.
56 void showEvent(QShowEvent *event);
58 /** Handle resize event: Restore reading position. */
59 void resizeEvent(QResizeEvent *event);
61 /** Handle close event. */
62 void closeEvent(QCloseEvent *event);
64 /** Handle leave event: Save reading position. */
65 void leaveEvent(QEvent *event);
68 /** Actually grab the volume keys. */
69 void doGrabVolumeKeys(bool grab);
70 #endif // Q_WS_MAEMO_5
73 void placeDecorations();
78 BookView *bookView; /**< Book view widget. */
79 bool grabbingVolumeKeys;/**< True, if volume keys should be grabbed. */
80 Progress *progress; /**< Reading progress indicator. */
81 TranslucentButton *previousButton; /**< Previous page indicator. */
82 TranslucentButton *nextButton; /**< Next page indicator. */
85 #endif // ADOPTERWINDOW_H