fe::EditorFacadePolicy Class Reference
[Ferry Core library]

Editor configuration. More...

List of all members.

Public Attributes

bool cursorKeepVisible
unsigned decoratedTextLinesCacheSize
unsigned eolClipboardCopy
unsigned eolClipboardPaste
unsigned eolSplitLine
unsigned marginBottom
unsigned marginLeft
unsigned marginRight
unsigned marginTop
bool selectedTextAccurateHighlight
ColorRGB selectedTextBgColor
bool selectedTextInvert
bool tabIsCtrl
bool tabIsSoft
unsigned tabSize
ColorRGB textBgColor
unsigned textLayoutQuality
unsigned textLineMaxWidth
bool textOvertype
bool textReadonly
unsigned vScrollInBytesTextLineCount


Detailed Description

Editor configuration.

Controls editor behavior in a declarative way.

See also:
fe::IEditorFacade::setPolicy()

fe::IEditorFacade::getPolicy()

Fe_GetDefaultPolicy()


Member Data Documentation

Controls if overtype or insert editing mode is active.

Controls if interactive text modification is forbidden.

Tab size in space (' ') chars.

See also:
tabIsSoft

tabIsCtrl

Controls if tab char is automatically replaced with space (' ') chars.

If tabIsSoft is true every keyboard typed tab char is automatically replaced with the sequence of space chars.

The maximum size of a sequence is limited to tabSize value.

See also:
tabSize

tabIsCtrl

Controls if tab chars are interpreted as indentation control chars.

If tabIsCtrl is false tab char is not interpreted as an indentation char.
tabIsCtrl = true
policy.tabIsCtrl=true.png
tabIsCtrl = false
policy.tabIsCtrl=false.png

See also:
tabSize

tabIsSoft

Controls how editor should filter line terminators in text pasted from a clipboard with fe::IEditorFacade::pasteFromClipboard() method. The table below shows how editor should tokenize

A\nBB\rCCC\r\nDDDD
input string depending of the value of this field:
eolKeep A\n
BB\r
CCC\r\n
DDDD
eolVoid A
BB
CCC
DDDD
eolLF
A\n
BB\n
CCC\n
DDDD
eolCR A\r
BB\r
CCC\r
DDDD
eolCRLF A\r\n
BB\r\n
CCC\r\n
DDDD
eolNEL, eolFF, eolLS, eolPS Like eolLF and eolCR just different replacement character is used
Other value Unsupported, fe::IEditorFacade::setPolicy() should fail
See also:
eolClipboardCopy

eolSplitLine

fe::EndOfLine

Controls how editor should filter line terminators in text copied to a clipboard with fe::IEditorFacade::copyToClipboard() method. The table below shows how editor should handle

A\n
BB\r
CCC
DDDD\r\n
EEEEE
internal text data depending of the value of this field:
eolKeep A\nBB\rCCCDDDD\r\nEEEEE
eolVoid ABBCCCDDDDEEEEE
eolLF
A\nBB\nCCC\nDDDD\nEEEEE
eolCR A\rBB\rCCC\rDDDD\rEEEEE
eolCRLF A\r\nBB\r\nCCC\r\nDDDD\r\nEEEEE
eolNEL, eolFF, eolLS, eolPS Like eolLF and eolCR just different replacement character is used
Other value Unsupported, fe::IEditorFacade::setPolicy() should fail
See also:
eolClipboardPaste

eolSplitLine

fe::EndOfLine

Controls what line terminator editor should insert when text line is split with fe::IEditorFacade::splitLine() method. Should be one of constants from fe::EndOfLine enumeration except of eolKeep.

See also:
eolClipboardPaste

eolClipboardCopy

Controls how editor layouts and renders text.

If textLayoutQuality is tlqHigh, font substitution, bidirectional text reordering, glyph composition and other features for proper handling of complex Unicode text are all enabled.

This quality level allows to properly handle text in Thai, Arabic, Hebrew and other languages with complex scripting.

If textLayoutQuality is tlqDefault, some Unicode text may be laid out and rendered incorrectly. This is particularly likely for Unicode code points that are not in the [0, 256) range, i.e. for code points that don't match ISO 8859-1 encoded characters.

The only benefit of this quality level is that text layout and rendering is relatively fast. If textLayoutQuality is tlqAuto, editor decides on its own how to handle particular text line depending on its contents.

