edbee - Qt Editor Library
Public Types | Signals | Public Member Functions | Protected Member Functions | List of all members
edbee::TextEditorConfig Class Reference

General configuration settings of the text editor. More...

#include <texteditorconfig.h>

+ Inheritance diagram for edbee::TextEditorConfig:
+ Collaboration diagram for edbee::TextEditorConfig:

Public Types

enum  ShowWhitespaceMode { HideWhitespaces = 0, ShowWhitespaces = 1 }
 an enumeration with the possible types of whitespace showing More...
 

Signals

void configChanged ()
 

Public Member Functions

 TextEditorConfig (QObject *parent=0)
 The default constructor Fills this configuration object with some sane defaults. More...
 
virtual ~TextEditorConfig ()
 empty constructor :) More...
 
void beginChanges ()
 use this method to start a group of changes. Default behaviour is to emit a configChanged signal if a setting is changed When you call beginChanges this method will make sure the config surpresses the signals and only a signal is fired after the last endChange. You can nest multiple beginChanges, only the last endChanges fires a signal More...
 
void endChanges ()
 Ends the previous call of beginChanges. It will notify a change when all items have been changes. More...
 
int caretWidth () const
 Returns the caret width in pixels. More...
 
void setCaretWidth (int width)
 Sets the caret render width in pixels. More...
 
int caretBlinkingRate () const
 Returns the caret blinking rate (delay) (lower means faster ) The blinking delay is in milliseconds. More...
 
void setCaretBlinkRate (int rate)
 Sets the caret blinking rate (delay) (lower means faster ) More...
 
int indentSize () const
 Returns the indent size in the number of characters. More...
 
void setIndentSize (int size)
 Sets the indentsize in characters. More...
 
bool useTabChar () const
 Should the tab-character be used? More...
 
void setUseTabChar (bool enable)
 Should the tab-character be used? More...
 
bool smartTab () const
 Returns the state of smarttab mode Smarttab enables the automatic addition of indents. More...
 
void setSmartTab (bool enable)
 Sets the smarttab mode. More...
 
const QStringList & charGroups () const
 Returns the characters groups Character groups are groups that considered the 'same' kind of characters. For example skipping to the next word skips the characters of the same group Currently spaces and word/id characters are hardcoded groups. More...
 
void setCharGroups (const QStringList &items)
 Sets the character groups. More...
 
const QString & whitespaces () const
 Returns all white-space characters. More...
 
void setWhitespaces (const QString &value)
 Sets the whitespace characters. More...
 
const QString & whitespaceWithoutNewline () const
 Retuns the whitespace character without newlines. More...
 
void setWhitespaceWithoutNewline (const QString &)
 Sets the characters that are considered whitespace. Excluding the newline character. More...
 
int extraLineSpacing () const
 Returns the extra line spacing in pixels. More...
 
void setExtraLineSpacing (int value)
 Sets the extra line spacing between lines in pixels. More...
 
bool useLineSeparator () const
 Should we use a line seperator pen. More...
 
void setUseLineSeparator (bool value)
 Should we use a sline seperator? More...
 
const QPen & lineSeparatorPen () const
 The line sperator pen to use.When the setting useLineSeparator is set this pen is used to draw lines between the text-lines. More...
 
void setLineSeperatorPen (const QPen &pen)
 This method sets the line seperator pen that used to paint line between the text-lines. More...
 
bool undoGroupPerSpace () const
 Should a space result in a new 'undo-group' The default behaviour is that pressing a space character results in the closing of an undo group. (This groups the entered characters into 1 undo operation) More...
 
void setUndoGroupPerSpace (bool enable)
 Sets the undo group per space value. More...
 
bool showCaretOffset () const
 should the caret-offset been shown. The texteditor can signal a statusbar text to a slot. This text can optionally contain the current caret offset More...
 
void setShowCaretOffset (bool enable)
 Enables / disables the passing of the character offset. More...
 
QString themeName ()
 returns the active theme name (The theme name is the name without the file-extension of the file in the theme directory) More...
 
void setThemeName (const QString &name)
 This method sets the active theme name. More...
 
QFont font () const
 returns the current font to use More...
 
void setFont (const QFont &font)
 Changes the font that's used by the editor. More...
 
bool scrollPastEnd () const
 returns the scroll past end setting More...
 
