File indexing completed on 2024-05-12 04:33:19

0001 /*
0002     SPDX-FileCopyrightText: 2009-2010 Michael G. Hansen <mike at mghansen dot de>
0003     SPDX-FileCopyrightText: 2011-2018 Gilles Caulier <caulier dot gilles at gmail dot com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef __KIPIINTERFACE_H
0009 #define __KIPIINTERFACE_H
0010 
0011 // Libkipi includes
0012 
0013 #include "interface.h"
0014 
0015 namespace KIPI
0016 {
0017     class ImageCollection;
0018     class ImageInfo;
0019 }
0020 
0021 using namespace KIPI;
0022 
0023 namespace KXMLKipiCmd
0024 {
0025 
0026 class KipiInterface : public Interface
0027 {
0028     Q_OBJECT
0029 
0030 public:
0031 
0032     KipiInterface(QObject* const parent, const QString& name=QString());
0033     ~KipiInterface() override;
0034 
0035     ImageCollection        currentAlbum() override;
0036     ImageCollection        currentSelection() override;
0037     QList<ImageCollection> allAlbums() override;
0038     ImageInfo              info(const QUrl&) override;
0039 
0040     bool addImage(const QUrl& url, QString& errmsg) override;
0041     void delImage(const QUrl& url) override;
0042     void refreshImages(const QList<QUrl>& urls) override;
0043 
0044     int      features() const override;
0045     QVariant hostSetting(const QString& settingName);
0046 
0047     ImageCollectionSelector* imageCollectionSelector(QWidget* parent) override;
0048     UploadWidget*            uploadWidget(QWidget* parent) override;
0049 
0050     void addSelectedImages(const QList<QUrl>& images);
0051     void addSelectedImage(const QUrl& image);
0052 
0053     void addSelectedAlbums(const QList<QUrl>& albums);
0054     void addSelectedAlbum(const QUrl& album);
0055 
0056     void addAlbums(const QList<QUrl>& albums);
0057     void addAlbum(const QUrl& album);
0058 
0059     void thumbnails(const QList<QUrl>& list, int size) override;
0060 
0061     bool saveImage(const QUrl& url, const QString& format,
0062                    const QByteArray& data, uint width, uint height,
0063                    bool  sixteenBit, bool hasAlpha,
0064                    bool* cancel = nullptr) override;
0065 
0066     FileReadWriteLock* createReadWriteLock(const QUrl&) const override;
0067     MetadataProcessor* createMetadataProcessor()        const override;
0068 
0069 private:
0070 
0071     QList<QUrl> m_selectedImages;
0072     QList<QUrl> m_selectedAlbums;
0073     QList<QUrl> m_albums;
0074 
0075 private:
0076 
0077     friend class KipiUploadWidget;
0078     friend class KipiImageCollectionSelector;
0079 };
0080 
0081 } // namespace KXMLKipiCmd
0082 
0083 #endif // __KIPIINTERFACE_H