1 /***************************************************************************
2 thumbnaileditor.h - description
5 copyright : (C) 2005 by Jason Harris
6 email : kstars@30doradus.org
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
18 #ifndef THUMBNAILEDITOR_H
19 #define THUMBNAILEDITOR_H
21 #include <kdialogbase.h>
24 class ThumbnailEditorUI
;
25 class ThumbnailPicker
;
28 class ThumbImage
: public QLabel
32 ThumbImage( QWidget
*parent
, const char *name
= 0 );
35 void setImage( QPixmap
*pm
) { Image
= pm
; setFixedSize( Image
->width(), Image
->height() ); }
36 QPixmap
* image() { return Image
; }
37 QPixmap
croppedImage();
39 void setCropRect( int x
, int y
, int w
, int h
) { CropRect
->setRect( x
, y
, w
, h
); }
40 QRect
* cropRect() const { return CropRect
; }
43 void cropRegionModified();
46 // void resizeEvent( QResizeEvent *e);
47 void paintEvent( QPaintEvent
*);
48 void mousePressEvent( QMouseEvent
*e
);
49 void mouseReleaseEvent( QMouseEvent
*e
);
50 void mouseMoveEvent( QMouseEvent
*e
);
57 bool bMouseButtonDown
;
58 bool bTopLeftGrab
, bBottomLeftGrab
, bTopRightGrab
, bBottomRightGrab
;
62 class ThumbnailEditor
: public KDialogBase
66 ThumbnailEditor( QWidget
*parent
, const char *name
=0 );
71 void slotUpdateCropLabel();
74 ThumbnailEditorUI
*ui
;