File indexing completed on 2024-12-22 04:13:11

0001 /*
0002  * SPDX-FileCopyrightText: 2005 Thomas Zander <zander@kde.org>
0003  * SPDX-FileCopyrightText: 2005 C. Boemann <cbo@boemann.dk>
0004  *
0005  *  SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 #ifndef KIS_IMAGE_FROM_CLIPBOARD_WIDGET_H
0008 #define KIS_IMAGE_FROM_CLIPBOARD_WIDGET_H
0009 
0010 #include "kis_global.h"
0011 #include "kis_properties_configuration.h"
0012 #include "kis_custom_image_widget.h"
0013 #include <QPointer>
0014 
0015 /**
0016  * The 'New image from clipboard' widget in the Krita startup widget.
0017  * This class is an extension of the KisCustomImageWidget("Custom document" widget"
0018  */
0019 class KisImageFromClipboardWidget : public KisCustomImageWidget
0020 {
0021     Q_OBJECT
0022 public:
0023     /**
0024      * Constructor. Please note that this class is being used/created by KisDoc.
0025      * @param parent the parent widget
0026      * @param defWidth The defined width
0027      * @param defHeight The defined height
0028      * @param resolution The image resolution
0029      * @param defColorModel The defined color model
0030      * @param defColorDepth The defined color depth
0031      * @param defColorProfile The defined color profile
0032      * @param imageName the document that wants to be altered
0033      */
0034     KisImageFromClipboardWidget(QWidget *parent, qint32 defWidth, qint32 defHeight, double resolution, const QString & defColorModel, const QString & defColorDepth, const QString & defColorProfile, const QString & imageName);
0035     ~KisImageFromClipboardWidget() override;
0036 
0037 protected:
0038 
0039     void showEvent(QShowEvent *event) override;
0040 
0041 private Q_SLOTS:
0042     void createClipboardPreview();
0043     void createImage();
0044     void clipboardDataChanged();
0045     void enableImageCreation(const QImage &);
0046 };
0047 
0048 #endif
0049