Pimcommon

configurepluginslistwidget.h
1/*
2 SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "pimcommon_export.h"
10#include <PimCommon/PluginUtil>
11#include <QWidget>
12
13#include <QTreeWidgetItem>
14class QTreeWidget;
15class QAction;
17namespace PimCommon
18{
19/**
20 * @brief The ConfigurePluginsListWidget class
21 * @author Laurent Montel <montel@kde.org>
22 */
23class PIMCOMMON_EXPORT ConfigurePluginsListWidget : public QWidget
24{
25 Q_OBJECT
26public:
27 explicit ConfigurePluginsListWidget(QWidget *parent = nullptr);
29
30 virtual void save();
31 virtual void doLoadFromGlobalSettings();
32 virtual void doResetToDefaultsOther();
33 virtual void defaults();
34 virtual void initialize();
35 void initializeDone();
36Q_SIGNALS:
37 void descriptionChanged(const QString &description);
38 void changed();
39 void configureClicked(const QString &configureGroupName, const QString &identifier);
40
41protected:
42 class PluginItem : public QTreeWidgetItem
43 {
44 public:
45 explicit PluginItem(QTreeWidgetItem *parent)
46 : QTreeWidgetItem(parent)
47 {
48 }
49
50 QString mIdentifier;
51 QString mDescription;
52 bool mEnableByDefault = false;
53 bool mHasConfigureSupport = false;
54 bool mEnableFromUserSettings = false;
55 };
56 void savePlugins(const QString &groupName, const QString &prefixSettingKey, const QList<PluginItem *> &listItems);
57 void fillTopItems(const QList<PimCommon::PluginUtilData> &lst,
58 const QString &topLevelItemName,
59 const QString &groupName,
60 const QString &prefixKey,
61 QList<PluginItem *> &itemsList,
62 const QString &configureGroupName = QString(),
63 bool checkable = true);
64 void resetToUserSettings(const QList<PluginItem *> &items);
65 void changeState(const QList<PluginItem *> &items);
66
67 QTreeWidget *const mListWidget;
68
69private:
70 PIMCOMMON_NO_EXPORT void slotItemSelectionChanged();
71 PIMCOMMON_NO_EXPORT void slotItemChanged(QTreeWidgetItem *item, int column);
72 PIMCOMMON_NO_EXPORT void slotConfigureClicked(QAction *act);
73 KTreeWidgetSearchLineWidget *mTreeWidgetSearchLineEdit = nullptr;
74 bool mInitializeDone = false;
75};
76}
The ConfigurePluginsListWidget class.
folderdialogacltab.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:39:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.