2005-01-26 10:42:07 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2005 by Enrico Ros <eros.kde@email.it> *
|
2006-02-18 12:06:52 +00:00
|
|
|
* Copyright (C) 2006 by Albert Astals Cid <aacid@kde.org> *
|
2005-01-26 10:42:07 +00:00
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
#ifndef _OKULAR_MINIBAR_H_
|
|
|
|
#define _OKULAR_MINIBAR_H_
|
2005-01-26 10:42:07 +00:00
|
|
|
|
2006-10-15 21:10:52 +00:00
|
|
|
#include <qwidget.h>
|
2005-01-26 10:42:07 +00:00
|
|
|
#include "core/observer.h"
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
namespace Okular {
|
|
|
|
class Document;
|
|
|
|
}
|
|
|
|
|
2005-01-26 10:42:07 +00:00
|
|
|
class PagesEdit;
|
|
|
|
class HoverButton;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @short A widget to display page number and change current page.
|
|
|
|
*/
|
2006-10-15 21:10:52 +00:00
|
|
|
class MiniBar : public QWidget, public Okular::DocumentObserver
|
2005-01-26 10:42:07 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2006-09-21 08:45:36 +00:00
|
|
|
MiniBar( QWidget *parent, Okular::Document * document );
|
2006-02-18 12:06:52 +00:00
|
|
|
~MiniBar();
|
2005-01-26 10:42:07 +00:00
|
|
|
|
|
|
|
// [INHERITED] from DocumentObserver
|
|
|
|
uint observerId() const { return MINIBAR_ID; }
|
2007-09-09 10:50:36 +00:00
|
|
|
void notifySetup( const QVector< Okular::Page * > & pages, int setupFlags );
|
2005-02-01 18:23:55 +00:00
|
|
|
void notifyViewportChanged( bool smoothMove );
|
2005-01-26 10:42:07 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void gotoPage();
|
|
|
|
void prevPage();
|
|
|
|
void nextPage();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void slotChangePage();
|
|
|
|
void slotEmitNextPage();
|
|
|
|
void slotEmitPrevPage();
|
|
|
|
|
|
|
|
private:
|
2006-11-11 12:00:03 +00:00
|
|
|
void resizeForPage( int pages );
|
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
Okular::Document * m_document;
|
2005-01-26 10:42:07 +00:00
|
|
|
PagesEdit * m_pagesEdit;
|
|
|
|
HoverButton * m_prevButton;
|
|
|
|
HoverButton * m_pagesButton;
|
|
|
|
HoverButton * m_nextButton;
|
|
|
|
int m_currentPage;
|
|
|
|
};
|
|
|
|
|
2006-10-15 15:59:22 +00:00
|
|
|
/**
|
|
|
|
* @short A small progress bar.
|
|
|
|
*/
|
|
|
|
class ProgressWidget : public QWidget, public Okular::DocumentObserver
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
ProgressWidget( QWidget * parent, Okular::Document * document );
|
|
|
|
~ProgressWidget();
|
|
|
|
|
|
|
|
// [INHERITED] from DocumentObserver
|
|
|
|
uint observerId() const { return PROGRESSWIDGET_ID; }
|
|
|
|
void notifyViewportChanged( bool smoothMove );
|
|
|
|
|
|
|
|
void slotGotoNormalizedPage( float index );
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void prevPage();
|
|
|
|
void nextPage();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void setProgress( float percentage );
|
|
|
|
|
|
|
|
void mouseMoveEvent( QMouseEvent * e );
|
|
|
|
void mousePressEvent( QMouseEvent * e );
|
|
|
|
void wheelEvent( QWheelEvent * e );
|
|
|
|
void paintEvent( QPaintEvent * e );
|
|
|
|
|
|
|
|
private:
|
|
|
|
Okular::Document * m_document;
|
|
|
|
int m_currentPage;
|
|
|
|
float m_progressPercentage;
|
|
|
|
};
|
|
|
|
|
2005-01-26 10:42:07 +00:00
|
|
|
#endif
|