File indexing completed on 2025-01-19 03:51:01

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2019-09-21
0007  * Description : Magick DImg plugin.
0008  *
0009  * SPDX-FileCopyrightText: 2020-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_DIMG_IMAGE_MAGICK_PLUGIN_H
0016 #define DIGIKAM_DIMG_IMAGE_MAGICK_PLUGIN_H
0017 
0018 // Qt includes
0019 
0020 #include <QByteArray>
0021 
0022 // Local includes
0023 
0024 #include "digikam_config.h"
0025 #include "dplugindimg.h"
0026 #include "dimg.h"
0027 
0028 #define DPLUGIN_IID "org.kde.digikam.plugin.dimg.ImageMagick"
0029 
0030 using namespace Digikam;
0031 
0032 namespace DigikamImageMagickDImgPlugin
0033 {
0034 
0035 class DImgImageMagickPlugin : public DPluginDImg
0036 {
0037     Q_OBJECT
0038     Q_PLUGIN_METADATA(IID DPLUGIN_IID)
0039     Q_INTERFACES(Digikam::DPluginDImg)
0040 
0041 public:
0042 
0043     explicit DImgImageMagickPlugin(QObject* const parent = nullptr);
0044     ~DImgImageMagickPlugin()                                                                      override;
0045 
0046     QString name()                                                                          const override;
0047     QString iid()                                                                           const override;
0048     QIcon   icon()                                                                          const override;
0049     QString details()                                                                       const override;
0050     QString description()                                                                   const override;
0051     QList<DPluginAuthor> authors()                                                          const override;
0052     QString handbookSection()                                                               const override;
0053     QString handbookChapter()                                                               const override;
0054     QString handbookReference()                                                             const override;
0055 
0056     void setup(QObject* const)                                                                    override;
0057     void cleanUp()                                                                                override;
0058     QMap<QString, QStringList> extraAboutData()                                             const override;
0059 
0060     QString     loaderName()                                                                const override;
0061     QString     typeMimes()                                                                 const override;
0062     int         canRead(const QFileInfo& fileInfo, bool magic)                              const override;
0063     int         canWrite(const QString& format)                                             const override;
0064     DImgLoader* loader(DImg* const image, const DRawDecoding& rawSettings = DRawDecoding()) const override;
0065 
0066     DImgLoaderSettings* exportWidget(const QString& format)                                 const override;
0067 
0068 private:
0069 
0070     QStringList decoderFormats() const;
0071     QStringList encoderFormats() const;
0072 
0073 private:
0074 
0075     QStringList m_readFormats;
0076     QStringList m_writeFormats;
0077 };
0078 
0079 } // namespace DigikamImageMagickDImgPlugin
0080 
0081 #endif // DIGIKAM_DIMG_IMAGE_MAGICK_PLUGIN_H