edbee - Qt Editor Library
Public Slots | Public Member Functions | Protected Member Functions | List of all members
edbee::TextEditorComponent Class Reference

This is the main texteditor-component (which is the true editor) This is the QWidget that recieves the keypresses, mouse presses etc. More...

#include <texteditorcomponent.h>

+ Inheritance diagram for edbee::TextEditorComponent:
+ Collaboration diagram for edbee::TextEditorComponent:

Public Slots

void repaintCarets ()
 This method repaints 'all' carets. More...
 
virtual void updateLineAtOffset (int offset)
 updates the given line so it will be repainted More...
 
virtual void updateAreaAroundOffset (int offset, int width=8)
 updates the character before and at the given offest More...
 
virtual void updateLine (int line, int length)
 This method invalidates the given lines. More...
 

Public Member Functions

 TextEditorComponent (TextEditorController *controller, QWidget *parent=0)
 The default texteditor compenent constructor. More...
 
virtual ~TextEditorComponent ()
 The destructor of the the component. More...
 
TextEditorCommandMapcommandMap ()
 Returns the active commandmap. More...
 
TextEditorConfigconfig () const
 Returns the active configuration. More...
 
TextDocumenttextDocument () const
 Returns the active textdocument. More...
 
TextEditorKeyMapkeyMap ()
 Returns the current keymap. More...
 
TextEditorControllercontroller ()
 Returns the active texteditor controller. More...
 
TextSelectiontextSelection ()
 Returns the texselection range. More...
 
TextEditorRenderertextEditorRenderer ()
 
void giveTextEditorRenderer (TextEditorRenderer *renderer)
 
void resetCaretTime ()
 This method resets the caret timer The caret time is used for blinking carets When resetting the timer the caret is displayed directly. More...
 
void fullUpdate ()
 A slow and full update of the control. More...
 
virtual QSize sizeHint () const
 returns the size hint. This is the total size of the editor-area More...
 

Protected Member Functions

virtual void paintEvent (QPaintEvent *paintEvent)
 paint the editor More...
 
virtual bool event (QEvent *event)
 This method is used to FORCE the interception of tab events. More...
 
virtual void keyPressEvent (QKeyEvent *event)
 handle keypresses More...
 
virtual void keyReleaseEvent (QKeyEvent *event)
 the key release event More...
 
void inputMethodEvent (QInputMethodEvent *m)
 input method event More...
 
QVariant inputMethodQuery (Qt::InputMethodQuery p) const
 currently unused ?! More...
 
virtual void mousePressEvent (QMouseEvent *event)
 A mouse press happens. More...
 
virtual void mouseDoubleClickEvent (QMouseEvent *event)
 A mouse double click happens. More...
 
virtual void mouseMoveEvent (QMouseEvent *event)
 A mouse move event. More...
 
virtual void focusInEvent (QFocusEvent *event)
 A focus in event occured. More...
 
virtual void focusOutEvent (QFocusEvent *event)
 The focus is lost, we must STOP coalescing of undo-events! More...
 
virtual void contextMenuEvent (QContextMenuEvent *event)
 The default context menu is requested Add the default menu actions. More...
 

Detailed Description

This is the main texteditor-component (which is the true editor) This is the QWidget that recieves the keypresses, mouse presses etc.

Constructor & Destructor Documentation

◆ TextEditorComponent()

edbee::TextEditorComponent::TextEditorComponent ( TextEditorController controller,
QWidget *  parent = 0 
)
explicit

The default texteditor compenent constructor.

Parameters
controllerthe active controller for this editor
parentthe parent QObject

◆ ~TextEditorComponent()

edbee::TextEditorComponent::~TextEditorComponent ( )
virtual

The destructor of the the component.

Member Function Documentation

◆ commandMap()

TextEditorCommandMap * edbee::TextEditorComponent::commandMap ( )

Returns the active commandmap.

◆ config()

TextEditorConfig * edbee::TextEditorComponent::config ( ) const

Returns the active configuration.

◆ contextMenuEvent()

void edbee::TextEditorComponent::contextMenuEvent ( QContextMenuEvent *  event)
protectedvirtual

The default context menu is requested Add the default menu actions.

