File indexing completed on 2024-05-05 05:45:45

0001 /*
0002     SPDX-FileCopyrightText: 2001-2004 Otto Bruggeman <otto.bruggeman@home.nl>
0003     SPDX-FileCopyrightText: 2001-2003 John Firebaugh <jfirebaugh@kde.org>
0004     SPDX-FileCopyrightText: 2007 Kevin Kofler <kevin.kofler@chello.at>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #ifndef FILESPAGE_H
0010 #define FILESPAGE_H
0011 
0012 #include <QFrame>
0013 
0014 #include "dialogpages_export.h"
0015 
0016 class QGroupBox;
0017 
0018 class KComboBox;
0019 class KUrlComboBox;
0020 class KUrlRequester;
0021 
0022 class FilesSettings;
0023 
0024 class DIALOGPAGES_EXPORT FilesPage : public QFrame
0025 {
0026     Q_OBJECT
0027 public:
0028     FilesPage();
0029     ~FilesPage() override;
0030 
0031 public:
0032     KUrlRequester* firstURLRequester() const;
0033     KUrlRequester* secondURLRequester() const;
0034 
0035     QString encoding() const;
0036 
0037     void setFirstGroupBoxTitle(const QString& title);
0038     void setSecondGroupBoxTitle(const QString& title);
0039 
0040     void setURLsInComboBoxes();
0041 
0042     void setFirstURLRequesterMode(unsigned int mode);
0043     void setSecondURLRequesterMode(unsigned int mode);
0044 
0045 public:
0046     virtual void setSettings(FilesSettings* settings);
0047     virtual void restore();
0048     virtual void apply();
0049     virtual void setDefaults();
0050 
0051 Q_SIGNALS:
0052     // Signal when we set a url from browse buttons.
0053     // Since KUrlComboBox::setUrl doesn't emit textChanged we need to notify
0054     // the main dialog that we set a url programatically so it can enable OK
0055     // if there's a path in both boxes...
0056     void urlChanged();
0057 
0058 private Q_SLOTS:
0059     void open();
0060 
0061 private:
0062     void doOpen(KUrlComboBox* urlComboBox, bool selectFolders);
0063 
0064 private:
0065     QGroupBox*     m_firstGB;
0066     QGroupBox*     m_secondGB;
0067     QGroupBox*     m_thirdGB;
0068     KUrlComboBox*  m_firstURLComboBox;
0069     KUrlComboBox*  m_secondURLComboBox;
0070     KUrlRequester* m_firstURLRequester;
0071     KUrlRequester* m_secondURLRequester;
0072     KComboBox*     m_encodingComboBox;
0073 
0074     FilesSettings* m_settings;
0075 };
0076 
0077 #endif