Kstars

thumbnailpicker.h
1/*
2 SPDX-FileCopyrightText: 2005 Jason Harris <kstars@30doradus.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "ui_thumbnailpicker.h"
10
11#include <KIO/Job>
12
13#include <QDialog>
14#include <QPixmap>
15
16class QRect;
17class KJob;
18class DetailDialog;
19class SkyObject;
20
21class ThumbnailPickerUI : public QFrame, public Ui::ThumbnailPicker
22{
24 public:
25 explicit ThumbnailPickerUI(QWidget *p);
26};
27
28/**
29 * @short Dialog for modifying an object's thumbnail image
30 *
31 * @author Jason Harris
32 */
34{
36 public:
37 ThumbnailPicker(SkyObject *o, const QPixmap &current, QWidget *parent = nullptr, double w = 200, double h = 200,
38 QString cap = i18n("Choose Thumbnail Image"));
39 ~ThumbnailPicker() override;
40
41 QPixmap *image() { return Image; }
42 QPixmap *currentListImage() { return PixList.at(SelectedImageIndex); }
43 bool imageFound() const { return bImageFound; }
44 QRect *imageRect() const { return ImageRect; }
45
46 private slots:
47 void slotEditImage();
48 void slotUnsetImage();
49 void slotSetFromList(int i);
50 void slotSetFromURL();
51 void slotFillList();
52 void slotProcessGoogleResult(KJob *);
53
54 /** Make sure download has finished, then make sure file exists, then add image to list */
55 void slotJobResult(KJob *);
56
57 private:
58 QPixmap shrinkImage(QPixmap *original, int newSize, bool setImage = false);
59 void parseGooglePage(const QString &URL);
60
61 int SelectedImageIndex;
62 double thumbWidth, thumbHeight;
63 ThumbnailPickerUI *ui;
64 QPixmap *Image;
65 SkyObject *Object;
66 QList<KIO::Job *> JobList;
67 QList<QPixmap *> PixList;
68 bool bImageFound;
69 QRect *ImageRect;
70};
DetailDialog is a window showing detailed information for a selected object.
Provides all necessary information about an object in the sky: its coordinates, name(s),...
Definition skyobject.h:42
Dialog for modifying an object's thumbnail image.
QString i18n(const char *text, const TYPE &arg...)
const_reference at(qsizetype i) const const
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.