KTextEditor

kateanimation.h
1/*
2 SPDX-FileCopyrightText: 2013 Dominik Haumann <dhaumann@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KATE_ANIMATION_H
8#define KATE_ANIMATION_H
9
10#include <QObject>
11#include <QPointer>
12
13class QTimer;
14
15class KMessageWidget;
16class KateFadeEffect;
17/**
18 * This class provides a fade in/out effect for KMessageWidget%s.
19 * Example:
20 * \code
21 * KateAnimation* animation = new KateAnimation(someMessageWidget);
22 * animation->show();
23 * //...
24 * animation->hide();
25 * \endcode
26 */
27class KateAnimation : public QObject
28{
30
31public:
32 /**
33 * The type of supported animation effects
34 */
36 FadeEffect = 0, ///< fade in/out
37 GrowEffect ///< grow / shrink
38 };
39
40public:
41 /**
42 * Constructor.
43 */
45
46 /**
47 * Returns true, if the hide animation is running, otherwise false.
48 */
49 bool isHideAnimationRunning() const;
50
51 /**
52 * Returns true, if the how animation is running, otherwise false.
53 */
54 bool isShowAnimationRunning() const;
55
56public Q_SLOTS:
57 /**
58 * Call to hide the widget.
59 */
60 void hide();
61
62 /**
63 * Call to show and fade in the widget
64 */
65 void show();
66
68 /**
69 * This signal is emitted when the hiding animation is finished.
70 * At this point, the associated widget is hidden.
71 */
73
74 /**
75 * This signal is emitted when the showing animation is finished.
76 * At this point, the associated widget is hidden.
77 */
79
80private:
81 QPointer<KMessageWidget> m_widget; ///< the widget to animate
82 KateFadeEffect *m_fadeEffect; ///< the fade effect
83};
84
85#endif
This class provides a fade in/out effect for KMessageWidgets.
KateAnimation(KMessageWidget *widget, EffectType effect)
Constructor.
void widgetShown()
This signal is emitted when the showing animation is finished.
bool isHideAnimationRunning() const
Returns true, if the hide animation is running, otherwise false.
void show()
Call to show and fade in the widget.
EffectType
The type of supported animation effects.
@ FadeEffect
fade in/out
@ GrowEffect
grow / shrink
void widgetHidden()
This signal is emitted when the hiding animation is finished.
bool isShowAnimationRunning() const
Returns true, if the how animation is running, otherwise false.
void hide()
Call to hide the widget.
This class provides a fade in/out effect for arbitrary QWidgets.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:11:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.