Changeset View
Changeset View
Standalone View
Standalone View
src/declarativeitems/lessontexthighlighteritem.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2017 Sebastian Gottfried <sebastian.gottfried@posteo.de> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or | ||||
5 | * modify it under the terms of the GNU General Public License as | ||||
6 | * published by the Free Software Foundation; either version 2 of | ||||
7 | * the License, or (at your option) any later version. | ||||
8 | * | ||||
9 | * This program is distributed in the hope that it will be useful, | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | * GNU General Public License for more details. | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU General Public License | ||||
15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
16 | */ | ||||
17 | | ||||
18 | #ifndef LESSONTEXTHIGHLIGHTERITEM_H | ||||
19 | #define LESSONTEXTHIGHLIGHTERITEM_H | ||||
20 | | ||||
21 | #include <QQuickItem> | ||||
22 | | ||||
23 | class LessonTextHighlighter; | ||||
24 | class QQuickTextDocument; | ||||
25 | | ||||
26 | class LessonTextHighlighterItem : public QQuickItem | ||||
27 | { | ||||
28 | Q_OBJECT | ||||
29 | Q_PROPERTY(QString allowedCharacters READ allowedCharacters WRITE setAllowedCharacters NOTIFY allowedCharactersChanged) | ||||
30 | Q_PROPERTY(QQuickTextDocument* document READ document WRITE setDocument NOTIFY documentChanged) | ||||
31 | public: | ||||
32 | LessonTextHighlighterItem(); | ||||
33 | QString allowedCharacters() const; | ||||
34 | void setAllowedCharacters(const QString& characters); | ||||
35 | QQuickTextDocument* document() const; | ||||
36 | void setDocument(QQuickTextDocument* document); | ||||
37 | signals: | ||||
38 | void allowedCharactersChanged(); | ||||
39 | void documentChanged(); | ||||
40 | private: | ||||
41 | LessonTextHighlighter* m_highligher; | ||||
42 | QQuickTextDocument* m_document; | ||||
43 | }; | ||||
44 | | ||||
45 | #endif // LESSONTEXTHIGHLIGHTERITEM_H |