Pimcommon

configurepluginslistwidget.h
1 /*
2  SPDX-FileCopyrightText: 2016-2022 Laurent Montel <[email protected]>
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>
14 class QTreeWidget;
15 class QAction;
17 namespace PimCommon
18 {
19 /**
20  * @brief The ConfigurePluginsListWidget class
21  * @author Laurent Montel <[email protected]>
22  */
23 class PIMCOMMON_EXPORT ConfigurePluginsListWidget : public QWidget
24 {
25  Q_OBJECT
26 public:
27  explicit ConfigurePluginsListWidget(QWidget *parent = nullptr);
28  ~ConfigurePluginsListWidget() override;
29 
30  virtual void save();
31  virtual void doLoadFromGlobalSettings();
32  virtual void doResetToDefaultsOther();
33  virtual void defaults();
34  virtual void initialize();
35  void initializeDone();
36 Q_SIGNALS:
37  void descriptionChanged(const QString &description);
38  void changed();
39  void configureClicked(const QString &configureGroupName, const QString &identifier);
40 
41 private:
42  void slotItemSelectionChanged();
43  void slotItemChanged(QTreeWidgetItem *item, int column);
44 
45 protected:
46  class PluginItem : public QTreeWidgetItem
47  {
48  public:
49  explicit PluginItem(QTreeWidgetItem *parent)
50  : QTreeWidgetItem(parent)
51  {
52  }
53 
54  QString mIdentifier;
55  QString mDescription;
56  bool mEnableByDefault = false;
57  bool mHasConfigureSupport = false;
58  bool mEnableFromUserSettings = false;
59  };
60  void savePlugins(const QString &groupName, const QString &prefixSettingKey, const QVector<PluginItem *> &listItems);
61  void fillTopItems(const QVector<PimCommon::PluginUtilData> &lst,
62  const QString &topLevelItemName,
63  const QString &groupName,
64  const QString &prefixKey,
65  QVector<PluginItem *> &itemsList,
66  const QString &configureGroupName = QString(),
67  bool checkable = true);
68  void resetToUserSettings(const QVector<PluginItem *> &items);
69  void changeState(const QVector<PluginItem *> &items);
70 
71  QTreeWidget *const mListWidget;
72 
73 private:
74  KTreeWidgetSearchLineWidget *mTreeWidgetSearchLineEdit = nullptr;
75  void slotConfigureClicked(QAction *act);
76  bool mInitializeDone = false;
77 };
78 }
folderdialogacltab.h
The ConfigurePluginsListWidget class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 03:51:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.