File indexing completed on 2024-05-19 05:55:48
0001 /* 0002 SPDX-FileCopyrightText: 2013 Valentin Rusu <kde@rusu.info> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 #ifndef WALLETCONTROLWIDGET_H 0007 #define WALLETCONTROLWIDGET_H 0008 0009 #include "ui_walletcontrolwidget.h" 0010 0011 class KWalletEditor; 0012 class ApplicationsManager; 0013 0014 namespace KWallet 0015 { 0016 class Wallet; 0017 } 0018 0019 class WalletControlWidget : public QWidget, public Ui::WalletControlWidget 0020 { 0021 Q_OBJECT 0022 public: 0023 explicit WalletControlWidget(QWidget *parent, const QString &walletName); 0024 0025 bool openWallet(); 0026 bool hasUnsavedChanges() const; 0027 0028 public Q_SLOTS: 0029 void onSetupWidget(); 0030 void onOpenClose(); 0031 void onWalletClosed(); 0032 void updateWalletDisplay(); 0033 void onDisconnectApplication(); 0034 void onChangePassword(); 0035 0036 protected: 0037 void hideEvent(QHideEvent *) override; 0038 void showEvent(QShowEvent *) override; 0039 0040 private: 0041 const QString _walletName; 0042 KWallet::Wallet *_wallet = nullptr; 0043 KWalletEditor *_walletEditor = nullptr; 0044 ApplicationsManager *_applicationsManager = nullptr; 0045 }; 0046 0047 #endif // WALLETCONTROLWIDGET_H