The following table shows how the Déja vu Unicode string is handled depending on the value of textLayoutQuality:
textLayoutQuality = tlqHigh
policy.textLayoutQuality=tlqHigh.png
textLayoutQuality = tlqDefault
policy.textLayoutQuality=tlqDefault.png

See also:
fe::TextLayoutQuality

Controls selected text visual representation.

If selectedTextBgColor is equal to fe::InvalidColor the value of selectedTextInvert is ignored and selected text is always inverted.
selectedTextInvert = true;
textBgColor = 0x00FF00;
selectedTextBgColor = 0xFF0000
policy.textBgColor=0x00FF00+selectedTextInvert=true+selectedTextBgColor=0xFF0000.png
selectedTextInvert = false;
textBgColor = 0x00FF00;
selectedTextBgColor = 0xFF0000
policy.textBgColor=0x00FF00+selectedTextInvert=false+selectedTextBgColor=0xFF0000.png

See also:
selectedTextBgColor

selectedTextAccurateHighlight

Selected text background color.

See also:
selectedTextInvert

selectedTextAccurateHighlight

Editor's text area background color.
textBgColor = 0xFFFFFF
policy.textLineMaxWidth=-1.png
textBgColor = 0x00A000
policy.textBgColor=0x00A000.png

Controls selected text visual representation.
selectedTextAccurateHighlight = true
policy.selectedTextAccurateHighlight=true.png
selectedTextAccurateHighlight = false
policy.selectedTextAccurateHighlight=false.png

See also:
selectedTextInvert

selectedTextBgColor

Controls if sceen is automatically scrolled to show the text cursor (aka caret) when it is moved to another position.

Controls if text is automatically wrapped. Measured in pixels.

If textLineMaxWidth is (unsigned)-1, text is not wrapped.

If textLineMaxWidth is 0, text is wrapped to fit editor's text area width.
textLineMaxWidth = 0
policy.textLineMaxWidth=0.png
textLineMaxWidth = 50
policy.textLineMaxWidth=50.png
textLineMaxWidth = -1
policy.textLineMaxWidth=-1.png

Controls for how many text lines editor can store decoration information.

If decoratedTextLinesCacheSize is 0, then editor determins the value on its own.

Controls which algorithm for vertical scroll position calculation editor should use.

Editor supports two algorithms for vertical scroll position calculation. When automatic text wrap is disabled, both of them have equal time complexity of O(1), i.e. time complexity doesn't depend on amount of text loaded in editor.

Enabling of automatic text wrap doesn't hurt the first algorithm's performance. But this algorithm has one major disadvantage that limits its application: even a single character insert/delete action that doesn't change number of text lines results in resize of vertical scrollbar's thumb. This visual artifact can be very annoying. Fortunately the issue shows up only when scroll range is relatively small, i.e. when height of vertical scrollbar's thumb is not equal to its minimal value. So this algorithm works best when an editor maintains large text data.

Enabling of automatic text wrap hurts the second algorithm's performance. The reason is that this algorithm recalculates text line segments for all text lines on every text change action, i.e. its time complexity becomes to be O(n), where n is the text data size. Fortunately this algorithm doesn't suffer from undesired vertical scrollbar's thumb resizing. So it best suits when an editor maintains a reasonably small text data.

As it is explained above when automatic text wrap is enabled the criteria to choose algorithm for vertical scroll position calculation is the text data size that an editor maintains at the moment.

So this parameter specifies the number of text lines that editor uses as a threshold to automatically switch between two algorithms for vertical scroll position calculation. When number of text lines exceeds the value of this parameter and if automatic text wrap is enabled the editor switches to use the first algorithm, otherwise it uses the second one. Similarly, when number of text lines becomes less then the threshold editor switches back to use the second algorithm.

Note:
textLineMaxWidth controls automatic text wrap

Left text area margin. Measured in pixels.
marginLeft = 28;
policy.margins.png

Top text area margin. Measured in pixels.
marginTop = 14;
policy.margins.png

Right text area margin. Measured in pixels.
marginRight = 20;
policy.margins.png

Bottom text area margin. Measured in pixels.
marginBottom = 12;
policy.margins.png


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

Generated on Tue Nov 18 21:08:23 2008 for Ferry by doxygen 1.5.7.1
http://sourceforge.net