compile
[kdegraphics.git] / okular / ui / minibar.h
blob62733b3fce2bffdb62daab426038641cfd650c01
1 /***************************************************************************
2 * Copyright (C) 2005 by Enrico Ros <eros.kde@email.it> *
3 * Copyright (C) 2006 by Albert Astals Cid <aacid@kde.org> *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 ***************************************************************************/
11 #ifndef _OKULAR_MINIBAR_H_
12 #define _OKULAR_MINIBAR_H_
14 #include <qwidget.h>
15 #include "core/observer.h"
17 namespace Okular {
18 class Document;
21 class PagesEdit;
22 class HoverButton;
24 /**
25 * @short A widget to display page number and change current page.
27 class MiniBar : public QWidget, public Okular::DocumentObserver
29 Q_OBJECT
30 public:
31 MiniBar( QWidget *parent, Okular::Document * document );
32 ~MiniBar();
34 // [INHERITED] from DocumentObserver
35 uint observerId() const { return MINIBAR_ID; }
36 void notifySetup( const QVector< Okular::Page * > & pages, int setupFlags );
37 void notifyViewportChanged( bool smoothMove );
39 signals:
40 void gotoPage();
41 void prevPage();
42 void nextPage();
44 public slots:
45 void slotChangePage();
46 void slotEmitNextPage();
47 void slotEmitPrevPage();
49 private:
50 void resizeForPage( int pages );
52 Okular::Document * m_document;
53 PagesEdit * m_pagesEdit;
54 HoverButton * m_prevButton;
55 HoverButton * m_pagesButton;
56 HoverButton * m_nextButton;
57 int m_currentPage;
60 /**
61 * @short A small progress bar.
63 class ProgressWidget : public QWidget, public Okular::DocumentObserver
65 Q_OBJECT
66 public:
67 ProgressWidget( QWidget * parent, Okular::Document * document );
68 ~ProgressWidget();
70 // [INHERITED] from DocumentObserver
71 uint observerId() const { return PROGRESSWIDGET_ID; }
72 void notifyViewportChanged( bool smoothMove );
74 void slotGotoNormalizedPage( float index );
76 signals:
77 void prevPage();
78 void nextPage();
80 protected:
81 void setProgress( float percentage );
83 void mouseMoveEvent( QMouseEvent * e );
84 void mousePressEvent( QMouseEvent * e );
85 void wheelEvent( QWheelEvent * e );
86 void paintEvent( QPaintEvent * e );
88 private:
89 Okular::Document * m_document;
90 int m_currentPage;
91 float m_progressPercentage;
94 #endif