diff --git a/core/libs/dplugins/core/dplugin.h b/core/libs/dplugins/core/dplugin.h index 4df5849324..44a54bfc2b 100644 --- a/core/libs/dplugins/core/dplugin.h +++ b/core/libs/dplugins/core/dplugin.h @@ -1,214 +1,215 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2018-07-30 * Description : abstract class to define digiKam plugin * * Copyright (C) 2018-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_DPLUGIN_H #define DIGIKAM_DPLUGIN_H // Qt includes #include #include #include #include #include #include #include #include #include // Local includes #include "dpluginauthor.h" #include "digikam_export.h" -/** The plugin interface identifier definitions shared between DPlugins and Loader to - * check the binary compatibility at run-time. +/** + * The plugin interface identifier definitions shared between DPlugins and Loader to + * check the binary compatibility at run-time. */ #define DIGIKAM_DPLUGIN_GENERIC_IID "org.kde.digikam.DPluginGeneric/1.1.0" #define DIGIKAM_DPLUGIN_EDITOR_IID "org.kde.digikam.DPluginEditor/1.1.0" #define DIGIKAM_DPLUGIN_BQM_IID "org.kde.digikam.DPluginBqm/1.1.0" #define DIGIKAM_DPLUGIN_RAWIMPORT_IID "org.kde.digikam.DPluginRawImport/1.1.0" #define DIGIKAM_DPLUGIN_DIMG_IID "org.kde.digikam.DPluginDImg/1.1.0" namespace Digikam { /** * A digiKam external plugin abstract class. */ class DIGIKAM_EXPORT DPlugin : public QObject { Q_OBJECT public: /** * Constructor with optional parent object */ explicit DPlugin(QObject* const parent = nullptr); /** * Destructor */ ~DPlugin() override; public: /** * Return a list of authors as strings registered in this plugin. */ QStringList pluginAuthors() const; /** * Return the internal version used to check the binary compatibility at run-time. * This is typically the same version of digiKam core used at compilation time. */ QString version() const; /** * Return the should loaded property. * If it's true, the plugin must be loaded in application GUI at startup by plugin loader. */ bool shouldLoaded() const; /** * Accessor to adjust the should loaded plugin property. * This property is adjusted by plugin loader at start-up. */ void setShouldLoaded(bool b); /** * @brief Returns the file name of the library for this plugin. * This string is filled at run-time by plugin loader. */ QString libraryFileName() const; /** * @brief Sets the file name of the library for this plugin. * This string is filled at run-time by plugin loader. */ void setLibraryFileName(const QString&); public: /** * Plugin method to clean up internal created objects. * This method is called by plugin loader. */ virtual void cleanUp() {}; /** * Return true if plugin can be configured in setup dialog about the visibility property. * Default implementation return true. */ virtual bool hasVisibilityProperty() const; /** * Holds whether the plugin can be seen in parent view. */ virtual void setVisible(bool b) = 0; /** * Return the amount of tools registered to all parents. */ virtual int count() const = 0; /** * Return a list of categories as strings registered in this plugin. */ virtual QStringList categories() const = 0; /** * Plugin factory method to create all internal object instances for a given parent. */ virtual void setup(QObject* const parent) = 0; /** * @brief Returns the user-visible name of the plugin. * * The user-visible name should be context free, i.e. the name should * provide enough information as to what the plugin is about in the context * of digiKam. */ virtual QString name() const = 0; /** * @brief Returns the unique internal identification property of the plugin. * Must be formated as "org.kde.digikam.plugin._PLUGIN_TYPE_._NAME_OF_PLUGIN_". * Examples: "org.kde.digikam.plugin.generic.Calendar" * "org.kde.digikam.plugin.editor.AdjustCurvesTool" * "org.kde.digikam.plugin.bqm.NoiseReduction" */ virtual QString iid() const = 0; /** * @brief Returns the unique top level internal identification property of the plugin interface. * Must be formated as "org.kde.digikam._NAME_OF_INTERFACE_/_VERSION_". * Examples: "org.kde.digikam.DPluginGeneric/1.1.0" * "org.kde.digikam.DPluginEditor/1.1.0" * "org.kde.digikam.DPluginBqm/1.1.0" */ virtual QString ifaceIid() const = 0; /** * @brief Returns a short description about the plugin. */ virtual QString description() const = 0; /** * @brief Returns an icon for the plugin. * Default implementation return the system plugin icon. */ virtual QIcon icon() const; /** * @brief Returns authors list for the plugin. */ virtual QList authors() const = 0; /** * @brief Returns a long description about the plugin. */ virtual QString details() const = 0; /** * @brief Returns a list of extra data to show in plugin about dialog. */ virtual QMap extraAboutData() const { return QMap(); }; /** * @brief Returns the title of data returned by extraAboiutData(). */ virtual QString extraAboutDataTitle() const { return QString(); }; private: class Private; Private* const d; }; } // namespace Digikam Q_DECLARE_TYPEINFO(Digikam::DPluginAuthor, Q_MOVABLE_TYPE); #endif // DIGIKAM_DPLUGIN_H diff --git a/core/libs/dplugins/core/dpluginaction.h b/core/libs/dplugins/core/dpluginaction.h index 5ea2a2aeb0..7d0b2e4809 100644 --- a/core/libs/dplugins/core/dpluginaction.h +++ b/core/libs/dplugins/core/dpluginaction.h @@ -1,109 +1,109 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2018-07-30 * Description : action container for external plugin * * Copyright (C) 2018-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_DPLUGIN_ACTION_H #define DIGIKAM_DPLUGIN_ACTION_H // Qt includes #include #include // Local includes #include "digikam_export.h" namespace Digikam { class DIGIKAM_EXPORT DPluginAction : public QAction { public: /// Plugin action types to resume where they can be used. enum ActionType { - InvalidType = -1, + InvalidType = -1, ///< An invalid action category. - Generic = 0, /// Generic action available everywhere (AlbumView, Editor, and LightTable). - Editor /// Specific action for Image Editor and Showfoto. + Generic = 0, ///< Generic action available everywhere (AlbumView, Editor, and LightTable). + Editor ///< Specific action for Image Editor and Showfoto. }; /// Plugin action categories. enum ActionCategory { InvalidCat = -1, - GenericExport = 0, /// Generic export action. - GenericImport, /// Generic import action. - GenericTool, /// Generic processing action. - GenericMetadata, /// Generic Metadata adjustement action. - GenericView, /// Generic View action (as Slideshow). - - EditorFile, /// Image Editor file action. - EditorColors, /// Image Editor color correction action. - EditorEnhance, /// Image Editor enhance action. - EditorTransform, /// Image Editor transform action. - EditorDecorate, /// Image Editor decorate action. - EditorFilters /// Image Editor special effects action. + GenericExport = 0, ///< Generic export action. + GenericImport, ///< Generic import action. + GenericTool, ///< Generic processing action. + GenericMetadata, ///< Generic Metadata adjustement action. + GenericView, ///< Generic View action (as Slideshow). + + EditorFile, ///< Image Editor file action. + EditorColors, ///< Image Editor color correction action. + EditorEnhance, ///< Image Editor enhance action. + EditorTransform, ///< Image Editor transform action. + EditorDecorate, ///< Image Editor decorate action. + EditorFilters ///< Image Editor special effects action. }; public: explicit DPluginAction(QObject* const parent = nullptr); ~DPluginAction(); /** * Manage the internal action category. */ void setActionCategory(ActionCategory cat); ActionCategory actionCategory() const; QString actionCategoryToString() const; /** * Return the action type depending of category. */ ActionType actionType() const; /** * Return the plugin id string hosting this action. */ QString pluginId() const; /** * Return the XML section to merge in KXMLGUIClient host XML definition. */ QString xmlSection() const; /** * Return details as string about action properties. * For debug purpose only. */ QString toString() const; static bool pluginActionLessThan(DPluginAction* const a, DPluginAction* const b); }; } // namespace Digikam #endif // DIGIKAM_DPLUGIN_ACTION_H diff --git a/core/libs/dplugins/core/dpluginauthor.h b/core/libs/dplugins/core/dpluginauthor.h index 156ed552f9..d37495a6cf 100644 --- a/core/libs/dplugins/core/dpluginauthor.h +++ b/core/libs/dplugins/core/dpluginauthor.h @@ -1,69 +1,69 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2018-07-30 * Description : author data container for external plugin * * Copyright (C) 2018-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_DPLUGIN_AUTHOR_H #define DIGIKAM_DPLUGIN_AUTHOR_H // Qt includes #include // Local includes #include "digikam_export.h" namespace Digikam { class DIGIKAM_EXPORT DPluginAuthor { public: DPluginAuthor(const QString& n, const QString& e, const QString& y); DPluginAuthor(const QString& n, const QString& e, const QString& y, const QString& r); ~DPluginAuthor(); /** * Return author details as string. * For debug purpose only. */ QString toString() const; public: - QString name; // Author name and surname - QString email; // Email anti-spammed - QString years; // Copyrights years - QString roles; // Author roles, as "Developer", "Designer", "Translator", etc. + QString name; ///< Author name and surname + QString email; ///< Email anti-spammed + QString years; ///< Copyrights years + QString roles; ///< Author roles, as "Developer", "Designer", "Translator", etc. }; } // namespace Digikam #endif // DIGIKAM_DPLUGIN_AUTHOR_H diff --git a/core/libs/dplugins/core/dplugindimg.h b/core/libs/dplugins/core/dplugindimg.h index 950c30efb3..fa8c680f87 100644 --- a/core/libs/dplugins/core/dplugindimg.h +++ b/core/libs/dplugins/core/dplugindimg.h @@ -1,126 +1,134 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2019-09-19 * Description : digiKam plugin definition for DImg image loader. * * Copyright (C) 2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_DPLUGIN_DIMG_H #define DIGIKAM_DPLUGIN_DIMG_H // Qt includes #include // Local includes #include "dplugin.h" #include "dimgloader.h" #include "dpluginloader.h" #include "digikam_export.h" #include "drawdecoding.h" namespace Digikam { class DIGIKAM_EXPORT DPluginDImg : public DPlugin { Q_OBJECT public: /** * Constructor with optional parent object */ explicit DPluginDImg(QObject* const parent = nullptr); /** * Destructor */ ~DPluginDImg() override; public: /** This kind of plugin only provide one tool. */ int count() const override { return 1; }; /** This kind of plugin do not use a category. */ QStringList categories() const override { return QStringList(); }; /** This kind of plugin do not have GUI visibility attribute. */ void setVisible(bool) override {}; /** * Return the plugin interface identifier. */ QString ifaceIid() const override { return QLatin1String(DIGIKAM_DPLUGIN_DIMG_IID); }; - /** This kind of plugin do not need to be configurable + /** + * This kind of plugin do not need to be configurable */ bool hasVisibilityProperty() const override { return false; }; - /** With this kind of plugin, we will display the type-mimes list on about dialog. + /** + * With this kind of plugin, we will display the type-mimes list on about dialog. */ QMap extraAboutData() const override; QString extraAboutDataTitle() const override; public: - /** Return a single capitalized word to identify the format supported by the loader. - * Ex: jpeg => "JPG" ; tiff => "TIF", etc. + /** + * Return a single capitalized word to identify the format supported by the loader. + * Ex: jpeg => "JPG" ; tiff => "TIF", etc. */ virtual QString loaderName() const = 0; - /** Return the list of white-listed type-mimes supported by the loader, - * as a string of file-name suffix separated by spaces. - * Ex: "jpeg jpg thm" + /** + * Return the list of white-listed type-mimes supported by the loader, + * as a string of file-name suffix separated by spaces. + * Ex: "jpeg jpg thm" */ virtual QString typeMimes() const = 0; - /** Return true if the loader can read a preview image. + /** + * Return true if the loader can read a preview image. */ virtual bool previewSupported() const { return false; }; - /** Return > 0 if source file path is supported by the loader and contents can be loaded. - * The return value (1 - 100) is a priority. - * DigiKam default loaders have a priority of 10, the - * QImage loader has a priority of 80 and the - * ImageMagick loader has a priority of 90. - * If the loader is to be used before the default loader, - * the value must be less than 10. + /** + * Return > 0 if source file path is supported by the loader and contents can be loaded. + * The return value (1 - 100) is a priority. + * digiKam default loaders have a priority of 10, the + * QImage loader has a priority of 80 and the + * ImageMagick loader has a priority of 90. + * If the loader is to be used before the default loader, + * the value must be less than 10. */ virtual int canRead(const QFileInfo& fileInfo, bool magic) const = 0; - /** Return > 0 if target file format is supported by the loader and contents can be written. - * The return value (1 - 100) is a priority. + /** + * Return > 0 if target file format is supported by the loader and contents can be written. + * The return value (1 - 100) is a priority. */ virtual int canWrite(const QString& format) const = 0; - /** Return the image loader instance for the DImg instance. + /** + * Return the image loader instance for the DImg instance. */ virtual DImgLoader* loader(DImg* const image, const DRawDecoding& rawSettings = DRawDecoding()) const = 0; }; } // namespace Digikam Q_DECLARE_INTERFACE(Digikam::DPluginDImg, DIGIKAM_DPLUGIN_DIMG_IID) #endif // DIGIKAM_DPLUGIN_DIMG_H diff --git a/core/libs/dplugins/core/dpluginrawimport.h b/core/libs/dplugins/core/dpluginrawimport.h index 0005f40393..53d2e595fa 100644 --- a/core/libs/dplugins/core/dpluginrawimport.h +++ b/core/libs/dplugins/core/dpluginrawimport.h @@ -1,95 +1,101 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2019-09-08 * Description : RAW Import digiKam plugin definition. * * Copyright (C) 2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_DPLUGIN_RAW_IMPORT_H #define DIGIKAM_DPLUGIN_RAW_IMPORT_H // Local includes #include "dplugin.h" #include "dimg.h" #include "loadingdescription.h" #include "dpluginloader.h" #include "digikam_export.h" namespace Digikam { class DIGIKAM_EXPORT DPluginRawImport : public DPlugin { Q_OBJECT public: /** * Constructor with optional parent object */ explicit DPluginRawImport(QObject* const parent = nullptr); /** * Destructor */ ~DPluginRawImport() override; public: - /** This kind of plugin only provide one tool. + /** + * This kind of plugin only provide one tool. */ int count() const override { return 1; }; - /** This kind of plugin do not use a category. + /** + * This kind of plugin do not use a category. */ QStringList categories() const override { return QStringList(); }; - /** This kind of plugin do not have GUI visibility attribute. + /** + * This kind of plugin do not have GUI visibility attribute. */ void setVisible(bool) override {}; /** * Return the plugin interface identifier. */ QString ifaceIid() const override { return QLatin1String(DIGIKAM_DPLUGIN_RAWIMPORT_IID); }; public: - /** Function to re-implement to invoke Raw processor for a Raw file path. - * Default Raw decoding settings is also availalble. + /** + * Function to re-implement to invoke Raw processor for a Raw file path. + * Default Raw decoding settings is also availalble. */ virtual bool run(const QString& path, const DRawDecoding& def) = 0; Q_SIGNALS: - /** Signal to emit to notify host application to load Raw with these decoding settings. + /** + * Signal to emit to notify host application to load Raw with these decoding settings. */ void signalLoadRaw(const Digikam::LoadingDescription&); - /** Signal to emit to notify host application to load pre-decoded Raw preprocessed with these decoding settings. + /** + * Signal to emit to notify host application to load pre-decoded Raw preprocessed with these decoding settings. */ void signalDecodedImage(const Digikam::LoadingDescription&, const Digikam::DImg&); }; } // namespace Digikam Q_DECLARE_INTERFACE(Digikam::DPluginRawImport, DIGIKAM_DPLUGIN_RAWIMPORT_IID) #endif // DIGIKAM_DPLUGIN_RAW_IMPORT_H diff --git a/core/libs/dplugins/iface/dinfointerface.h b/core/libs/dplugins/iface/dinfointerface.h index cd3dd44ca1..bd6462a508 100644 --- a/core/libs/dplugins/iface/dinfointerface.h +++ b/core/libs/dplugins/iface/dinfointerface.h @@ -1,234 +1,242 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2017-05-06 * Description : template interface to image information. * This class do not depend of digiKam database library * to permit to re-use tools on Showfoto. * * Copyright (C) 2017-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_DINFO_INTERFACE_H #define DIGIKAM_DINFO_INTERFACE_H // Qt includes #include #include #include #include #include #include #include #include #include #include // Local includes #include "digikam_export.h" #include "digikam_config.h" #ifdef HAVE_MARBLE # include "gpsitemcontainer.h" #endif namespace Digikam { class DIGIKAM_EXPORT DInfoInterface : public QObject { Q_OBJECT public: - typedef QMap DInfoMap; // Map of properties name and value. - typedef QList DAlbumIDs; // List of Album ids. + typedef QMap DInfoMap; ///< Map of properties name and value. + typedef QList DAlbumIDs; ///< List of Album ids. public: explicit DInfoInterface(QObject* const parent); ~DInfoInterface(); - // Slot to call when date time stamp from item is changed. +public: + + /// Slot to call when date time stamp from item is changed. Q_SLOT virtual void slotDateTimeForUrl(const QUrl& url, const QDateTime& dt, bool updModDate); - // Slot to call when something in metadata from item is changed. + /// Slot to call when something in metadata from item is changed. Q_SLOT virtual void slotMetadataChangedForUrl(const QUrl& url); public: - // Low level items and albums methods + ///@{ + /// Low level items and albums methods virtual QList currentSelectedItems() const; virtual QList currentAlbumItems() const; virtual QList albumItems(int) const; virtual QList albumsItems(const DAlbumIDs&) const; virtual QList allAlbumItems() const; virtual DInfoMap albumInfo(int) const; virtual void setAlbumInfo(int, const DInfoMap&) const; virtual DInfoMap itemInfo(const QUrl&) const; virtual void setItemInfo(const QUrl&, const DInfoMap&) const; + ///@} public: + ///@{ // Albums chooser view methods (to use items from albums before to process). - virtual QWidget* albumChooser(QWidget* const parent) const; - virtual DAlbumIDs albumChooserItems() const; - virtual bool supportAlbums() const; + virtual QWidget* albumChooser(QWidget* const parent) const; + virtual DAlbumIDs albumChooserItems() const; + virtual bool supportAlbums() const; Q_SIGNAL void signalAlbumChooserSelectionChanged(); + ///@} public: + ///@{ // Album selector view methods (to upload items from an external place). - virtual QWidget* uploadWidget(QWidget* const parent) const; - virtual QUrl uploadUrl() const; + virtual QWidget* uploadWidget(QWidget* const parent) const; + virtual QUrl uploadUrl() const; Q_SIGNAL void signalUploadUrlChanged(); - // Url to upload new items without to use album selector. - virtual QUrl defaultUploadUrl() const; + /// Url to upload new items without to use album selector. + virtual QUrl defaultUploadUrl() const; Q_SIGNAL void signalImportedImage(const QUrl&); + ///@} public: // Return an instance of tag filter model if host application support this feature, else null pointer. virtual QAbstractItemModel* tagFilterModel(); #ifdef HAVE_MARBLE - virtual QList currentGPSItems() const; + virtual QList currentGPSItems() const; #endif }; // ----------------------------------------------------------------- /** DItemInfo is a class to get item information from host application (Showfoto or digiKam) * The interface is re-implemented in host and depend how item infromation must be retrieved (from a database or by file metadata). * The easy way to use this container is given below: * * // READ INFO FROM HOST --------------------------------------------- * * QUrl itemUrl; // The item url that you want to retrieve information. * DInfoInterface* hostIface; // The host application interface instance. * * DInfoInterface::DInfoMap info = hostIface->itemInfo(itemUrl); // First stage is to get the information map from host application. * DItemInfo item(info); // Second stage, is to create the DIntenInfo instance for this item by url. * QString title = item.name(); // Now you can retrieve the title, * QString description = item.comment(); // The comment, * QDateTime time = item.dateTime(); // The time stamp, etc. * * // WRITE INFO TO HOST ---------------------------------------------- * * QUrl itemUrl; // The item url that you want to retrieve information. * DInfoInterface* hostIface; // The host application interface instance. * * DInfoInterface::DInfoMap info; // First stage is to create an empty information storage map for this item. * DItemInfo item(info); // Second stage, is to create the DIntenInfo instance for this item. * item.setRating(3); // Store rating to info map. * item.setColorLabel(1); // Store color label to info map. * hostIface->setItemInfo(url, info); // Update item information to host using map. */ class DIGIKAM_EXPORT DItemInfo { public: explicit DItemInfo(const DInfoInterface::DInfoMap&); ~DItemInfo(); public: - QString name() const; - QString comment() const; - QString title() const; - QSize dimensions() const; - QDateTime dateTime() const; - QStringList tagsPath() const; - QStringList keywords() const; + QString name() const; + QString comment() const; + QString title() const; + QSize dimensions() const; + QDateTime dateTime() const; + QStringList tagsPath() const; + QStringList keywords() const; - int orientation() const; + int orientation() const; void setOrientation(int); - int rating() const; + int rating() const; void setRating(int); - int colorLabel() const; + int colorLabel() const; void setColorLabel(int); - int pickLabel() const; + int pickLabel() const; void setPickLabel(int); - double latitude() const; - double longitude() const; - double altitude() const; - qlonglong fileSize() const; - QStringList creators() const; - QString credit() const; - QString rights() const; - QString source() const; - QString make() const; - QString model() const; - QString exposureTime() const; - QString sensitivity() const; - QString aperture() const; - QString focalLength() const; - QString focalLength35mm() const; - QString videoCodec() const; - - bool hasGeolocationInfo() const; + double latitude() const; + double longitude() const; + double altitude() const; + qlonglong fileSize() const; + QStringList creators() const; + QString credit() const; + QString rights() const; + QString source() const; + QString make() const; + QString model() const; + QString exposureTime() const; + QString sensitivity() const; + QString aperture() const; + QString focalLength() const; + QString focalLength35mm() const; + QString videoCodec() const; + + bool hasGeolocationInfo() const; private: QVariant parseInfoMap(const QString& key) const; private: DInfoInterface::DInfoMap m_info; }; // ----------------------------------------------------------------- class DIGIKAM_EXPORT DAlbumInfo { public: explicit DAlbumInfo(const DInfoInterface::DInfoMap&); ~DAlbumInfo(); public: QString title() const; QString caption() const; QDate date() const; QString path() const; private: DInfoInterface::DInfoMap m_info; }; } // namespace Digikam #endif // DIGIKAM_DINFO_INTERFACE_H diff --git a/core/libs/dplugins/iface/dmetainfoiface.h b/core/libs/dplugins/iface/dmetainfoiface.h index 2549b27c63..6c2a89894d 100644 --- a/core/libs/dplugins/iface/dmetainfoiface.h +++ b/core/libs/dplugins/iface/dmetainfoiface.h @@ -1,78 +1,80 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2017-05-06 * Description : interface to item information for shared tools * based on DMetadata. * * Copyright (C) 2017-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_DMETA_INFO_IFACE_H #define DIGIKAM_DMETA_INFO_IFACE_H // Local includes #include "digikam_export.h" #include "dinfointerface.h" namespace Digikam { class DIGIKAM_EXPORT DMetaInfoIface : public DInfoInterface { Q_OBJECT public: explicit DMetaInfoIface(QObject* const, const QList&); ~DMetaInfoIface(); - Q_SLOT void slotDateTimeForUrl(const QUrl& url, const QDateTime& dt, bool updModDate) override; - Q_SLOT void slotMetadataChangedForUrl(const QUrl& url) override; + Q_SLOT void slotDateTimeForUrl(const QUrl& url, + const QDateTime& dt, + bool updModDate) override; + Q_SLOT void slotMetadataChangedForUrl(const QUrl& url) override; Q_SIGNAL void signalItemChanged(const QUrl& url); public: - QList currentSelectedItems() const override; - QList currentAlbumItems() const override; - QList allAlbumItems() const override; + QList currentSelectedItems() const override; + QList currentAlbumItems() const override; + QList allAlbumItems() const override; - DInfoMap itemInfo(const QUrl&) const override; - void setItemInfo(const QUrl&, const DInfoMap&) const override; + DInfoMap itemInfo(const QUrl&) const override; + void setItemInfo(const QUrl&, const DInfoMap&) const override; - bool supportAlbums() const override; + bool supportAlbums() const override; - QWidget* uploadWidget(QWidget* const parent) const override; - QUrl uploadUrl() const override; + QWidget* uploadWidget(QWidget* const parent) const override; + QUrl uploadUrl() const override; - QUrl defaultUploadUrl() const override; + QUrl defaultUploadUrl() const override; #ifdef HAVE_MARBLE - QList currentGPSItems() const override; + QList currentGPSItems() const override; #endif private: class Private; Private* const d; }; } // namespace Digikam #endif // DIGIKAM_DMETA_INFO_IFACE_H diff --git a/core/libs/dplugins/setup/dpluginconfview.h b/core/libs/dplugins/setup/dpluginconfview.h index b55f97c035..ca930a9c82 100644 --- a/core/libs/dplugins/setup/dpluginconfview.h +++ b/core/libs/dplugins/setup/dpluginconfview.h @@ -1,112 +1,122 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2018-12-31 * Description : configuration view for external plugin * * Copyright (C) 2018-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_DPLUGIN_CONF_VIEW_H #define DIGIKAM_DPLUGIN_CONF_VIEW_H // Qt includes #include #include #include // Local includes #include "dpluginloader.h" #include "digikam_export.h" #include "dpluginaction.h" namespace Digikam { class DIGIKAM_EXPORT DPluginConfView : public QTreeWidget { Q_OBJECT public: - /** Default constructor. + /** + * Default constructor. */ explicit DPluginConfView(QWidget* const parent=nullptr); ~DPluginConfView(); - /** Apply all changes about plugins selected to be hosted in host application. + /** + * Apply all changes about plugins selected to be hosted in host application. */ void apply(); - /** Return the number of plugins actived in the list. + /** + * Return the number of plugins actived in the list. */ - int actived() const; + int actived() const; - /** Return the total number of plugins in the list. + /** + * Return the total number of plugins in the list. */ - int count() const; + int count() const; - /** Return the number of visible plugins in the list. + /** + * Return the number of visible plugins in the list. */ - int itemsVisible() const; + int itemsVisible() const; - /** Return the number of plugins in the list with visibly properties availalble. + /** + * Return the number of plugins in the list with visibly properties availalble. */ - int itemsWithVisiblyProperty() const; + int itemsWithVisiblyProperty() const; - /** Select all plugins in the list. + /** + * Select all plugins in the list. */ - void selectAll() override; + void selectAll() override; - /** Clear all selected plugins in the list. + /** + * Clear all selected plugins in the list. */ void clearAll(); - /** Set the string used to filter the plugins list. signalSearchResult() is emitted when all is done. + /** + * Set the string used to filter the plugins list. signalSearchResult() is emitted when all is done. */ void setFilter(const QString& filter, Qt::CaseSensitivity cs); - /** Return the current string used to filter the plugins list. + /** + * Return the current string used to filter the plugins list. */ - QString filter() const; + QString filter() const; DPlugin* plugin(QTreeWidgetItem* const item) const; protected: QTreeWidgetItem* appendPlugin(DPlugin* const); virtual void loadPlugins() = 0; Q_SIGNALS: /** Signal emitted when filtering is done through slotSetFilter(). * Number of plugins found is sent when item relevant of filtering match the query. */ void signalSearchResult(int); private: class Private; Private* const d; }; } // namespace Digikam #endif // DIGIKAM_DPLUGIN_CONF_VIEW_H diff --git a/core/libs/dplugins/setup/dpluginloader_p.h b/core/libs/dplugins/setup/dpluginloader_p.h index ee51549d46..e7f66395e7 100644 --- a/core/libs/dplugins/setup/dpluginloader_p.h +++ b/core/libs/dplugins/setup/dpluginloader_p.h @@ -1,64 +1,66 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2018-07-30 * Description : manager to load external plugins at run-time: private container * * Copyright (C) 2018-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_DPLUGIN_LOADER_P_H #define DIGIKAM_DPLUGIN_LOADER_P_H #include "dpluginloader.h" // Qt includes #include #include namespace Digikam { class Q_DECL_HIDDEN DPluginLoader::Private { public: explicit Private(); ~Private(); - /** Try to find plugin files from Qt5 plugins install dir: + /** + * Try to find plugin files from Qt5 plugins install dir: */ QFileInfoList pluginEntriesList() const; - /** Stage to load plugins in memory - */ + /** + * Stage to load plugins in memory + */ bool appendPlugin(QObject* const obj, QPluginLoader* const loader); void loadPlugins(); public: bool pluginsLoaded; QList allPlugins; QStringList blacklist; QStringList whitelist; }; } // namepace Digikam #endif // DIGIKAM_DPLUGIN_LOADER_P_H diff --git a/core/libs/dplugins/webservices/webwidget.h b/core/libs/dplugins/webservices/webwidget.h index 32c88a7dda..bb54362b2c 100644 --- a/core/libs/dplugins/webservices/webwidget.h +++ b/core/libs/dplugins/webservices/webwidget.h @@ -1,63 +1,63 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2018-7-30 * Description : Widget for displaying HTML in the backends * * Copyright (C) 2018 by Tarek Talaat * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_WEB_WIDGET_H #define DIGIKAM_WEB_WIDGET_H // Qt includes #include // Local includes #include "digikam_export.h" namespace Digikam { class DIGIKAM_EXPORT WebWidget : public QWebView { Q_OBJECT public: - explicit WebWidget(QWidget* const parent = 0); - ~WebWidget(); + explicit WebWidget(QWidget* const parent = 0); + ~WebWidget(); Q_SIGNALS: void closeView(bool val); protected: - void closeEvent(QCloseEvent *event) override; + void closeEvent(QCloseEvent* event) override; private: class Private; Private* const d; }; } // namespace Digikam #endif // DIGIKAM_WEB_WIDGET_H diff --git a/core/libs/dplugins/webservices/webwidget_qwebengine.h b/core/libs/dplugins/webservices/webwidget_qwebengine.h index 81a03d56f5..e5234e558f 100644 --- a/core/libs/dplugins/webservices/webwidget_qwebengine.h +++ b/core/libs/dplugins/webservices/webwidget_qwebengine.h @@ -1,68 +1,67 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2018-7-30 * Description : Widget for displaying HTML in the backends * * Copyright (C) 2018 by Tarek Talaat * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_WEB_WIDGET_QWEBENGINE_H #define DIGIKAM_WEB_WIDGET_QWEBENGINE_H // Qt includes #include #include #include #include #include // Local includes #include "digikam_export.h" namespace Digikam { class DIGIKAM_EXPORT WebWidget : public QWebEngineView { Q_OBJECT public: - explicit WebWidget(QWidget* const parent = nullptr); - ~WebWidget(); + explicit WebWidget(QWidget* const parent = nullptr); + ~WebWidget(); protected: - void closeEvent(QCloseEvent *event) override; + void closeEvent(QCloseEvent *event) override; Q_SIGNALS: void closeView(bool val); - private: class Private; Private* const d; }; } // namespace Digikam #endif // DIGIKAM_WEB_WIDGET_QWEBENGINE_H diff --git a/core/libs/dplugins/webservices/wscomboboxdelegate.h b/core/libs/dplugins/webservices/wscomboboxdelegate.h index 6e884a0690..74ed6d22f3 100644 --- a/core/libs/dplugins/webservices/wscomboboxdelegate.h +++ b/core/libs/dplugins/webservices/wscomboboxdelegate.h @@ -1,82 +1,86 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2009-07-05 * Description : A combobox delegate to display in Web service image lists. * * Copyright (C) 2009 by Pieter Edelman * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_WS_COMBO_BOX_DELEGATE_H #define DIGIKAM_WS_COMBO_BOX_DELEGATE_H // Qt includes #include #include #include #include #include #include #include #include #include // Local includes #include "digikam_export.h" #include "ditemslist.h" namespace Digikam { class DIGIKAM_EXPORT ComboBoxDelegate : public QAbstractItemDelegate { Q_OBJECT public: explicit ComboBoxDelegate(DItemsList* const, const QMap&); ~ComboBoxDelegate(); - /* Whenever an element needs to be edited, this method should be called. + /** + * Whenever an element needs to be edited, this method should be called. * It's actually a hack to prevent the item text shining through whenever * editing occurs. */ void startEditing(QTreeWidgetItem*, int); - /* Overloaded functions to provide the delegate functionality. + ///@{ + /** + * Overloaded functions to provide the delegate functionality. */ - void paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const override; - QSize sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const override; + void paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const override; + QSize sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const override; QWidget* createEditor(QWidget*, const QStyleOptionViewItem&, const QModelIndex&) const override; - void setEditorData(QWidget*, const QModelIndex&) const override; - void setModelData(QWidget*, QAbstractItemModel*, const QModelIndex&) const override; + void setEditorData(QWidget*, const QModelIndex&) const override; + void setModelData(QWidget*, QAbstractItemModel*, const QModelIndex&) const override; + ///@} private Q_SLOTS: void slotCommitAndCloseEditor(int); void slotResetEditedState(QObject*); private: class Private; Private* const d; }; } // namespace Digikam #endif // DIGIKAM_WS_COMBO_BOX_DELEGATE_H diff --git a/core/libs/dplugins/webservices/wscomboboxintermediate.h b/core/libs/dplugins/webservices/wscomboboxintermediate.h index 589fb1b881..7928d86e48 100644 --- a/core/libs/dplugins/webservices/wscomboboxintermediate.h +++ b/core/libs/dplugins/webservices/wscomboboxintermediate.h @@ -1,75 +1,77 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2009-07-05 * Description : A combobox which also has an intermediate state. * This is akin to the intermediate state in a checkbox and * needed when a single combobox controls more than one item, * which are manually set to different states. * The intermediate state is indicated by appending an extra item * with a user specified text (default is "Various"). Whenever an * other item is set, this special state is removed from the list * so it can never be selected explicitly. * * Copyright (C) 2009 by Pieter Edelman * Copyright (C) 2010-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_WS_COMBO_BOX_INTERMEDIATE_H #define DIGIKAM_WS_COMBO_BOX_INTERMEDIATE_H // Qt includes #include #include // Local includes #include "digikam_export.h" namespace Digikam { class DIGIKAM_EXPORT WSComboBoxIntermediate : public QComboBox { Q_OBJECT public: - /* Initialize the combobox with a parent and a string to indicate the + /** + * Initialize the combobox with a parent and a string to indicate the * intermediate state. */ explicit WSComboBoxIntermediate(QWidget* const = nullptr, const QString& = QString()); ~WSComboBoxIntermediate(); - /* Set the state of the combobox to intermediate. The intermediate state is + /** + * Set the state of the combobox to intermediate. The intermediate state is * 'unset' when another index is selected. */ void setIntermediate(bool); private Q_SLOTS: void slotIndexChanged(int); private: class Private; Private* const d; }; } // namespace Digikam #endif // DIGIKAM_WS_COMBO_BOX_INTERMEDIATE_H diff --git a/core/libs/dplugins/webservices/wsitem.h b/core/libs/dplugins/webservices/wsitem.h index 880049f174..0bbea3d776 100644 --- a/core/libs/dplugins/webservices/wsitem.h +++ b/core/libs/dplugins/webservices/wsitem.h @@ -1,116 +1,116 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2018-07-26 * Description : common items needed for web services * * Copyright (C) 2018 by Thanh Trung Dinh * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_WS_ITEM_H #define DIGIKAM_WS_ITEM_H // Qt includes #include #include // Local includes #include "digikam_export.h" namespace Digikam { class DIGIKAM_EXPORT WSAlbum { public: explicit WSAlbum() : parentID(QLatin1String("")), isRoot(true), description(QLatin1String("")), url(QLatin1String("")), uploadable(true) { } - /* + /** * This method is used by derived class of WSAblum, * to set the attributes inherited from WSAlbum, knowing * a WSAlbum. */ void setBaseAlbum(const WSAlbum& album) { id = album.id; parentID = album.parentID; isRoot = album.isRoot; title = album.title; description = album.description; location = album.location; url = album.url; uploadable = album.uploadable; } QString id; QString parentID; bool isRoot; QString title; QString description; QString location; QString url; bool uploadable; }; -/* +/** * This class is used when parsing response of listAlbums(). * It contains only the most important attributes of an album, * which is needed for further usage (e.g upload photos, create new album). */ class DIGIKAM_EXPORT AlbumSimplified { public: explicit AlbumSimplified() : uploadable(true) { } explicit AlbumSimplified(const QString& title) : title(title), uploadable(true) { } explicit AlbumSimplified(const QString& title, bool uploadable) : title(title), uploadable(uploadable) { } public: QString title; QStringList childrenIDs; bool uploadable; }; } // namespace Digikam #endif // DIGIKAM_WS_ITEM_H diff --git a/core/libs/dplugins/webservices/wssettings.h b/core/libs/dplugins/webservices/wssettings.h index 284884e4c2..4c0fa3e5a6 100644 --- a/core/libs/dplugins/webservices/wssettings.h +++ b/core/libs/dplugins/webservices/wssettings.h @@ -1,129 +1,133 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2017-01-24 * Description : Web Service settings container. * * Copyright (C) 2017-2019 by Gilles Caulier * Copyright (C) 2018 by Thanh Trung Dinh * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_WS_SETTINGS_H #define DIGIKAM_WS_SETTINGS_H // Qt includes #include #include #include #include #include #include #include #include // Local includes #include "digikam_export.h" #include "o0settingsstore.h" class KConfigGroup; namespace Digikam { class DIGIKAM_EXPORT WSSettings : public QObject { Q_OBJECT public: - // Images selection mode + /// Images selection mode enum Selection { EXPORT = 0, IMPORT }; enum WebService { FLICKR = 0, DROPBOX, IMGUR, FACEBOOK, SMUGMUG, GDRIVE, GPHOTO }; enum ImageFormat { JPEG = 0, PNG }; public: explicit WSSettings(QObject* const parent=nullptr); ~WSSettings(); - // Read and write settings in config file between sessions. + ///@{ + /// Read and write settings in config file between sessions. void readSettings(KConfigGroup& group); void writeSettings(KConfigGroup& group); + ///@} QString format() const; - // Helper methods to fill settings from GUI. + ///@{ + /// Helper methods to fill settings from GUI. static QMap webServiceNames(); static QMap imageFormatNames(); + ///@} - // Helper method to list all user accounts (of all web service) that user logged in before. + /// Helper method to list all user accounts (of all web service) that user logged in before. QStringList allUserNames(const QString& serviceName); public: - Selection selMode; // Items selection mode + Selection selMode; ///< Items selection mode - QList inputImages; // Selected items to upload. + QList inputImages; ///< Selected items to upload. bool addFileProperties; bool imagesChangeProp; bool removeMetadata; int imageCompression; qint64 attLimitInMbytes; WebService webService; QString userName; QSettings* oauthSettings; O0SettingsStore* oauthSettingsStore; - QString currentAlbumId; // Selected album to upload to + QString currentAlbumId; ///< Selected album to upload to int imageSize; ImageFormat imageFormat; - QMap itemsList; // Map of original item and attached item (can be resized). + QMap itemsList; ///< Map of original item and attached item (can be resized). }; } // namespace Digikam #endif // DIGIKAM_WS_SETTINGS_H diff --git a/core/libs/dplugins/webservices/wstoolutils.h b/core/libs/dplugins/webservices/wstoolutils.h index 30f6b60d9d..a30f4cdfaa 100644 --- a/core/libs/dplugins/webservices/wstoolutils.h +++ b/core/libs/dplugins/webservices/wstoolutils.h @@ -1,58 +1,59 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2014-09-12 * Description : Web Service tool utils methods * * Copyright (C) 2014-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_WS_TOOL_UTILS_H #define DIGIKAM_WS_TOOL_UTILS_H // Qt includes #include #include #include // Local includes #include "digikam_export.h" namespace Digikam { class DIGIKAM_EXPORT WSToolUtils { public: explicit WSToolUtils() {}; ~WSToolUtils() {}; - /** Generates random string. + /** + * Generates random string. */ static QString randomString(const int& length); static QDir makeTemporaryDir(const char* prefix); static void removeTemporaryDir(const char* prefix); static QSettings* getOauthSettings(QObject* const parent); }; } // namespace Digikam #endif // DIGIKAM_WS_TOOL_UTILS_H diff --git a/core/libs/dplugins/widgets/ditemslist.h b/core/libs/dplugins/widgets/ditemslist.h index 3f0eb3e16c..4b51897876 100644 --- a/core/libs/dplugins/widgets/ditemslist.h +++ b/core/libs/dplugins/widgets/ditemslist.h @@ -1,306 +1,310 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2008-05-21 * Description : widget to display a list of items * * Copyright (C) 2006-2019 by Gilles Caulier * Copyright (C) 2008-2010 by Andi Clemens * Copyright (C) 2009-2010 by Luka Renko * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_DITEMS_LIST_H #define DIGIKAM_DITEMS_LIST_H // Qt includes #include #include #include #include #include #include #include #include // Local includes #include "loadingdescription.h" #include "digikam_export.h" #include "dinfointerface.h" namespace Digikam { class DItemsList; class DItemsListView; class DIGIKAM_EXPORT DItemsListViewItem : public QTreeWidgetItem { public: enum State { Waiting, Success, Failed }; public: explicit DItemsListViewItem(DItemsListView* const view, const QUrl& url); ~DItemsListViewItem(); bool hasValidThumbnail() const; void setUrl(const QUrl& url); QUrl url() const; void setComments(const QString& comments); QString comments() const; void setTags(const QStringList& tags); QStringList tags() const; void setRating(int rating); int rating() const; void setThumb(const QPixmap& pix, bool hasThumb=true); void setProgressAnimation(const QPixmap& pix); void setProcessedIcon(const QIcon& icon); void setState(State state); State state() const; void updateInformation(); - // implement this, if you have special item widgets, e.g. an edit line - // they will be set automatically when adding items, changing order, etc. + /** + * implement this, if you have special item widgets, e.g. an edit line + * they will be set automatically when adding items, changing order, etc. + */ virtual void updateItemWidgets() {}; protected: DItemsListView* view() const; private: void setPixmap(const QPixmap& pix); private: class Private; Private* const d; }; // ------------------------------------------------------------------------- class DIGIKAM_EXPORT DItemsListView : public QTreeWidget { Q_OBJECT public: enum ColumnType { Thumbnail = 0, Filename, User1, User2, User3, User4, User5, User6 }; public: explicit DItemsListView(DItemsList* const parent = nullptr); explicit DItemsListView(int iconSize, DItemsList* const parent = nullptr); ~DItemsListView(); void setColumnLabel(ColumnType column, const QString& label); void setColumnEnabled(ColumnType column, bool enable); void setColumn(ColumnType column, const QString& label, bool enable); DItemsListViewItem* findItem(const QUrl& url); QModelIndex indexFromItem(DItemsListViewItem* item, int column = 0) const; DItemsListViewItem* getCurrentItem() const; DInfoInterface* iface() const; Q_SIGNALS: void signalAddedDropedItems(const QList&); void signalItemClicked(QTreeWidgetItem*); void signalContextMenuRequested(); private Q_SLOTS: void slotItemClicked(QTreeWidgetItem* item, int column); public: void enableDragAndDrop(const bool enable = true); private: void dragEnterEvent(QDragEnterEvent* e) override; void dragMoveEvent(QDragMoveEvent* e) override; void dropEvent(QDropEvent* e) override; void contextMenuEvent(QContextMenuEvent * e) override; void setup(int iconSize); void drawRow(QPainter* p, const QStyleOptionViewItem& opt, const QModelIndex& index) const override; private: int m_iconSize; }; // ------------------------------------------------------------------------- class DIGIKAM_EXPORT CtrlButton : public QPushButton { Q_OBJECT public: explicit CtrlButton(const QIcon& icon, QWidget* parent = nullptr); ~CtrlButton(); }; // ------------------------------------------------------------------------- class DIGIKAM_EXPORT DItemsList : public QWidget { Q_OBJECT public: enum ControlButtonPlacement { NoControlButtons = 0, ControlButtonsLeft, ControlButtonsRight, ControlButtonsAbove, ControlButtonsBelow }; enum ControlButton { Add = 0x1, Remove = 0x2, MoveUp = 0x4, MoveDown = 0x8, Clear = 0x10, Load = 0x20, Save = 0x40 }; Q_DECLARE_FLAGS(ControlButtons, ControlButton) public: explicit DItemsList(QWidget* const parent, int iconSize = -1); ~DItemsList(); void setAllowRAW(bool allow); void setAllowDuplicate(bool allow); void loadImagesFromCurrentSelection(); - /** A function to load all the images from the album if no image has been selected by user. + /** + * A function to load all the images from the album if no image has been selected by user. */ void loadImagesFromCurrentAlbum(); - /** a function to check whether an image has been selected or not. + /** + * a function to check whether an image has been selected or not. */ bool checkSelection(); int iconSize() const; DItemsListView* listView() const; void processing(const QUrl& url); void processed(const QUrl& url, bool success); void cancelProcess(); void clearProcessedStatus(); void setControlButtons(ControlButtons buttonMask); void setControlButtonsPlacement(ControlButtonPlacement placement); void enableControlButtons(bool enable = true); void enableDragAndDrop(const bool enable = true); void updateThumbnail(const QUrl& url); virtual QList imageUrls(bool onlyUnprocessed = false) const; virtual void removeItemByUrl(const QUrl& url); QUrl getCurrentUrl() const; void setIface(DInfoInterface* const iface); DInfoInterface* iface() const; Q_SIGNALS: void signalAddItems(const QList&); void signalMoveUpItem(); void signalMoveDownItem(); void signalRemovedItems(const QList&); void signalImageListChanged(); void signalFoundRAWImages(bool); void signalItemClicked(QTreeWidgetItem*); void signalContextMenuRequested(); void signalXMLSaveItem(QXmlStreamWriter&, int); void signalXMLLoadImageElement(QXmlStreamReader&); void signalXMLCustomElements(QXmlStreamWriter&); void signalXMLCustomElements(QXmlStreamReader&); public Q_SLOTS: virtual void slotAddImages(const QList& list); virtual void slotRemoveItems(); protected Q_SLOTS: void slotProgressTimerDone(); virtual void slotAddItems(); virtual void slotMoveUpItems(); virtual void slotMoveDownItems(); virtual void slotClearItems(); virtual void slotLoadItems(); virtual void slotSaveItems(); virtual void slotThumbnail(const LoadingDescription&, const QPixmap&); virtual void slotImageListChanged(); private: void setIconSize(int size); private: DItemsList(); // Disable default constructor. class Private; Private* const d; }; } // namespace Digikam Q_DECLARE_OPERATORS_FOR_FLAGS(Digikam::DItemsList::ControlButtons) #endif // DIGIKAM_DITEMS_LIST_H diff --git a/core/libs/dplugins/widgets/dpreviewimage.h b/core/libs/dplugins/widgets/dpreviewimage.h index aa089dd0d9..7eb0ea70b6 100644 --- a/core/libs/dplugins/widgets/dpreviewimage.h +++ b/core/libs/dplugins/widgets/dpreviewimage.h @@ -1,190 +1,196 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2009-12-13 * Description : a widget to preview image effect. * * Copyright (C) 2009-2019 by Gilles Caulier * Copyright (C) 2008 by Kare Sars * Copyright (C) 2012 by Benjamin Girault * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_DPREVIEW_IMAGE_H #define DIGIKAM_DPREVIEW_IMAGE_H // Qt includes #include #include #include #include // Local includes #include "digikam_export.h" class QResizeEvent; class QWheelEvent; class QMouseEvent; class QEvent; namespace Digikam { class DIGIKAM_EXPORT DSelectionItem : public QGraphicsItem { public: typedef enum { None, Top, TopRight, Right, BottomRight, Bottom, BottomLeft, Left, TopLeft, Move } Intersects; public: explicit DSelectionItem(const QRectF& rect); ~DSelectionItem(); public: void setMaxRight(qreal maxRight); void setMaxBottom(qreal maxBottom); Intersects intersects(QPointF& point); void saveZoom(qreal zoom); void setRect(const QRectF& rect); QRectF rect() const; QPointF fixTranslation(QPointF dp) const; public: // Graphics Item methods QRectF boundingRect() const override; void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override; private: void updateAnchors(); private: class Private; Private* const d; }; // ----------------------------------------------------------------------------------------- class DIGIKAM_EXPORT DPreviewImage : public QGraphicsView { Q_OBJECT public: explicit DPreviewImage(QWidget* const parent); ~DPreviewImage(); public: bool load(const QUrl& file) const; bool setImage(const QImage& img) const; void enableSelectionArea(bool b); /** * Sets a selection area and show it * * @param rectangle This rectangle should have height and width of 1.0 */ void setSelectionArea(const QRectF& rectangle); QRectF getSelectionArea() const; public Q_SLOTS: void slotZoomIn(); void slotZoomOut(); // void slotZoomSel(); // TODO: add a button for that purpose void slotZoom2Fit(); - // Selection area specific slots (TL = TopLeft, BR = BottomRight) + ///@{ + /// Selection area specific slots (TL = TopLeft, BR = BottomRight) void slotSetTLX(float ratio); void slotSetTLY(float ratio); void slotSetBRX(float ratio); void slotSetBRY(float ratio); + ///@} - /** This function is used to set a selection without the user setting it. + /** + * This function is used to set a selection without the user setting it. * \note all parameters must be in the range 0.0 -> 1.0. * \param tl_x is the x coordinate of the top left corner 0=0 1=image with. * \param tl_y is the y coordinate of the top left corner 0=0 1=image height. * \param br_x is the x coordinate of the bottom right corner 0=0 1=image with. * \param br_y is the y coordinate of the bottom right corner 0=0 1=image height. */ void slotSetSelection(float tl_x, float tl_y, float br_x, float br_y); void slotClearActiveSelection(); - /** This function is used to darken everything except what is inside the given area. + /** + * This function is used to darken everything except what is inside the given area. * \note all parameters must be in the range 0.0 -> 1.0. * \param tl_x is the x coordinate of the top left corner 0=0 1=image with. * \param tl_y is the y coordinate of the top left corner 0=0 1=image height. * \param br_x is the x coordinate of the bottom right corner 0=0 1=image with. * \param br_y is the y coordinate of the bottom right corner 0=0 1=image height. */ void slotSetHighlightArea(float tl_x, float tl_y, float br_x, float br_y); - /** This function sets the percentage of the highlighted area that is visible. - * The rest is hidden. This stacks with the previous highlight area. + /** + * This function sets the percentage of the highlighted area that is visible. + * The rest is hidden. This stacks with the previous highlight area. * \param percentage is the percentage of the highlighted area that is shown. * \param hideColor is the color to use to hide the highlighted area of the image. */ void slotSetHighlightShown(int percentage, QColor highLightColor = Qt::white); - /** This function removes the highlight area. + /** + * This function removes the highlight area. */ void slotClearHighlight(); protected: void wheelEvent(QWheelEvent*) override; void mousePressEvent(QMouseEvent*) override; void mouseReleaseEvent(QMouseEvent*) override; void mouseMoveEvent(QMouseEvent*) override; void enterEvent(QEvent*) override; void leaveEvent(QEvent*) override; bool eventFilter(QObject*, QEvent*) override; void resizeEvent(QResizeEvent*) override; void updateSelVisibility(); void updateHighlight(); private: class Private; Private* const d; }; } // namespace Digikam #endif // DIGIKAM_DPREVIEW_IMAGE_H diff --git a/core/libs/dplugins/widgets/dpreviewmanager.h b/core/libs/dplugins/widgets/dpreviewmanager.h index d132fe7b73..b4b1ddd5b6 100644 --- a/core/libs/dplugins/widgets/dpreviewmanager.h +++ b/core/libs/dplugins/widgets/dpreviewmanager.h @@ -1,97 +1,99 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2009-12-23 * Description : a widget to manage preview. * * Copyright (C) 2009-2019 by Gilles Caulier * Copyright (C) 2012 by Benjamin Girault * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #ifndef DIGIKAM_DPREVIEW_MANAGER_H #define DIGIKAM_DPREVIEW_MANAGER_H // Qt includes #include #include #include #include #include // Local includes #include "digikam_export.h" namespace Digikam { class DIGIKAM_EXPORT DPreviewManager : public QStackedWidget { Q_OBJECT public: enum DisplayMode { MessageMode = 0, PreviewMode }; public: explicit DPreviewManager(QWidget* const parent); ~DPreviewManager(); bool load(const QUrl& file, bool fit = true); void setImage(const QImage& img, bool fit = true); void setText(const QString& text, const QColor& color=Qt::white); void setBusy(bool b, const QString& text=QString()); void setThumbnail(const QPixmap& preview=QPixmap()); void setButtonText(const QString& text); void setButtonVisible(bool b); void setSelectionAreaPossible(bool b); + ///@{ /** * Manage a selection area and show it * * @param rectangle This rectangle should have height and width of 1.0 */ void setSelectionArea(const QRectF& rectangle); QRectF getSelectionArea() const; + ///@} Q_SIGNALS: void signalButtonClicked(); public Q_SLOTS: void slotLoad(const QUrl& url); private Q_SLOTS: void slotProgressTimerDone(); private: class Private; Private* const d; }; } // namespace Digikam #endif // DIGIKAM_DPREVIEW_MANAGER_H