File indexing completed on 2024-05-19 05:47:15
0001 /** =========================================================== 0002 * @file 0003 * 0004 * This file is a part of KDE project 0005 * 0006 * 0007 * @date 2009-11-21 0008 * @brief kipi host test application 0009 * 0010 * @author Copyright (C) 2009-2010 by Michael G. Hansen 0011 * <a href="mailto:mike at mghansen dot de">mike at mghansen dot de</a> 0012 * @author Copyright (C) 2011-2018 by Gilles Caulier 0013 * <a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a> 0014 * 0015 * This program is free software; you can redistribute it 0016 * and/or modify it under the terms of the GNU General 0017 * Public License as published by the Free Software Foundation; 0018 * either version 2, or (at your option) any later version. 0019 * 0020 * This program is distributed in the hope that it will be useful, 0021 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0023 * GNU General Public License for more details. 0024 * 0025 * ============================================================ */ 0026 0027 #ifndef __KIPIINTERFACE_H 0028 #define __KIPIINTERFACE_H 0029 0030 // Libkipi includes 0031 0032 #include "interface.h" 0033 0034 namespace KIPI 0035 { 0036 class ImageCollection; 0037 class ImageInfo; 0038 } 0039 0040 using namespace KIPI; 0041 0042 namespace KXMLKipiCmd 0043 { 0044 0045 class KipiInterface : public Interface 0046 { 0047 Q_OBJECT 0048 0049 public: 0050 0051 KipiInterface(QObject* const parent, const QString& name=QString()); 0052 ~KipiInterface() override; 0053 0054 ImageCollection currentAlbum() override; 0055 ImageCollection currentSelection() override; 0056 QList<ImageCollection> allAlbums() override; 0057 ImageInfo info(const QUrl&) override; 0058 0059 bool addImage(const QUrl& url, QString& errmsg) override; 0060 void delImage(const QUrl& url) override; 0061 void refreshImages(const QList<QUrl>& urls) override; 0062 0063 int features() const override; 0064 QVariant hostSetting(const QString& settingName); 0065 0066 ImageCollectionSelector* imageCollectionSelector(QWidget* parent) override; 0067 UploadWidget* uploadWidget(QWidget* parent) override; 0068 0069 void addSelectedImages(const QList<QUrl>& images); 0070 void addSelectedImage(const QUrl& image); 0071 0072 void addSelectedAlbums(const QList<QUrl>& albums); 0073 void addSelectedAlbum(const QUrl& album); 0074 0075 void addAlbums(const QList<QUrl>& albums); 0076 void addAlbum(const QUrl& album); 0077 0078 void thumbnails(const QList<QUrl>& list, int size) override; 0079 0080 bool saveImage(const QUrl& url, const QString& format, 0081 const QByteArray& data, uint width, uint height, 0082 bool sixteenBit, bool hasAlpha, 0083 bool* cancel = nullptr) override; 0084 0085 FileReadWriteLock* createReadWriteLock(const QUrl&) const override; 0086 MetadataProcessor* createMetadataProcessor() const override; 0087 0088 private: 0089 0090 QList<QUrl> m_selectedImages; 0091 QList<QUrl> m_selectedAlbums; 0092 QList<QUrl> m_albums; 0093 0094 private: 0095 0096 friend class KipiUploadWidget; 0097 friend class KipiImageCollectionSelector; 0098 }; 0099 0100 } // namespace KXMLKipiCmd 0101 0102 #endif // __KIPIINTERFACE_H