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 enum PluginItemData {
28 Description = Qt::UserRole + 1,
29 };
30 explicit ConfigurePluginsListWidget(QWidget *parent = nullptr);
32
33 virtual void save();
34 virtual void doLoadFromGlobalSettings();
35 virtual void doResetToDefaultsOther();
36 virtual void defaults();
37 virtual void initialize();
38 void initializeDone();
39Q_SIGNALS:
40 void changed();
41 void configureClicked(const QString &configureGroupName, const QString &identifier);
42
43protected:
44 class PluginItem : public QTreeWidgetItem
45 {
46 public:
47 explicit PluginItem(QTreeWidgetItem *parent)
48 : QTreeWidgetItem(parent)
49 {
50 }
51
52 QString mIdentifier;
53 bool mEnableByDefault = false;
54 bool mHasConfigureSupport = false;
55 bool mEnableFromUserSettings = false;
56 };
57 void savePlugins(const QString &groupName, const QString &prefixSettingKey, const QList<PluginItem *> &listItems);
58 void fillTopItems(const QList<PimCommon::PluginUtilData> &lst,
59 const QString &topLevelItemName,
60 const QString &groupName,
61 const QString &prefixKey,
62 QList<PluginItem *> &itemsList,
63 const QString &configureGroupName = QString(),
64 bool checkable = true);
65 void resetToUserSettings(const QList<PluginItem *> &items);
66 void changeState(const QList<PluginItem *> &items);
67
68 QTreeWidget *const mListWidget;
69
70private:
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
UserRole
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:58:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.