digiKam
dplugindimg.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2019-09-19
7  * Description : digiKam plugin definition for DImg image loader.
8  *
9  * Copyright (C) 2019-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_DPLUGIN_DIMG_H
25 #define DIGIKAM_DPLUGIN_DIMG_H
26 
27 // Qt includes
28 
29 #include <QFileInfo>
30 
31 // Local includes
32 
33 #include "dplugin.h"
34 #include "dimgloader.h"
35 #include "dpluginloader.h"
36 #include "digikam_export.h"
37 #include "drawdecoding.h"
38 
39 namespace Digikam
40 {
41 
42 class DIGIKAM_EXPORT DPluginDImg : public DPlugin
43 {
44  Q_OBJECT
45 
46 public:
47 
51  explicit DPluginDImg(QObject* const parent = nullptr);
52 
56  ~DPluginDImg() override;
57 
58 public:
59 
62  int count() const override { return 1; };
63 
66  QStringList categories() const override { return QStringList(); };
67 
70  void setVisible(bool) override {};
71 
75  QString ifaceIid() const override { return QLatin1String(DIGIKAM_DPLUGIN_DIMG_IID); };
76 
80  bool hasVisibilityProperty() const override { return false; };
81 
85  QMap<QString, QString> extraAboutData() const override;
86  QString extraAboutDataTitle() const override;
87 
88 public:
89 
94  virtual QString loaderName() const = 0;
95 
101  virtual QString typeMimes() const = 0;
102 
106  virtual bool previewSupported() const { return false; };
107 
117  virtual int canRead(const QFileInfo& fileInfo, bool magic) const = 0;
118 
123  virtual int canWrite(const QString& format) const = 0;
124 
128  virtual DImgLoader* loader(DImg* const image, const DRawDecoding& rawSettings = DRawDecoding()) const = 0;
129 };
130 
131 } // namespace Digikam
132 
134 
135 #endif // DIGIKAM_DPLUGIN_DIMG_H
Definition: dimgloader.h:51
Definition: dimg.h:62
Definition: dplugindimg.h:43
QString ifaceIid() const override
Definition: dplugindimg.h:75
virtual bool previewSupported() const
Definition: dplugindimg.h:106
virtual QString loaderName() const =0
virtual int canWrite(const QString &format) const =0
virtual QString typeMimes() const =0
virtual int canRead(const QFileInfo &fileInfo, bool magic) const =0
void setVisible(bool) override
Definition: dplugindimg.h:70
QStringList categories() const override
Definition: dplugindimg.h:66
virtual DImgLoader * loader(DImg *const image, const DRawDecoding &rawSettings=DRawDecoding()) const =0
bool hasVisibilityProperty() const override
Definition: dplugindimg.h:80
int count() const override
Definition: dplugindimg.h:62
Definition: dplugin.h:61
Definition: drawdecoding.h:48
#define DIGIKAM_DPLUGIN_DIMG_IID
Definition: dplugin.h:52
Definition: datefolderview.cpp:43