mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-25 02:45:38 +00:00
![Enrico Ros](/assets/img/avatar_default.png)
selection) in favour of a new common selection code that uses internal compositing engine. o Added 'copy GFX' (in addition to the already existant 'copy text') with a popup that asks user wether to copy to clipboard or save the image to a file. (note: maybe a merge between selection tools (text/gfx) is possible). o The Zoom Tool is now a mouse mode, not a zoom mode. o Tuned PageViewMessage class and added tips somewhere. o Reorganized some actions and cleanup in mouse mode related code. o Updated plans (roadmap to HEAD and new things) in TODO. o And.. well, de don't deal with gardening anymore :-) Thanks Michael! CCMAIL: brade@kde.org svn path=/branches/kpdf_experiments/kdegraphics/kpdf/; revision=360144
73 lines
2 KiB
C++
73 lines
2 KiB
C++
/***************************************************************************
|
|
* Copyright (C) 2004 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 <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 };
|
|
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
|