2014-11-13 01:04:59 +02:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* This file is part of the KDE project.
|
|
|
|
* Copyright (C) 2001 Martin R. Jones <mjones@kde.org>
|
|
|
|
* 2001 Carsten Pfeiffer <pfeiffer@kde.org>
|
|
|
|
* 2008 Rafael Fernández López <ereslibre@kde.org>
|
|
|
|
*
|
|
|
|
* You can Freely distribute this program under the GNU Library General Public
|
|
|
|
* License. See the file "COPYING" for the exact licensing terms.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KIMAGEFILEPREVIEW_H
|
|
|
|
#define KIMAGEFILEPREVIEW_H
|
|
|
|
|
|
|
|
#include <QtGui/QPixmap>
|
|
|
|
|
|
|
|
#include <kurl.h>
|
2022-05-28 19:46:14 +03:00
|
|
|
#include <kjob.h>
|
|
|
|
#include <kfileitem.h>
|
2014-11-13 01:04:59 +02:00
|
|
|
#include <kpreviewwidgetbase.h>
|
|
|
|
|
2022-05-28 19:46:14 +03:00
|
|
|
class KImageFilePreviewPrivate;
|
2014-11-13 01:04:59 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Image preview widget for the file dialog.
|
|
|
|
*/
|
|
|
|
class KIO_EXPORT KImageFilePreview : public KPreviewWidgetBase
|
|
|
|
{
|
2021-06-30 16:53:14 +03:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Creates a new image file preview.
|
|
|
|
*
|
|
|
|
* @param parent The parent widget.
|
|
|
|
*/
|
|
|
|
explicit KImageFilePreview(QWidget *parent = 0);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroys the image file preview.
|
|
|
|
*/
|
|
|
|
~KImageFilePreview();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the size hint for this widget.
|
|
|
|
*/
|
|
|
|
virtual QSize sizeHint() const;
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
/**
|
|
|
|
* Shows a preview for the given @p url.
|
|
|
|
*/
|
|
|
|
virtual void showPreview(const KUrl &url);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clears the preview.
|
|
|
|
*/
|
|
|
|
virtual void clearPreview();
|
|
|
|
|
|
|
|
protected Q_SLOTS:
|
2022-05-28 19:46:14 +03:00
|
|
|
void gotPreview(const KFileItem &item, const QPixmap &pixmap);
|
2021-06-30 16:53:14 +03:00
|
|
|
|
|
|
|
protected:
|
2022-05-28 19:46:14 +03:00
|
|
|
virtual void resizeEvent(QResizeEvent *event);
|
2021-06-30 16:53:14 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
KImageFilePreviewPrivate *const d;
|
|
|
|
|
|
|
|
Q_DISABLE_COPY(KImageFilePreview)
|
|
|
|
|
2022-05-28 19:46:14 +03:00
|
|
|
Q_PRIVATE_SLOT(d, void _k_slotResult(KJob *job))
|
|
|
|
Q_PRIVATE_SLOT(d, void _k_slotFailed(const KFileItem &item))
|
2014-11-13 01:04:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // KIMAGEFILEPREVIEW_H
|