File indexing completed on 2024-07-21 12:43:52

0001 /***************************************************************************
0002     The configuration page for the profiles
0003                              -------------------
0004     begin                : Do Aug 07 2014
0005     copyright            : (C) 2014-2019 by Alexander Reinholdt
0006     email                : alexander.reinholdt@kdemail.net
0007  ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *   This program is free software; you can redistribute it and/or modify  *
0011  *   it under the terms of the GNU General Public License as published by  *
0012  *   the Free Software Foundation; either version 2 of the License, or     *
0013  *   (at your option) any later version.                                   *
0014  *                                                                         *
0015  *   This program is distributed in the hope that it will be useful, but   *
0016  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
0017  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
0018  *   General Public License for more details.                              *
0019  *                                                                         *
0020  *   You should have received a copy of the GNU General Public License     *
0021  *   along with this program; if not, write to the                         *
0022  *   Free Software Foundation, Inc., 51 Franklin Street, Suite 500, Boston,*
0023  *   MA 02110-1335, USA                                                    *
0024  ***************************************************************************/
0025 
0026 #ifndef SMB4KCONFIGPAGEPROFILES_H
0027 #define SMB4KCONFIGPAGEPROFILES_H
0028 
0029 // Qt includes
0030 #include <QList>
0031 #include <QPair>
0032 #include <QWidget>
0033 
0034 // KDE includes
0035 #include <KWidgetsAddons/KEditListWidget>
0036 
0037 
0038 class Smb4KConfigPageProfiles : public QWidget
0039 {
0040   Q_OBJECT
0041   
0042   public:
0043     /**
0044      * Constructor
0045      */
0046     explicit Smb4KConfigPageProfiles(QWidget *parent = 0);
0047     
0048     /**
0049      * Destructor
0050      */
0051     virtual ~Smb4KConfigPageProfiles();
0052     
0053     /**
0054      * This function returns a list of pairs that contains the
0055      * renamed profiles. The first entry of the pair is the old name
0056      * of the profile and the second entry is the new name.
0057      * 
0058      * @returns a list of name pairs
0059      */
0060     QList< QPair<QString,QString> > renamedProfiles() const;
0061     
0062     /**
0063      * Clear the list of renamed profiles.
0064      */
0065     void clearRenamedProfiles();
0066     
0067     /**
0068      * This function returns the list of removed profiles.
0069      * 
0070      * @returns the removed profiles
0071      */
0072     QStringList removedProfiles() const;
0073     
0074     /**
0075      * Clear the list of removed profiles.
0076      */
0077     void clearRemovedProfiles();
0078 
0079   protected Q_SLOTS:
0080     void slotEnableWidget(int state);
0081     void slotProfileRemoved(const QString &name);
0082     void slotProfileChanged();
0083 
0084   private:
0085     KEditListWidget *m_profiles;
0086     QList< QPair<QString,QString> > m_renamed;
0087     QStringList m_removed;
0088 };
0089 
0090 #endif