1
// vim: set tabstop=4 shiftwidth=4 expandtab:
3
Gwenview: an image viewer
4
Copyright 2011 Aurélien Gâteau <agateau@kde.org>
6
This program is free software; you can redistribute it and/or
7
modify it under the terms of the GNU General Public License
8
as published by the Free Software Foundation; either version 2
9
of the License, or (at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA.
21
#ifndef RASTERIMAGEVIEW_H
22
#define RASTERIMAGEVIEW_H
24
#include <lib/gwenviewlib_export.h>
27
#include <lib/documentview/abstractimageview.h>
31
class QGraphicsSceneHoverEvent;
36
class AbstractRasterImageViewTool;
38
class RasterImageViewPrivate;
39
class GWENVIEWLIB_EXPORT RasterImageView : public AbstractImageView
43
enum AlphaBackgroundMode {
44
AlphaBackgroundCheckBoard,
48
RasterImageView(QGraphicsItem* parent = 0);
51
void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
53
void setCurrentTool(AbstractRasterImageViewTool* tool);
54
AbstractRasterImageViewTool* currentTool() const;
56
void setAlphaBackgroundMode(AlphaBackgroundMode mode);
57
void setAlphaBackgroundColor(const QColor& color);
60
void currentToolChanged(AbstractRasterImageViewTool*);
63
void loadFromDocument();
65
void onImageOffsetChanged();
66
void onScrollPosChanged(const QPointF& oldPos);
67
void resizeEvent(QGraphicsSceneResizeEvent* event);
68
void mousePressEvent(QGraphicsSceneMouseEvent* event);
69
void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
70
void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
71
void wheelEvent(QGraphicsSceneWheelEvent* event);
72
void keyPressEvent(QKeyEvent* event);
73
void keyReleaseEvent(QKeyEvent* event);
74
void hoverMoveEvent(QGraphicsSceneHoverEvent*);
77
void slotDocumentMetaInfoLoaded();
78
void slotDocumentIsAnimatedUpdated();
79
void finishSetDocument();
80
void updateFromScaler(int, int, const QImage&);
81
void updateImageRect(const QRect& imageRect);
82
void updateBuffer(const QRegion& region = QRegion());
85
RasterImageViewPrivate* const d;
90
#endif /* RASTERIMAGEVIEW_H */