Warning, file /office/calligra/gemini/ParagraphStylesModel.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2014 Dan Leinir Turthra Jensen <admin@leinir.dk>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  *
0006  */
0007 
0008 #ifndef PARAGRAPHSTYLESMODEL_H
0009 #define PARAGRAPHSTYLESMODEL_H
0010 
0011 #include <QModelIndex>
0012 
0013 class ParagraphStylesModel : public QAbstractListModel
0014 {
0015     Q_OBJECT
0016     Q_PROPERTY(QObject* document READ document WRITE setDocument NOTIFY documentChanged)
0017     Q_PROPERTY(QObject* textEditor READ textEditor WRITE setTextEditor NOTIFY textEditorChanged)
0018     Q_PROPERTY(QFont cursorFont READ cursorFont NOTIFY cursorFontChanged)
0019     Q_PROPERTY(int currentStyle READ currentStyle NOTIFY cursorFontChanged)
0020     Q_PROPERTY(qreal zoomLevel READ zoomLevel WRITE setZoomLevel NOTIFY zoomLevelChanged)
0021 
0022 public:
0023     enum ParagraphStyleRoles {
0024         Name = Qt::UserRole + 1,
0025         Current,
0026         Font,
0027         FontFamily,
0028         FontPointSize,
0029         FontWeight,
0030         FontItalic,
0031         FontUnderline
0032     };
0033     ParagraphStylesModel();
0034     ~ParagraphStylesModel() override;
0035     QHash<int, QByteArray> roleNames() const override;
0036     QVariant data(const QModelIndex& index, int role) const override;
0037     int rowCount(const QModelIndex& parent) const override;
0038 
0039     QObject* document() const;
0040     void setDocument(QObject* newDocument);
0041 
0042     QObject* textEditor() const;
0043     void setTextEditor(QObject* newEditor);
0044 
0045     Q_SLOT void cursorPositionChanged();
0046 
0047     Q_INVOKABLE void activate(int index);
0048 
0049     QFont cursorFont() const;
0050     int currentStyle() const;
0051 
0052     qreal zoomLevel() const;
0053     void setZoomLevel(const qreal& newZoom);
0054 Q_SIGNALS:
0055     void documentChanged();
0056     void textEditorChanged();
0057     void cursorFontChanged();
0058     void zoomLevelChanged();
0059 
0060 private:
0061     class Private;
0062     Private* d;
0063 };
0064 
0065 #endif // PARAGRAPHSTYLESMODEL_H