File indexing completed on 2024-05-26 12:48:12

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2012 Arjen Hiemstra <ahiemstra@heimr.nl>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 #ifndef SETTINGS_H
0008 #define SETTINGS_H
0009 
0010 #include <QObject>
0011 #include <QString>
0012 #include <QQuickItem>
0013 
0014 class Settings : public QObject
0015 {
0016     Q_OBJECT
0017     Q_PROPERTY(QString currentFile READ currentFile WRITE setCurrentFile NOTIFY currentFileChanged)
0018     Q_PROPERTY(QString currentFileClass READ currentFileClass NOTIFY currentFileChanged)
0019     Q_PROPERTY(bool temporaryFile READ isTemporaryFile WRITE setTemporaryFile NOTIFY temporaryFileChanged)
0020     Q_PROPERTY(QQuickItem* focusItem READ focusItem WRITE setFocusItem NOTIFY focusItemChanged)
0021     Q_PROPERTY(QObject* theme READ theme NOTIFY themeChanged)
0022     Q_PROPERTY(QString themeID READ themeID WRITE setThemeID NOTIFY themeChanged)
0023 
0024 public:
0025     explicit Settings( QObject* parent = 0);
0026     ~Settings() override;
0027 
0028 public Q_SLOTS:
0029 
0030     QString currentFile() const;
0031     QString currentFileClass() const;
0032     void setCurrentFile(const QString &fileName);
0033 
0034     bool isTemporaryFile() const;
0035     void setTemporaryFile(bool temp);
0036 
0037     QQuickItem *focusItem();
0038     void setFocusItem(QQuickItem *item);
0039 
0040     QObject* theme() const;
0041 
0042     QString themeID() const;
0043     void setThemeID(const QString& id);
0044 
0045     int mimeTypeToDocumentClass(QString mimeType) const;
0046 
0047 Q_SIGNALS:
0048     void canvasChanged();
0049     void currentFileChanged();
0050     void temporaryFileChanged();
0051     void focusItemChanged();
0052     void themeChanged();
0053     void loadingFinished();
0054 
0055 private:
0056     class Private;
0057     Private* const d;
0058 };
0059 
0060 #endif // SETTINGS_H