mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-19 16:01:41 +00:00
451a3091cc
User Interface: added a toolbox for selecting an annotation tool without polluting the toolbar (pageviewtoolbox animated widget). Icons of that toolbar are gimped version of ones in nuvola icontheme. Core: added annotation class. this will support all features (except for silly ones (really there are some!)) from pdf 1.6 specs but abstracted in the kdpf way. (api changes in progress...) About annotations: only some incomplete interfaces are in plasefor now. Every type of pdf annotations has tens of parameters. I think we'll render correctly everything but provide only simple and useful tools for making annotations over the pages, otherwise a 'Qt designer like' property view will be required to do fine adjustment over the crappy thousands of settings. (and we're aiming at a quick and simple viewer with lots of coolness, not chaos). Note: the code has been wrongly committed to HEAD before,but soon reverted. Have fun! svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=388768
74 lines
2.2 KiB
C++
74 lines
2.2 KiB
C++
/***************************************************************************
|
|
* Copyright (C) 2004-2005 by Enrico Ros <eros.kde@email.it> *
|
|
* *
|
|
* 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 <qrect.h>
|
|
|
|
class QTimer;
|
|
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.
|
|
*
|
|
* This is a widget with thin border and rounded corners that displays a given
|
|
* text along as an icon. It's meant to be used for displaying messages to the
|
|
* user by placing this above other widgets.
|
|
*/
|
|
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
|