◆ controller()

TextEditorController * edbee::TextEditorComponent::controller ( )

Returns the active texteditor controller.

◆ event()

bool edbee::TextEditorComponent::event ( QEvent *  event)
protectedvirtual

This method is used to FORCE the interception of tab events.

Parameters
eventthe event filter

◆ focusInEvent()

void edbee::TextEditorComponent::focusInEvent ( QFocusEvent *  event)
protectedvirtual

A focus in event occured.

◆ focusOutEvent()

void edbee::TextEditorComponent::focusOutEvent ( QFocusEvent *  event)
protectedvirtual

The focus is lost, we must STOP coalescing of undo-events!

◆ fullUpdate()

void edbee::TextEditorComponent::fullUpdate ( )

A slow and full update of the control.

◆ giveTextEditorRenderer()

void edbee::TextEditorComponent::giveTextEditorRenderer ( TextEditorRenderer renderer)

◆ inputMethodEvent()

void edbee::TextEditorComponent::inputMethodEvent ( QInputMethodEvent *  m)
protected

input method event

◆ inputMethodQuery()

QVariant edbee::TextEditorComponent::inputMethodQuery ( Qt::InputMethodQuery  p) const
protected

currently unused ?!

◆ keyMap()

TextEditorKeyMap * edbee::TextEditorComponent::keyMap ( )

Returns the current keymap.

◆ keyPressEvent()

void edbee::TextEditorComponent::keyPressEvent ( QKeyEvent *  event)
protectedvirtual

handle keypresses

◆ keyReleaseEvent()

void edbee::TextEditorComponent::keyReleaseEvent ( QKeyEvent *  event)
protectedvirtual

the key release event

◆ mouseDoubleClickEvent()

void edbee::TextEditorComponent::mouseDoubleClickEvent ( QMouseEvent *  event)
protectedvirtual

A mouse double click happens.

Parameters
eventthe mouse double click that occured

◆ mouseMoveEvent()

void edbee::TextEditorComponent::mouseMoveEvent ( QMouseEvent *  event)
protectedvirtual

A mouse move event.

Parameters
eventthe mouse event

◆ mousePressEvent()

void edbee::TextEditorComponent::mousePressEvent ( QMouseEvent *  event)
protectedvirtual

A mouse press happens.

The normal operation is to move the caret to the character under the given mouse position. When shift is pressed, the selection is extended to the given position

If the controller modifier is used a new caret is added to character at the given position

Parameters
eventthe mouse event

◆ paintEvent()

void edbee::TextEditorComponent::paintEvent ( QPaintEvent *  paintEvent)
protectedvirtual

paint the editor

Parameters
paintEventthe paint event that occured

◆ repaintCarets

void edbee::TextEditorComponent::repaintCarets ( )
slot

This method repaints 'all' carets.

Todo:
: Optimize so only blinks visible carets

◆ resetCaretTime()

void edbee::TextEditorComponent::resetCaretTime ( )

This method resets the caret timer The caret time is used for blinking carets When resetting the timer the caret is displayed directly.

◆ sizeHint()

QSize edbee::TextEditorComponent::sizeHint ( ) const
virtual

returns the size hint. This is the total size of the editor-area

◆ textDocument()

TextDocument * edbee::TextEditorComponent::textDocument ( ) const

Returns the active textdocument.

◆ textEditorRenderer()

TextEditorRenderer* edbee::TextEditorComponent::textEditorRenderer ( )
inline

◆ textSelection()

TextSelection * edbee::TextEditorComponent::textSelection ( )

Returns the texselection range.

◆ updateAreaAroundOffset

void edbee::TextEditorComponent::updateAreaAroundOffset ( int  offset,
int  width = 8 
)
virtualslot

updates the character before and at the given offest

◆ updateLine

void edbee::TextEditorComponent::updateLine ( int  line,
int  length 
)
virtualslot

This method invalidates the given lines.

Parameters
linethe first line to update
lengththe number of lines to update

◆ updateLineAtOffset

void edbee::TextEditorComponent::updateLineAtOffset ( int  offset)
virtualslot

updates the given line so it will be repainted


The documentation for this class was generated from the following files: