PDF4QT/PdfForQtViewer/pdfviewersettingsdialog.h

76 lines
2.0 KiB
C
Raw Normal View History

2019-12-07 17:59:03 +01:00
// Copyright (C) 2019 Jakub Melka
//
// This file is part of PdfForQt.
//
// PdfForQt is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// PdfForQt is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with PDFForQt. If not, see <https://www.gnu.org/licenses/>.
2019-09-06 19:07:52 +02:00
#ifndef PDFVIEWERSETTINGSDIALOG_H
#define PDFVIEWERSETTINGSDIALOG_H
#include "pdfviewersettings.h"
#include <QDialog>
class QListWidgetItem;
namespace Ui
{
class PDFViewerSettingsDialog;
}
namespace pdfviewer
{
class PDFViewerSettingsDialog : public QDialog
{
Q_OBJECT
public:
2019-12-16 19:46:29 +01:00
explicit PDFViewerSettingsDialog(const PDFViewerSettings::Settings& settings, QList<QAction*> actions, QWidget* parent);
2019-09-06 19:07:52 +02:00
virtual ~PDFViewerSettingsDialog() override;
2019-12-16 19:46:29 +01:00
virtual void accept() override;
2019-09-06 19:07:52 +02:00
enum Page : int
{
EngineSettings,
RenderingSettings,
2019-11-30 16:26:32 +01:00
ShadingSettings,
2019-12-15 19:28:25 +01:00
CacheSettings,
2019-12-16 19:46:29 +01:00
ShortcutSettings,
2019-11-30 16:26:32 +01:00
SecuritySettings
2019-09-06 19:07:52 +02:00
};
2019-09-07 19:01:54 +02:00
const PDFViewerSettings::Settings& getSettings() const { return m_settings; }
2019-09-06 19:07:52 +02:00
private slots:
void on_optionsPagesWidget_currentItemChanged(QListWidgetItem* current, QListWidgetItem* previous);
private:
2019-09-07 19:01:54 +02:00
void loadData();
void saveData();
2019-12-16 19:46:29 +01:00
void loadActionShortcutsTable();
bool saveActionShortcutsTable();
2019-09-06 19:07:52 +02:00
Ui::PDFViewerSettingsDialog* ui;
2019-09-07 19:01:54 +02:00
PDFViewerSettings::Settings m_settings;
2019-12-16 19:46:29 +01:00
QList<QAction*> m_actions;
2019-09-07 19:01:54 +02:00
bool m_isLoadingData;
2019-09-06 19:07:52 +02:00
};
} // namespace pdfviewer
#endif // PDFVIEWERSETTINGSDIALOG_H