1 /*
2  *  Copyright (C) 2018 Aetf <aetf@unlimitedcodeworks.xyz>
3  *
4  *  This program is free software: you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation, either version 2 or (at your option)
7  *  version 3 of the License.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef KEEPASSXC_SETTINGSWIDGETFDOSECRETS_H
19 #define KEEPASSXC_SETTINGSWIDGETFDOSECRETS_H
20 
21 #include "gui/MessageWidget.h"
22 
23 #include <QScopedPointer>
24 #include <QTimer>
25 #include <QWidget>
26 
27 class QAbstractItemView;
28 class QItemEditorCreatorBase;
29 class QItemEditorFactory;
30 
31 namespace FdoSecrets
32 {
33 
34     class Session;
35     class Collection;
36 
37 } // namespace FdoSecrets
38 
39 class FdoSecretsPlugin;
40 
41 namespace Ui
42 {
43     class SettingsWidgetFdoSecrets;
44 }
45 class SettingsWidgetFdoSecrets : public QWidget
46 {
47     Q_OBJECT
48 public:
49     explicit SettingsWidgetFdoSecrets(FdoSecretsPlugin* plugin, QWidget* parent = nullptr);
50     ~SettingsWidgetFdoSecrets() override;
51 
52 public slots:
53     void loadSettings();
54     void saveSettings();
55 
56 private slots:
57     void checkDBusName();
58     void updateServiceState();
59 
60 protected:
61     void showEvent(QShowEvent* event) override;
62     void hideEvent(QHideEvent* event) override;
63 
64 private:
65     void setupView(QAbstractItemView* view, int manageColumn, int editorTypeId, QItemEditorCreatorBase* creator);
66 
67 private:
68     QScopedPointer<Ui::SettingsWidgetFdoSecrets> m_ui;
69     QScopedPointer<QItemEditorFactory> m_factory;
70     FdoSecretsPlugin* m_plugin;
71     QTimer m_checkTimer;
72 };
73 
74 #endif // KEEPASSXC_SETTINGSWIDGETFDOSECRETS_H
75