File indexing completed on 2024-07-14 04:54:32

0001 /*
0002     The configuration page for the profiles
0003 
0004     SPDX-FileCopyrightText: 2014-2023 Alexander Reinholdt <alexander.reinholdt@kdemail.net>
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef SMB4KCONFIGPAGEPROFILES_H
0009 #define SMB4KCONFIGPAGEPROFILES_H
0010 
0011 // Qt includes
0012 #include <QCheckBox>
0013 #include <QList>
0014 #include <QPair>
0015 #include <QWidget>
0016 
0017 // KDE includes
0018 #include <KEditListWidget>
0019 
0020 // forward declarations
0021 struct ProfileContainer;
0022 
0023 class Smb4KConfigPageProfiles : public QWidget
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     /**
0029      * Constructor
0030      */
0031     explicit Smb4KConfigPageProfiles(QWidget *parent = nullptr);
0032 
0033     /**
0034      * Destructor
0035      */
0036     virtual ~Smb4KConfigPageProfiles();
0037 
0038     /**
0039      * Apply the changes made to the list of profiles
0040      */
0041     void applyChanges();
0042 
0043     /**
0044      * Returns TRUE if the list of profiles changed and FALSE otherwise.
0045      */
0046     bool profilesChanged() const;
0047 
0048 protected Q_SLOTS:
0049     void slotProfileUsageChanged(bool checked);
0050     void slotProfileAdded(const QString &text);
0051     void slotProfileRemoved(const QString &text);
0052     void slotProfileChanged();
0053 
0054 private:
0055     QCheckBox *m_useProfiles;
0056     QCheckBox *m_transferToFirstProfile;
0057     QCheckBox *m_makeAllDataAvailable;
0058     KEditListWidget *m_profilesWidget;
0059     QList<ProfileContainer> m_profiles;
0060     bool m_profilesChanged;
0061 };
0062 
0063 #endif