#include <textview.h>
Collaboration diagram for TextViewEventFilter:

Signals | |
| void | wordHoveredOver (const QString &word, int line, int col) |
| void | wordUnhovered () |
Public Member Functions | |
| TextViewEventFilter (TextView *textView) | |
| bool | eventFilter (QObject *watched, QEvent *e) |
Protected Types | |
| enum | HoverStatus { Active, Hidden, Sleeping } |
Protected Slots | |
| void | slotNeedTextHint (int line, int col, QString &text) |
| void | hoverTimeout () |
| void | gotoSleep () |
| void | slotNoWordTimeout () |
Protected Member Functions | |
| void | updateHovering (const QString ¤tWord, int line, int col) |
Protected Attributes | |
| QTimer * | m_pHoverTimer |
| QTimer * | m_pSleepTimer |
| QTimer * | m_pNoWordTimer |
| TextView * | m_pTextView |
| QString | m_lastWord |
| int | m_lastLine |
| int | m_lastCol |
| HoverStatus | m_hoverStatus |
Definition at line 103 of file textview.h.
enum TextViewEventFilter::HoverStatus [protected] |
Definition at line 142 of file textview.h.
| void TextViewEventFilter::wordHoveredOver | ( | const QString & | word, | |
| int | line, | |||
| int | col | |||
| ) | [signal] |
When the user hovers the mouse for more than 700 milliseconds over a word, "hover mode" is entered. When the user presses a key, clicks mouse, etc, this mode is left. During the mode, any word that is under the mouse cursor will be emitted as hoveredOver( word ).
Referenced by hoverTimeout(), and updateHovering().
| void TextViewEventFilter::wordUnhovered | ( | ) | [signal] |
Emitted when focus is lost, the mouse moves to a different word, etc.
Referenced by gotoSleep(), and updateHovering().
| void TextViewEventFilter::hoverTimeout | ( | ) | [protected, slot] |
Called when we are not in hover mode, but the user has had his mouse in the same position for some time.
Definition at line 410 of file textview.cpp.
References Active, m_hoverStatus, m_lastCol, m_lastLine, m_lastWord, m_pSleepTimer, and wordHoveredOver().
Referenced by TextViewEventFilter().
| void TextViewEventFilter::gotoSleep | ( | ) | [protected, slot] |
Called (from m_pSleepTimer) when we are in hover mode, but no word has been hovered over for some time.
Definition at line 418 of file textview.cpp.
References m_hoverStatus, m_lastWord, m_pHoverTimer, Sleeping, and wordUnhovered().
Referenced by TextViewEventFilter().
| void TextViewEventFilter::slotNoWordTimeout | ( | ) | [protected, slot] |
Definition at line 427 of file textview.cpp.
References updateHovering().
Referenced by TextViewEventFilter().
| void TextViewEventFilter::updateHovering | ( | const QString & | currentWord, | |
| int | line, | |||
| int | col | |||
| ) | [protected] |
Starts / stops timers, emits signals, etc. See other functions for an idea of what this does.
Definition at line 433 of file textview.cpp.
References Active, Hidden, m_hoverStatus, m_lastCol, m_lastLine, m_lastWord, m_pHoverTimer, m_pSleepTimer, Sleeping, wordHoveredOver(), and wordUnhovered().
Referenced by eventFilter(), slotNeedTextHint(), and slotNoWordTimeout().
QTimer* TextViewEventFilter::m_pHoverTimer [protected] |
Started when the user moves his mouse over a word, and we are in Sleeping mode. Reset when the user moves his mouse, etc.
Definition at line 170 of file textview.h.
Referenced by gotoSleep(), TextViewEventFilter(), and updateHovering().
QTimer* TextViewEventFilter::m_pSleepTimer [protected] |
Started when a word is unhovered. When this timeouts, we will go to Sleeping mode.
Definition at line 175 of file textview.h.
Referenced by hoverTimeout(), TextViewEventFilter(), and updateHovering().
QTimer* TextViewEventFilter::m_pNoWordTimer [protected] |
Activated by the user moving the mouse. Reset by a call to slotNeedTextHint. This timer is needed as KateViewInternal doesn't bother updating us if the mouse cursor isn't over text.
Definition at line 181 of file textview.h.
Referenced by eventFilter(), slotNeedTextHint(), and TextViewEventFilter().
1.5.1