edbee - Qt Editor Library
|
General configuration settings of the text editor. More...
#include <texteditorconfig.h>
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... | |
General configuration settings of the text editor.
an enumeration with the possible types of whitespace showing
Enumerator | |
---|---|
HideWhitespaces | Don't show whitespaces. |
ShowWhitespaces | Alsways show the whitespace.
|
edbee::TextEditorConfig::TextEditorConfig | ( | QObject * | parent = 0 | ) |
The default constructor Fills this configuration object with some sane defaults.
parent | the parent references of this Qobject |
|
virtual |
empty constructor :)
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
int edbee::TextEditorConfig::caretBlinkingRate | ( | ) | const |
Returns the caret blinking rate (delay) (lower means faster ) The blinking delay is in milliseconds.
int edbee::TextEditorConfig::caretWidth | ( | ) | const |
Returns the caret width in pixels.
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.
|
signal |
void edbee::TextEditorConfig::endChanges | ( | ) |
Ends the previous call of beginChanges. It will notify a change when all items have been changes.
int edbee::TextEditorConfig::extraLineSpacing | ( | ) | const |
Returns the extra line spacing in pixels.
QFont edbee::TextEditorConfig::font | ( | ) | const |
returns the current font to use
int edbee::TextEditorConfig::indentSize | ( | ) | const |
Returns the indent size in the number of characters.
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.
|
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.
bool edbee::TextEditorConfig::scrollPastEnd | ( | ) | const |
returns the scroll past end setting
void edbee::TextEditorConfig::setCaretBlinkRate | ( | int | rate | ) |
Sets the caret blinking rate (delay) (lower means faster )
rate | The blinking delay is in milliseconds |
void edbee::TextEditorConfig::setCaretWidth | ( | int | width | ) |
Sets the caret render width in pixels.
width | the caret width in pixels |
void edbee::TextEditorConfig::setCharGroups | ( | const QStringList & | items | ) |
Sets the character groups.
void edbee::TextEditorConfig::setExtraLineSpacing | ( | int | value | ) |
Sets the extra line spacing between lines in pixels.
value | the number of extra line-spacing between editor lines |
void edbee::TextEditorConfig::setFont | ( | const QFont & | font | ) |
Changes the font that's used by the editor.
void edbee::TextEditorConfig::setIndentSize | ( | int | size | ) |
Sets the indentsize in characters.
size | the size of indentation in nr of characters |
void edbee::TextEditorConfig::setLineSeperatorPen | ( | const QPen & | pen | ) |
This method sets the line seperator pen that used to paint line between the text-lines.
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.
enabled | should scroll past end be enabled ? |
void edbee::TextEditorConfig::setShowCaretOffset | ( | bool | enable | ) |
Enables / disables the passing of the character offset.
void edbee::TextEditorConfig::setShowWhitespaceMode | ( | int | mode | ) |
Sets the show the whitespace mode.
mode | the whitespace mode to set. Can be one of the enumeration values. (Or another integer if you build your own renderer) |
void edbee::TextEditorConfig::setShowWhitespaceMode | ( | const QString & | str | ) |
Sets the show whitespace mode.
str | the whitespace mode "show" or "hide" for now. (When invalid hide is used) |
void edbee::TextEditorConfig::setSmartTab | ( | bool | enable | ) |
Sets the smarttab mode.
enable | should smarttab be enabled |
void edbee::TextEditorConfig::setThemeName | ( | const QString & | name | ) |
This method sets the active theme name.
name | the name of the active theme (this is the filename of the theme without the extension) |
void edbee::TextEditorConfig::setUndoGroupPerSpace | ( | bool | enable | ) |
Sets the undo group per space value.
void edbee::TextEditorConfig::setUseLineSeparator | ( | bool | value | ) |
Should we use a sline seperator?
void edbee::TextEditorConfig::setUseTabChar | ( | bool | enable | ) |
Should the tab-character be used?
enable | enable or disable the use of tab characters |
void edbee::TextEditorConfig::setWhitespaces | ( | const QString & | value | ) |
Sets the whitespace characters.
void edbee::TextEditorConfig::setWhitespaceWithoutNewline | ( | const QString & | value | ) |
Sets the characters that are considered whitespace. Excluding the newline character.
value | the list of characters that are considered whitespace characters |
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
int edbee::TextEditorConfig::showWhitespaceMode | ( | ) | const |
Shows the whitespacemode.
bool edbee::TextEditorConfig::smartTab | ( | ) | const |
Returns the state of smarttab mode Smarttab enables the automatic addition of indents.
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)
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)
bool edbee::TextEditorConfig::useLineSeparator | ( | ) | const |
Should we use a line seperator pen.
bool edbee::TextEditorConfig::useTabChar | ( | ) | const |
Should the tab-character be used?
const QString & edbee::TextEditorConfig::whitespaces | ( | ) | const |
Returns all white-space characters.
const QString & edbee::TextEditorConfig::whitespaceWithoutNewline | ( | ) | const |
Retuns the whitespace character without newlines.