~ubuntu-branches/ubuntu/intrepid/digikam/intrepid

« back to all changes in this revision

Viewing changes to digikam/libs/widgets/imageguidewidget.h

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2008-07-17 20:25:39 UTC
  • mfrom: (1.3.2 upstream) (37 hardy)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20080717202539-1bw3w3nrsso7yj4z
* New upstream release
  - digiKam 0.9.4 Release Plan (KDE3) ~ 13 July 08 (Closes: #490144)
* DEB_CONFIGURE_EXTRA_FLAGS := --without-included-sqlite3
* Debhelper compatibility level V7
* Install pixmaps in debian/*.install
* Add debian/digikam.lintian-overrides

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* ============================================================
2
 
 * File  : imageguidewidget.h
3
 
 * Author: Gilles Caulier <caulier dot gilles at free.fr>
4
 
 * Date  : 2004-08-20
5
 
 * Description : 
6
 
 * 
7
 
 * Copyright 2004-2005 Gilles Caulier
8
 
 *
9
 
 * This program is free software; you can redistribute it
10
 
 * and/or modify it under the terms of the GNU General
11
 
 * Public License as published by the Free Software Foundation;
12
 
 * either version 2, or (at your option)
13
 
 * any later version.
14
 
 * 
15
 
 * This program is distributed in the hope that it will be useful,
16
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
 * GNU General Public License for more details.
19
 
 * 
20
 
 * ============================================================ */
21
 
 
22
 
#ifndef IMAGEGUIDEWIDGET_H
23
 
#define IMAGEGUIDEWIDGET_H
24
 
 
25
 
// Qt includes.
26
 
 
27
 
#include <qwidget.h>
28
 
#include <qrect.h>
29
 
#include <qpoint.h>
30
 
#include <qcolor.h>
31
 
 
32
 
// Local includes
33
 
 
34
 
#include "digikam_export.h"
35
 
 
36
 
class QPixmap;
37
 
 
38
 
namespace Digikam
39
 
{
40
 
class ImageIface;
41
 
 
42
 
class DIGIKAM_EXPORT ImageGuideWidget : public QWidget
43
 
{
44
 
Q_OBJECT
45
 
 
46
 
public:
47
 
 
48
 
    enum GuideToolMode 
49
 
    {
50
 
    HVGuideMode=0,
51
 
    PickColorMode
52
 
    };
53
 
 
54
 
public:
55
 
 
56
 
    ImageGuideWidget(int w, int h, QWidget *parent=0, 
57
 
                     bool spotVisible=true, int guideMode=HVGuideMode,
58
 
                     QColor guideColor=Qt::red, int guideSize=1);
59
 
    ~ImageGuideWidget();
60
 
        
61
 
    Digikam::ImageIface* imageIface();
62
 
    
63
 
    QPoint getSpotPosition(void);
64
 
    QColor getSpotColor(void);
65
 
    void   setSpotVisible(bool v);
66
 
    void   resetSpotPosition(void);
67
 
    void   updatePreview( void );
68
 
 
69
 
public slots:
70
 
        
71
 
    void slotChangeGuideColor(const QColor &color);
72
 
    void slotChangeGuideSize(int size);    
73
 
 
74
 
signals:
75
 
 
76
 
    void spotPositionChanged( const QColor &color, bool release, const QPoint &position ); 
77
 
    void signalResized(void);  
78
 
    
79
 
protected:
80
 
    
81
 
    void paintEvent( QPaintEvent *e );
82
 
    void resizeEvent( QResizeEvent * e );
83
 
    void timerEvent(QTimerEvent * e);
84
 
    void mousePressEvent( QMouseEvent * e );
85
 
    void mouseReleaseEvent( QMouseEvent * e );
86
 
    void mouseMoveEvent( QMouseEvent * e );
87
 
        
88
 
private:
89
 
 
90
 
    uint                *m_data;
91
 
    int                  m_w;
92
 
    int                  m_h;
93
 
    
94
 
    int                  m_timerID;
95
 
    int                  m_guideMode;
96
 
    int                  m_guideSize;
97
 
    int                  m_flicker;
98
 
 
99
 
    bool                 m_focus;
100
 
    bool                 m_spotVisible;
101
 
    
102
 
    // Current spot position in preview coordinates.
103
 
    QPoint               m_spot;
104
 
    
105
 
    QRect                m_rect;       
106
 
    
107
 
    QColor               m_guideColor;
108
 
        
109
 
    QPixmap             *m_pixmap;
110
 
    
111
 
    Digikam::ImageIface *m_iface;    
112
 
 
113
 
private:
114
 
 
115
 
    void updatePixmap( void );
116
 
};
117
 
 
118
 
}  // NameSpace Digikam
119
 
 
120
 
#endif /* IMAGEGUIDEWIDGET_H */