void setScrollPastEnd (bool enabled)
 Sets the scroll past end option. When enabled the last line of the document is scrollable to the top of the window. More...
 
int showWhitespaceMode () const
 Shows the whitespacemode. More...
 
void setShowWhitespaceMode (int mode)
 Sets the show the whitespace mode. More...
 
void setShowWhitespaceMode (const QString &str)
 Sets the show whitespace mode. More...
 

Protected Member Functions

void notifyChange ()
 This internal method is used to notify the listener that a change has happend Thi smethod only emits a signal if there's no config group change busy. More...
 

Detailed Description

General configuration settings of the text editor.

Member Enumeration Documentation

◆ ShowWhitespaceMode

an enumeration with the possible types of whitespace showing

Enumerator
HideWhitespaces 

Don't show whitespaces.

ShowWhitespaces 

Alsways show the whitespace.

Todo:
: In the future, only show when selected

Constructor & Destructor Documentation

◆ TextEditorConfig()

edbee::TextEditorConfig::TextEditorConfig ( QObject *  parent = 0)

The default constructor Fills this configuration object with some sane defaults.

Parameters
parentthe parent references of this Qobject

◆ ~TextEditorConfig()

edbee::TextEditorConfig::~TextEditorConfig ( )
virtual

empty constructor :)

Member Function Documentation

◆ beginChanges()

void edbee::TextEditorConfig::beginChanges ( )

use this method to start a group of changes. Default behaviour is to emit a configChanged signal if a setting is changed When you call beginChanges this method will make sure the config surpresses the signals and only a signal is fired after the last endChange. You can nest multiple beginChanges, only the last endChanges fires a signal

◆ caretBlinkingRate()

int edbee::TextEditorConfig::caretBlinkingRate ( ) const

Returns the caret blinking rate (delay) (lower means faster ) The blinking delay is in milliseconds.

◆ caretWidth()

int edbee::TextEditorConfig::caretWidth ( ) const

Returns the caret width in pixels.

◆ charGroups()

const QStringList & edbee::TextEditorConfig::charGroups ( ) const

Returns the characters groups Character groups are groups that considered the 'same' kind of characters. For example skipping to the next word skips the characters of the same group Currently spaces and word/id characters are hardcoded groups.

◆ configChanged

void edbee::TextEditorConfig::configChanged ( )
signal

◆ endChanges()

void edbee::TextEditorConfig::endChanges ( )

Ends the previous call of beginChanges. It will notify a change when all items have been changes.

◆ extraLineSpacing()

int edbee::TextEditorConfig::extraLineSpacing ( ) const

Returns the extra line spacing in pixels.

◆ font()

QFont edbee::TextEditorConfig::font ( ) const

returns the current font to use

◆ indentSize()

int edbee::TextEditorConfig::indentSize ( ) const

Returns the indent size in the number of characters.

◆ lineSeparatorPen()

const QPen & edbee::TextEditorConfig::lineSeparatorPen ( ) const

The line sperator pen to use.When the setting useLineSeparator is set this pen is used to draw lines between the text-lines.

See also
TextEditorConfig::useLineSeparator

◆ notifyChange()

void edbee::TextEditorConfig::notifyChange ( )
protected

This internal method is used to notify the listener that a change has happend Thi smethod only emits a signal if there's no config group change busy.

◆ scrollPastEnd()

bool edbee::TextEditorConfig::scrollPastEnd ( ) const

returns the scroll past end setting

Returns

◆ setCaretBlinkRate()

void edbee::TextEditorConfig::setCaretBlinkRate ( int  rate)

Sets the caret blinking rate (delay) (lower means faster )

Parameters
rateThe blinking delay is in milliseconds

◆ setCaretWidth()

void edbee::TextEditorConfig::setCaretWidth ( int  width)

Sets the caret render width in pixels.

Parameters
widththe caret width in pixels

◆ setCharGroups()

void edbee::TextEditorConfig::setCharGroups ( const QStringList &  items)

Sets the character groups.

See also
TextEditorConfig::charGroups

◆ setExtraLineSpacing()

void edbee::TextEditorConfig::setExtraLineSpacing ( int  value)

Sets the extra line spacing between lines in pixels.

Parameters
valuethe number of extra line-spacing between editor lines

◆ setFont()

void edbee::TextEditorConfig::setFont ( const QFont &  font)

Changes the font that's used by the editor.

◆ setIndentSize()

