KTextEditor

movingrangefeedback.h
1 /*
2  SPDX-FileCopyrightText: 2010 Christoph Cullmann <[email protected]>
3 
4  Based on code of the SmartCursor/Range by:
5  SPDX-FileCopyrightText: 2003-2005 Hamish Rodda <[email protected]>
6 
7  SPDX-License-Identifier: LGPL-2.0-or-later
8 */
9 
10 #ifndef KTEXTEDITOR_MOVINGRANGEFEEDBACK_H
11 #define KTEXTEDITOR_MOVINGRANGEFEEDBACK_H
12 
13 #include <ktexteditor_export.h>
14 
15 namespace KTextEditor
16 {
17 class View;
18 class MovingRange;
19 
20 /**
21  * \class MovingRangeFeedback movingrangefeedback.h <KTextEditor/MovingRangeFeedback>
22  *
23  * \short A class which provides notifications of state changes to a MovingRange.
24  *
25  * \ingroup kte_group_moving_classes
26  *
27  * This class provides notifications of changes to the position or contents of a MovingRange.
28  *
29  * Before destruction, you must unregister the feedback class from any range using it.
30  *
31  * \author Christoph Cullmann <[email protected]>
32  *
33  * \since 4.5
34  */
35 class KTEXTEDITOR_EXPORT MovingRangeFeedback
36 {
37 public:
38  /**
39  * Default constructor
40  */
42 
43  /**
44  * Virtual destructor
45  */
46  virtual ~MovingRangeFeedback();
47 
48  /**
49  * The range is now empty (ie. the start and end cursors are the same).
50  * If the range has invalidateIfEmpty set, this will never be emitted, but instead rangeInvalid is triggered.
51  * You may delete the range inside this method, but don't alter the range here (for example by using setRange).
52  *
53  * \param range pointer to the range which generated the notification.
54  */
55  virtual void rangeEmpty(MovingRange *range);
56 
57  /**
58  * The range is now invalid (ie. the start and end cursors are invalid).
59  * You may delete the range inside this method, but don't alter the range here (for example by using setRange).
60  *
61  * \param range pointer to the range which generated the notification.
62  */
63  virtual void rangeInvalid(MovingRange *range);
64 
65  /**
66  * The mouse cursor on \a view entered \p range.
67  *
68  * \param range pointer to the range which generated the notification.
69  * \param view view over which the mouse moved to generate the notification
70  */
71  virtual void mouseEnteredRange(MovingRange *range, View *view);
72 
73  /**
74  * The mouse cursor on \a view exited \p range.
75  *
76  * \param range pointer to the range which generated the notification.
77  * \param view view over which the mouse moved to generate the notification
78  */
79  virtual void mouseExitedRange(MovingRange *range, View *view);
80 
81  /**
82  * The caret on \a view entered \p range.
83  *
84  * \param range pointer to the range which generated the notification.
85  * \param view view over which the mouse moved to generate the notification
86  */
87  virtual void caretEnteredRange(MovingRange *range, View *view);
88 
89  /**
90  * The caret on \a view exited \p range.
91  *
92  * \param range pointer to the range which generated the notification.
93  * \param view view over which the mouse moved to generate the notification
94  */
95  virtual void caretExitedRange(MovingRange *range, View *view);
96 
97 private:
98  /**
99  * private d-pointer
100  */
101  class MovingRangeFeedbackPrivate *const d = nullptr;
102 };
103 
104 }
105 
106 #endif
virtual void mouseEnteredRange(MovingRange *range, View *view)
The mouse cursor on view entered range.
void rangeEmpty(KTextEditor::MovingRange *movingRange) override
The range is now empty (ie.
void rangeInvalid(KTextEditor::MovingRange *movingRange) override
The range is now invalid (ie.
virtual void mouseExitedRange(MovingRange *range, View *view)
The mouse cursor on view exited range.
MovingRangeFeedback()
Default constructor.
A text widget with KXMLGUIClient that represents a Document.
Definition: view.h:146
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
Definition: katetextblock.h:22
A class which provides notifications of state changes to a MovingRange.
A range that is bound to a specific Document, and maintains its position.
Definition: movingrange.h:144
virtual ~MovingRangeFeedback()
Virtual destructor.
virtual void caretExitedRange(MovingRange *range, View *view)
The caret on view exited range.
virtual void caretEnteredRange(MovingRange *range, View *view)
The caret on view entered range.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 03:56:06 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.