mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Options dialog
This commit is contained in:
63
PdfForQtViewer/pdfviewersettings.h
Normal file
63
PdfForQtViewer/pdfviewersettings.h
Normal file
@ -0,0 +1,63 @@
|
||||
#ifndef PDFVIEWERSETTINGS_H
|
||||
#define PDFVIEWERSETTINGS_H
|
||||
|
||||
#include "pdfrenderer.h"
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace pdfviewer
|
||||
{
|
||||
|
||||
class PDFViewerSettings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
inline explicit PDFViewerSettings(QObject* parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void readSettings(QSettings& settings);
|
||||
void writeSettings(QSettings& settings);
|
||||
|
||||
QString getDirectory() const;
|
||||
void setDirectory(const QString& directory);
|
||||
|
||||
pdf::PDFRenderer::Features getFeatures() const;
|
||||
void setFeatures(const pdf::PDFRenderer::Features& features);
|
||||
|
||||
pdf::RendererEngine getRendererEngine() const;
|
||||
void setRendererEngine(pdf::RendererEngine rendererEngine);
|
||||
|
||||
int getRendererSamples() const;
|
||||
void setRendererSamples(int rendererSamples);
|
||||
|
||||
signals:
|
||||
void settingsChanged();
|
||||
|
||||
private:
|
||||
struct Settings
|
||||
{
|
||||
Settings() :
|
||||
m_features(pdf::PDFRenderer::getDefaultFeatures()),
|
||||
m_rendererEngine(pdf::RendererEngine::OpenGL),
|
||||
m_rendererSamples(16)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
pdf::PDFRenderer::Features m_features;
|
||||
QString m_directory;
|
||||
pdf::RendererEngine m_rendererEngine;
|
||||
int m_rendererSamples;
|
||||
};
|
||||
|
||||
Settings m_settings;
|
||||
};
|
||||
|
||||
|
||||
} // namespace pdfviewer
|
||||
|
||||
#endif // PDFVIEWERSETTINGS_H
|
Reference in New Issue
Block a user