void edbee::TextEditorConfig::setIndentSize ( int  size)

Sets the indentsize in characters.

Parameters
sizethe size of indentation in nr of characters

◆ setLineSeperatorPen()

void edbee::TextEditorConfig::setLineSeperatorPen ( const QPen &  pen)

This method sets the line seperator pen that used to paint line between the text-lines.

See also
TextEditorConfig::useLineSeparator

◆ setScrollPastEnd()

void edbee::TextEditorConfig::setScrollPastEnd ( bool  enabled)

Sets the scroll past end option. When enabled the last line of the document is scrollable to the top of the window.

Parameters
enabledshould scroll past end be enabled ?

◆ setShowCaretOffset()

void edbee::TextEditorConfig::setShowCaretOffset ( bool  enable)

Enables / disables the passing of the character offset.

See also
TextEditorConfig::showCaretOffset

◆ setShowWhitespaceMode() [1/2]

void edbee::TextEditorConfig::setShowWhitespaceMode ( int  mode)

Sets the show the whitespace mode.

Parameters
modethe whitespace mode to set. Can be one of the enumeration values. (Or another integer if you build your own renderer)

◆ setShowWhitespaceMode() [2/2]

void edbee::TextEditorConfig::setShowWhitespaceMode ( const QString &  str)

Sets the show whitespace mode.

Parameters
strthe whitespace mode "show" or "hide" for now. (When invalid hide is used)

◆ setSmartTab()

void edbee::TextEditorConfig::setSmartTab ( bool  enable)

Sets the smarttab mode.

Parameters
enableshould smarttab be enabled

◆ setThemeName()

void edbee::TextEditorConfig::setThemeName ( const QString &  name)

This method sets the active theme name.

Parameters
namethe name of the active theme (this is the filename of the theme without the extension)

◆ setUndoGroupPerSpace()

void edbee::TextEditorConfig::setUndoGroupPerSpace ( bool  enable)

Sets the undo group per space value.

See also
TextEditorConfig::undoGroupPerSpace

◆ setUseLineSeparator()

void edbee::TextEditorConfig::setUseLineSeparator ( bool  value)

Should we use a sline seperator?

See also
TextEditorConfig::lineSeparatorPen

◆ setUseTabChar()

void edbee::TextEditorConfig::setUseTabChar ( bool  enable)

Should the tab-character be used?

Parameters
enableenable or disable the use of tab characters

◆ setWhitespaces()

void edbee::TextEditorConfig::setWhitespaces ( const QString &  value)

Sets the whitespace characters.

◆ setWhitespaceWithoutNewline()

void edbee::TextEditorConfig::setWhitespaceWithoutNewline ( const QString &  value)

Sets the characters that are considered whitespace. Excluding the newline character.

Parameters
valuethe list of characters that are considered whitespace characters

◆ showCaretOffset()

bool edbee::TextEditorConfig::showCaretOffset ( ) const

should the caret-offset been shown. The texteditor can signal a statusbar text to a slot. This text can optionally contain the current caret offset

◆ showWhitespaceMode()

int edbee::TextEditorConfig::showWhitespaceMode ( ) const

Shows the whitespacemode.

◆ smartTab()

bool edbee::TextEditorConfig::smartTab ( ) const

Returns the state of smarttab mode Smarttab enables the automatic addition of indents.

◆ themeName()

QString edbee::TextEditorConfig::themeName ( )

returns the active theme name (The theme name is the name without the file-extension of the file in the theme directory)

◆ undoGroupPerSpace()

bool edbee::TextEditorConfig::undoGroupPerSpace ( ) const

Should a space result in a new 'undo-group' The default behaviour is that pressing a space character results in the closing of an undo group. (This groups the entered characters into 1 undo operation)

◆ useLineSeparator()

bool edbee::TextEditorConfig::useLineSeparator ( ) const

Should we use a line seperator pen.

See also
TextEditorConfig::lineSeparatorPen

◆ useTabChar()

bool edbee::TextEditorConfig::useTabChar ( ) const

Should the tab-character be used?

◆ whitespaces()

const QString & edbee::TextEditorConfig::whitespaces ( ) const

Returns all white-space characters.

◆ whitespaceWithoutNewline()

const QString & edbee::TextEditorConfig::whitespaceWithoutNewline ( ) const

Retuns the whitespace character without newlines.


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