moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kstars / kstars / thumbnailpicker.h
blob03921b9d6098927f24c692cfba6aea6f9973e704
1 /***************************************************************************
2 thumbnailpicker.h - description
3 -------------------
4 begin : Thu Mar 2 2005
5 copyright : (C) 2005 by Jason Harris
6 email : kstars@30doradus.org
7 ***************************************************************************/
9 /***************************************************************************
10 * *
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. *
15 * *
16 ***************************************************************************/
18 #ifndef THUMBNAILPICKER_H
19 #define THUMBNAILPICKER_H
21 #include <kdialogbase.h>
22 #include <kio/netaccess.h>
23 #include <kio/job.h>
25 class ThumbnailPickerUI;
26 class ThumbnailEditor;
27 class QPixmap;
28 class QFile;
29 class QRect;
30 class DetailDialog;
31 class SkyObject;
33 /**@short Dialog for modifying an object's thumbnail image
34 *@author Jason Harris
37 class ThumbnailPicker : public KDialogBase
39 Q_OBJECT
40 public:
41 ThumbnailPicker( SkyObject *o, const QPixmap &current, QWidget *parent=0, const char *name=0 );
42 ~ThumbnailPicker();
44 QPixmap* image() { return Image; }
45 QPixmap* currentListImage() { return PixList.at( SelectedImageIndex ); }
46 bool imageFound() const { return bImageFound; }
47 QRect* imageRect() const { return ImageRect; }
49 private slots:
50 void slotEditImage();
51 void slotUnsetImage();
52 void slotSetFromList( int i );
53 void slotSetFromURL( const QString &url );
54 void slotCheckValidURL( const QString &url );
55 void slotFillList();
57 /**Make sure download has finished, then make sure file exists, then add image to list */
58 void downloadReady (KIO::Job *);
60 private:
61 QPixmap shrinkImage( QPixmap *original, int newSize, bool setImage=false );
62 void parseGooglePage( QStringList &ImList, QString URL );
64 int SelectedImageIndex;
65 ThumbnailPickerUI *ui;
66 QPixmap *Image;
67 DetailDialog *dd;
68 SkyObject *Object;
69 QPtrList<KIO::Job> JobList;
70 QPtrList<QPixmap> PixList;
71 bool bImageFound;
72 QRect *ImageRect;
75 #endif