~ubuntu-branches/ubuntu/precise/gwenview/precise-proposed

« back to all changes in this revision

Viewing changes to lib/crop/croptool.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-15 14:17:54 UTC
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20111215141754-z043hyx69dulbggf
Tags: upstream-4.7.90
Import upstream version 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// vim: set tabstop=4 shiftwidth=4 noexpandtab:
 
1
// vim: set tabstop=4 shiftwidth=4 expandtab:
2
2
/*
3
3
Gwenview: an image viewer
4
4
Copyright 2007 Aurélien Gâteau <agateau@kde.org>
28
28
// KDE
29
29
 
30
30
// Local
31
 
#include <lib/abstractimageviewtool.h>
 
31
#include <lib/documentview/abstractrasterimageviewtool.h>
32
32
 
33
33
class QRect;
34
34
 
35
 
namespace Gwenview {
 
35
namespace Gwenview
 
36
{
36
37
 
37
38
class AbstractImageOperation;
38
39
class ImageView;
39
40
 
40
41
struct CropToolPrivate;
41
 
class GWENVIEWLIB_EXPORT CropTool : public AbstractImageViewTool {
42
 
        Q_OBJECT
 
42
class GWENVIEWLIB_EXPORT CropTool : public AbstractRasterImageViewTool
 
43
{
 
44
    Q_OBJECT
43
45
public:
44
 
        CropTool(ImageView* parent);
45
 
        ~CropTool();
46
 
 
47
 
        void setCropRatio(double ratio);
48
 
 
49
 
        void setRect(const QRect&);
50
 
        QRect rect() const;
51
 
 
52
 
        virtual void paint(QPainter*);
53
 
 
54
 
        virtual void mousePressEvent(QMouseEvent*);
55
 
        virtual void mouseMoveEvent(QMouseEvent*);
56
 
        virtual void mouseReleaseEvent(QMouseEvent*);
57
 
 
58
 
        virtual void toolActivated();
59
 
        virtual void toolDeactivated();
 
46
    CropTool(RasterImageView* parent);
 
47
    ~CropTool();
 
48
 
 
49
    void setCropRatio(double ratio);
 
50
 
 
51
    void setRect(const QRect&);
 
52
    QRect rect() const;
 
53
 
 
54
    virtual void paint(QPainter*);
 
55
 
 
56
    virtual void mousePressEvent(QGraphicsSceneMouseEvent*);
 
57
    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent*);
 
58
    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
 
59
    virtual void hoverMoveEvent(QGraphicsSceneHoverEvent*);
 
60
 
 
61
    virtual void toolActivated();
 
62
    virtual void toolDeactivated();
 
63
 
 
64
    virtual QWidget* widget() const;
60
65
 
61
66
Q_SIGNALS:
62
 
        void rectUpdated(const QRect&);
63
 
        void done();
64
 
        void imageOperationRequested(AbstractImageOperation*);
65
 
 
66
 
protected:
67
 
        virtual bool eventFilter(QObject*, QEvent*);
 
67
    void rectUpdated(const QRect&);
 
68
    void done();
 
69
    void imageOperationRequested(AbstractImageOperation*);
68
70
 
69
71
private Q_SLOTS:
70
 
        void slotCropRequested();
71
 
        void moveHudWidget();
72
 
        void updateHudWidgetPosition();
 
72
    void slotCropRequested();
73
73
 
74
74
private:
75
 
        CropToolPrivate* const d;
 
75
    CropToolPrivate* const d;
76
76
};
77
77
 
78
 
 
79
78
} // namespace
80
79
 
81
80
#endif /* CROPTOOL_H */