KTextEditor

katetextanimation.h
1/*
2 SPDX-FileCopyrightText: 2013-2018 Dominik Haumann <dhaumann@kde.org>
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/range.h>
16
17namespace KTextEditor
18{
19class DocumentPrivate;
20}
21class KateViewInternal;
22class QTimeLine;
23class QPainter;
24
25/**
26 * This class is used to flash text in the text view.
27 * The duration of the flash animation is about 250 milliseconds.
28 * When the animation is finished, it deletes itself.
29 */
30class KateTextAnimation : public QObject
31{
32public:
33 KateTextAnimation(KTextEditor::Range range, KTextEditor::Attribute::Ptr attribute, KateViewInternal *view);
34 ~KateTextAnimation() override;
35
36 // draw the text to highlight, given the current animation progress
37 void draw(QPainter &painter);
38
39public:
40 // request repaint from view of the respective region
41 void nextFrame(qreal value);
42
43private:
44 // calculate rect for the text to highlight, given the current animation progress
45 QRectF rectForText();
46
47private:
48 KTextEditor::Range m_range;
49 QString m_text;
51
53 KateViewInternal *m_view;
54 QTimeLine *m_timeLine;
55 qreal m_value;
56};
57
58#endif // KATE_TEXT_ANIMATION_H
QExplicitlySharedDataPointer< Attribute > Ptr
Shared data pointer for Attribute.
Definition attribute.h:56
Backend of KTextEditor::Document related public KTextEditor interfaces.
An object representing a section of text, from one Cursor to another.
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
QObject(QObject *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:55:24 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.