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 some platforms, 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, when the window is shown.
55 * So we do it from here.
57 void showEvent(QShowEvent *event);
59 /** Handle resize event: Restore reading position. */
60 void resizeEvent(QResizeEvent *event);
62 /** Handle close event: Save reading position. */
63 void closeEvent(QCloseEvent *event);
65 /** Handle leave event: Save reading position. */
66 void leaveEvent(QEvent *event);
69 /** Actually grab the volume keys. */
70 void doGrabVolumeKeys(bool grab);
71 #endif // Q_WS_MAEMO_5
74 void placeDecorations();
79 BookView *bookView; /**< Book view widget. */
80 bool grabbingVolumeKeys;/**< True, if volume keys should be grabbed. */
81 Progress *progress; /**< Reading progress indicator. */
82 TranslucentButton *previousButton; /**< Previous page indicator. */
83 TranslucentButton *nextButton; /**< Next page indicator. */
86 #endif // ADOPTERWINDOW_H