diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 47d455dd55be855e4cc691c32f687f723d9247ee (patch) | |
tree | 52e236aaa2576bdb3840ebede26619692fed6d7d /kpdf/ui/pageviewutils.h | |
download | tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.tar.gz tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpdf/ui/pageviewutils.h')
-rw-r--r-- | kpdf/ui/pageviewutils.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/kpdf/ui/pageviewutils.h b/kpdf/ui/pageviewutils.h new file mode 100644 index 00000000..bde9b8d3 --- /dev/null +++ b/kpdf/ui/pageviewutils.h @@ -0,0 +1,72 @@ +/*************************************************************************** + * Copyright (C) 2004 by Enrico Ros <[email protected]> * + * * + * 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. * + ***************************************************************************/ + +#ifndef _PAGEVIEW_UTILS_H +#define _PAGEVIEW_UTILS_H + +#include <qwidget.h> +#include <qpixmap.h> +#include <qpainter.h> +#include <qrect.h> + +class QTimer; + +class PageView; +class KPDFPage; + +/** + * @short PageViewItem represents graphically a kpdfpage into the PageView. + * + * It has methods for settings Item's geometry and other visual properties such + * as the individual zoom factor. + */ +class PageViewItem +{ + public: + PageViewItem( const KPDFPage * page ); + + const KPDFPage * page() const; + int pageNumber() const; + const QRect& geometry() const; + int width() const; + int height() const; + double zoomFactor() const; + + void setGeometry( int x, int y, int width, int height ); + void setWHZ( int w, int h, double zoom ); + void moveTo( int x, int y ); + + private: + const KPDFPage * m_page; + double m_zoomFactor; + QRect m_geometry; +}; + + +/** + * @short A widget that displays messages in the top-left corner. + */ +class PageViewMessage : public QWidget +{ + public: + PageViewMessage( QWidget * parent ); + + enum Icon { None, Info, Warning, Error, Find }; + void display( const QString & message, Icon icon = Info, int durationMs = 4000 ); + + protected: + void paintEvent( QPaintEvent * e ); + void mousePressEvent( QMouseEvent * e ); + + private: + QPixmap m_pixmap; + QTimer * m_timer; +}; + +#endif |