File indexing completed on 2024-05-05 04:33:14

0001 /*
0002     SPDX-FileCopyrightText: 2004-2018 Gilles Caulier <caulier dot gilles at gmail dot com>
0003     SPDX-FileCopyrightText: 2012 Victor Dodon <dodonvictor at gmail dot com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef KIPI_CONFIGWIDGET_H
0009 #define KIPI_CONFIGWIDGET_H
0010 
0011 // Std includes
0012 
0013 #include <memory>
0014 
0015 // Qt includes
0016 
0017 #include <QTreeWidgetItem>
0018 #include <QTreeWidget>
0019 
0020 // Local includes
0021 
0022 #include "plugin.h"
0023 #include "pluginloader.h"
0024 #include "libkipi_export.h"
0025 
0026 namespace KIPI
0027 {
0028 
0029 /**
0030  * @class ConfigWidget configwidget.h <KIPI/ConfigWidget>
0031  *
0032  * The ConfigWidget class.
0033  */
0034 class LIBKIPI_EXPORT ConfigWidget : public QTreeWidget
0035 {
0036     Q_OBJECT
0037 
0038 public:
0039 
0040     /** Default constructor.
0041      */
0042     ConfigWidget(QWidget* const parent = nullptr);
0043     ~ConfigWidget() override;
0044 
0045     /** Apply all changes about plugins selected to be hosted in KIPI host application.
0046      */
0047     void apply();
0048 
0049     /** Return the number of plugins actived in the list.
0050      */
0051     int actived() const;
0052 
0053     /** Return the total number of plugins in the list.
0054      */
0055     int count()   const;
0056 
0057     /** Return the number of visible plugins in the list.
0058      */
0059     int visible() const;
0060 
0061     /** Select all plugins in the list.
0062      */
0063     void selectAll() override;
0064 
0065     /** Clear all selected plugins in the list.
0066      */
0067     void clearAll();
0068 
0069     /** Set the string used to filter the plugins list. signalSearchResult() is emitted when all is done.
0070      */
0071     void setFilter(const QString& filter, Qt::CaseSensitivity cs);
0072 
0073     /** Return the current string used to filter the plugins list.
0074      */
0075     QString filter() const;
0076 
0077 Q_SIGNALS:
0078 
0079     /** Signal emitted when filtering is done through setFilter().
0080      *  Number of plugins found is sent when item relevant of filtering match the query.
0081      */
0082     void signalSearchResult(int);
0083 
0084 private:
0085 
0086     class Private;
0087     std::unique_ptr<Private> const d;
0088 };
0089 
0090 } // namespace KIPI
0091 
0092 
0093 #endif /* KIPI_CONFIGWIDGET_H */