KTextEditor

katetextanimation.h
1 /*
2  SPDX-FileCopyrightText: 2013-2018 Dominik Haumann <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef KATE_TEXT_ANIMATION_H
8 #define KATE_TEXT_ANIMATION_H
9 
10 #include <QObject>
11 #include <QRectF>
12 #include <QString>
13 
14 #include <ktexteditor/attribute.h>
15 #include <ktexteditor/cursor.h>
16 #include <ktexteditor/range.h>
17 
18 namespace KTextEditor
19 {
20 class DocumentPrivate;
21 }
22 class KateViewInternal;
23 class QTimeLine;
24 class QPainter;
25 
31 class KateTextAnimation : public QObject
32 {
33  Q_OBJECT
34 public:
35  KateTextAnimation(const KTextEditor::Range &range, KTextEditor::Attribute::Ptr attribute, KateViewInternal *view);
36  virtual ~KateTextAnimation();
37 
38  // draw the text to highlight, given the current animation progress
39  void draw(QPainter &painter);
40 
41 public Q_SLOTS:
42  // request repaint from view of the respective region
43  void nextFrame(qreal value);
44 
45 private:
46  // calculate rect for the text to highlight, given the current animation progress
47  QRectF rectForText();
48 
49 private:
50  KTextEditor::Range m_range;
51  QString m_text;
52  KTextEditor::Attribute::Ptr m_attribute;
53 
54  KTextEditor::DocumentPrivate *m_doc;
55  KateViewInternal *m_view;
56  QTimeLine *m_timeLine;
57  qreal m_value;
58 };
59 
60 #endif // KATE_TEXT_ANIMATION_H
This class is used to flash text in the text view.
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
An object representing a section of text, from one Cursor to another.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 12 2020 22:57:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.