File indexing completed on 2024-06-02 05:09:20

0001 /***************************************************************************
0002  *   SPDX-License-Identifier: GPL-2.0-or-later
0003  *                                                                         *
0004  *   SPDX-FileCopyrightText: 2004-2023 Thomas Fischer <fischer@unix-ag.uni-kl.de>
0005  *                                                                         *
0006  *   This program is free software; you can redistribute it and/or modify  *
0007  *   it under the terms of the GNU General Public License as published by  *
0008  *   the Free Software Foundation; either version 2 of the License, or     *
0009  *   (at your option) any later version.                                   *
0010  *                                                                         *
0011  *   This program is distributed in the hope that it will be useful,       *
0012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0014  *   GNU General Public License for more details.                          *
0015  *                                                                         *
0016  *   You should have received a copy of the GNU General Public License     *
0017  *   along with this program; if not, see <https://www.gnu.org/licenses/>. *
0018  ***************************************************************************/
0019 
0020 #ifndef KBIBTEX_GUI_FILESETTINGSWIDGET_H
0021 #define KBIBTEX_GUI_FILESETTINGSWIDGET_H
0022 
0023 #include <QWidget>
0024 
0025 #include <Value>
0026 
0027 #include "kbibtexgui_export.h"
0028 
0029 class QCheckBox;
0030 class QComboBox;
0031 class QLineEdit;
0032 
0033 class File;
0034 
0035 /**
0036  * @author Thomas Fischer
0037  */
0038 class KBIBTEXGUI_EXPORT FileSettingsWidget : public QWidget
0039 {
0040     Q_OBJECT
0041 
0042 public:
0043     explicit FileSettingsWidget(QWidget *parent);
0044 
0045     void loadProperties(File *file);
0046     void saveProperties(File *file);
0047 
0048 public Q_SLOTS:
0049     void resetToLoadedProperties();
0050     void resetToDefaults();
0051 
0052 Q_SIGNALS:
0053     void widgetsChanged();
0054 
0055 private:
0056     QComboBox *m_comboBoxEncodings;
0057     QComboBox *m_comboBoxStringDelimiters;
0058     QComboBox *m_comboBoxCommentContext;
0059     QLineEdit *m_lineEditCommentPrefix;
0060     QComboBox *m_comboBoxKeywordCasing;
0061     QCheckBox *m_checkBoxProtectCasing;
0062     QComboBox *m_comboBoxPersonNameFormatting;
0063     QComboBox *m_comboBoxListSeparator;
0064     QCheckBox *m_checkBoxSortedByIdentifier;
0065 
0066     const Person dummyPerson;
0067     File *m_file;
0068 
0069     void setupGUI();
0070 };
0071 
0072 #endif // KBIBTEX_GUI_FILESETTINGSWIDGET_H