X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=adopterwindow.h;h=eb30d53b8f36fbd8cf0abd960e2393368fa28011;hb=6c8d9bb19213aee37517232ef889409200e53ac1;hp=d4631f46af39f360c46c0b35916a8a7c949ce9bf;hpb=b28659ebcbbcd4c42d90e0439fc09e03fc5a47cc;p=dorian diff --git a/adopterwindow.h b/adopterwindow.h index d4631f4..eb30d53 100644 --- a/adopterwindow.h +++ b/adopterwindow.h @@ -9,6 +9,8 @@ class QToolBar; class QAction; class BookView; class QVBoxLayout; +class Progress; +class TranslucentButton; /** * A toplevel window that can adopt a BookView and other children. @@ -21,14 +23,15 @@ class AdopterWindow: public QMainWindow public: explicit AdopterWindow(QWidget *parent = 0); - /** Adopt children "bookView" and "others". */ - void takeChildren(BookView *bookView, const QList &others); + /** Adopt book view and decorations. */ + void takeBookView(BookView *bookView, Progress *prog, + TranslucentButton *prev, TranslucentButton *next); - /** Release current children (adopted in @see takeChildren). */ - void leaveChildren(); + /** Release book view and decorations. */ + void leaveBookView(); - /** Return true if a child is currently adopted. */ - bool hasChild(QWidget *child); + /** Return true if the book view is currently adopted. */ + bool hasBookView(); /** * Add action that is visible on the tool bar. @@ -50,7 +53,7 @@ public: /** Show window. */ void show(); - /** If grab is true, volume keys will generate pageUp/Down key events. */ + /** If grab is true, volume keys will navigate the book view. */ void grabVolumeKeys(bool grab); public slots: @@ -58,14 +61,36 @@ public slots: void onSettingsChanged(const QString &key); protected: + /** Return true, if we are in portrait mode. */ + bool portrait(); + + /** Handle key press events. */ void keyPressEvent(QKeyEvent *event); -#ifdef Q_WS_MAEMO_5 + + /** + * Handle show events. + * On Symbian, volume keys can only be grabbed, if the window is shown. + */ void showEvent(QShowEvent *event); + + /** Handle resize events. */ + void resizeEvent(QResizeEvent *event); + +#ifdef Q_WS_MAEMO_5 + /** Actually grab the volume keys. */ void doGrabVolumeKeys(bool grab); #endif - BookView *bookView; + +protected slots: + void placeDecorations(); + +private: + BookView *bookView; /**< Book view widget. */ bool grabbingVolumeKeys;/**< True, if volume keys should be grabbed. */ - QToolBar *toolBar; + QToolBar *toolBar; /**< Tool bar. */ + Progress *progress; /**< Reading progress indicator. */ + TranslucentButton *previousButton; /**< Previous page indicator. */ + TranslucentButton *nextButton; /**< Next page indicator. */ }; #endif // ADOPTERWINDOW_H