TextViewEventFilter Class Reference

#include <textview.h>

Collaboration diagram for TextViewEventFilter:

Collaboration graph
[legend]
List of all members.

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 &currentWord, int line, int col)

Protected Attributes

QTimer * m_pHoverTimer
QTimer * m_pSleepTimer
QTimer * m_pNoWordTimer
TextViewm_pTextView
QString m_lastWord
int m_lastLine
int m_lastCol
HoverStatus m_hoverStatus

Detailed Description

This class is an event filter to be installed in the kate view, and is used to do stuff like poping up menus and telling TextView that a word is being hovered over (used in the debugger).

Author:
David Saxton

Definition at line 103 of file textview.h.


Member Enumeration Documentation

enum TextViewEventFilter::HoverStatus [protected]

Enumerator:
Active  We are currently hovering - wordHoveredOver was emitted, and wordUnhovered hasn't been emitted yet.
Hidden  A word was unhovered recently. We will go straight to PoppedUp mode if a word is hovered over again.
Sleeping  A word was not unhovered recentely. There will be a short display before going to PoppedUp mode if a word is hovered over.

Definition at line 142 of file textview.h.


Member Function Documentation

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]

See also:
m_pNoWordTimer

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().


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Tue May 8 17:05:59 2007 for KTechLab by  doxygen 1.5.1