1 /***************************************************************************
2 thumbnailpicker.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 THUMBNAILPICKER_H
19 #define THUMBNAILPICKER_H
21 #include <kdialogbase.h>
22 #include <kio/netaccess.h>
25 class ThumbnailPickerUI
;
26 class ThumbnailEditor
;
33 /**@short Dialog for modifying an object's thumbnail image
37 class ThumbnailPicker
: public KDialogBase
41 ThumbnailPicker( SkyObject
*o
, const QPixmap
¤t
, QWidget
*parent
=0, const char *name
=0 );
44 QPixmap
* image() { return Image
; }
45 QPixmap
* currentListImage() { return PixList
.at( SelectedImageIndex
); }
46 bool imageFound() const { return bImageFound
; }
47 QRect
* imageRect() const { return ImageRect
; }
51 void slotUnsetImage();
52 void slotSetFromList( int i
);
53 void slotSetFromURL( const QString
&url
);
54 void slotCheckValidURL( const QString
&url
);
57 /**Make sure download has finished, then make sure file exists, then add image to list */
58 void downloadReady (KIO::Job
*);
61 QPixmap
shrinkImage( QPixmap
*original
, int newSize
, bool setImage
=false );
62 void parseGooglePage( QStringList
&ImList
, QString URL
);
64 int SelectedImageIndex
;
65 ThumbnailPickerUI
*ui
;
69 QPtrList
<KIO::Job
> JobList
;
70 QPtrList
<QPixmap
> PixList
;