Inheritance diagram for BaseEditor:
This class implements basic functionality, which could be useful in application's editing system. This includes automatic top-level caching of hilighting state, outline structure creation, pair constructions search. This class has event-oriented structure. Each editor event is passed into this object and gets internal processing.
Public Member Functions | |
BaseEditor (ParserFactory *pf, LineSource *lineSource) | |
Initial constructor. | |
~BaseEditor () | |
void | setRegionCompact (bool compact) |
This method informs handler about internal form of requeried LineRegion lists, which is returned after the parsing process. | |
void | setRegionMapper (RegionMapper *rm) |
Installs specified RegionMapper, which maps HRC Regions into color data. | |
void | setRegionMapper (const String *hrdClass, const String *hrdName) |
Installs specified RegionMapper, which is created with ParserFactory methods and maintained internally by this handler. | |
void | setBackParse (int backParse) |
Specifies number of lines, for which parser would be able to run continual processing without highlight invalidation. | |
void | setFileType (FileType *ftype) |
Initial HRC type, used for parse processing. | |
FileType * | setFileType (const String &fileType) |
Initial HRC type, used for parse processing. | |
FileType * | chooseFileType (const String *fileName) |
Tries to choose appropriate file type from HRC database using passed fileName and first line of text (if available through lineSource). | |
FileType * | getFileType () |
Returns currently used HRC file type. | |
void | addRegionHandler (RegionHandler *rh) |
Adds specified RegionHandler object into parse process. | |
void | removeRegionHandler (RegionHandler *rh) |
Removes previously added RegionHandler object. | |
void | addEditorListener (EditorListener *el) |
Adds specified EditorListener object into parse process. | |
void | removeEditorListener (EditorListener *el) |
Removes previously added EditorListener object. | |
PairMatch * | searchLocalPair (int lineNo, int pos) |
Searches and creates pair match object in currently visible text. | |
PairMatch * | searchGlobalPair (int lineNo, int pos) |
Searches pair match in all available text, possibly, making additional processing. | |
PairMatch * | getEnwrappedPairMatch (int lineNo, int pos) |
Searches and creates pair match object of first enwrapping block. | |
void | releasePairMatch (PairMatch *pm) |
Frees previously allocated PairMatch object. | |
LineRegion * | getLineRegions (int lno) |
Return parsed and colored LineRegions of requested line. | |
void | validate (int lno, bool rebuildRegions) |
Validates current state of the editor and runs parser, if needed. | |
void | idleJob (int time) |
Tries to do some parsing job while user is doing nothing. | |
void | modifyEvent (int topLine) |
Informs BaseEditor object about text modification event. | |
void | modifyLineEvent (int line) |
Informs about single line modification event. | |
void | visibleTextEvent (int wStart, int wSize) |
Informs about changes in visible range of text lines. | |
void | lineCountEvent (int newLineCount) |
Informs about total lines count change. | |
void | startParsing (int lno) |
void | endParsing (int lno) |
void | clearLine (int lno, String *line) |
void | addRegion (int lno, String *line, int sx, int ex, const Region *region) |
void | enterScheme (int lno, String *line, int sx, int ex, const Region *region, const Scheme *scheme) |
void | leaveScheme (int lno, String *line, int sx, int ex, const Region *region, const Scheme *scheme) |
Data Fields | |
const Region * | def_Text |
Basic HRC region - default text (background color). | |
const Region * | def_Syntax |
Basic HRC region - syntax checkable region. | |
const Region * | def_Special |
Basic HRC region - special region. | |
const Region * | def_PairStart |
Basic HRC region - Paired region start. | |
const Region * | def_PairEnd |
Basic HRC region - Paired region end. | |
const RegionDefine * | rd_def_Text |
Basic HRC region mapping. | |
const RegionDefine * | rd_def_HorzCross |
const RegionDefine * | rd_def_VertCross |
Protected Attributes | |
ErrorHandler * | feh |
|
Initial constructor. Creates uninitialized base editor functionality support.
|
|
|
|
This method informs handler about internal form of requeried LineRegion lists, which is returned after the parsing process. Compact regions are guaranteed not to overlap with each other (this is achieved with more internal processing and more extensive cpu usage); non-compact regions are placed directly as they created by the TextParser and can be overlapped.
|
|
Installs specified RegionMapper, which maps HRC Regions into color data.
|
|
Installs specified RegionMapper, which is created with ParserFactory methods and maintained internally by this handler. If no one of two overloads of setRegionMapper is called, all work is started without mapping of extended region information.
|
|
Specifies number of lines, for which parser would be able to run continual processing without highlight invalidation.
|
|
Initial HRC type, used for parse processing. If changed during processing, all text information is invalidated. |
|
Initial HRC type, used for parse processing. If changed during processing, all text information is invalidated. |
|
Searches and creates pair match object in currently visible text.
|
|
Searches pair match in all available text, possibly, making additional processing.
|
|
Searches and creates pair match object of first enwrapping block. Returned object could be used as with getPairMatch method. Enwrapped block is the first meeted start of block, if moving from specified position to the left and top. Not Implemented yet.
|
|
Frees previously allocated PairMatch object.
|
|
Return parsed and colored LineRegions of requested line. This method validates current cache state and, if needed, calls Colorer parser to validate modified block of text. Size of reparsed text is choosed according to information about visible text range and modification events.
|
|
Validates current state of the editor and runs parser, if needed. This method can be called periodically in background thread to make possible background parsing process.
|
|
Tries to do some parsing job while user is doing nothing.
|
|
Informs BaseEditor object about text modification event. All the text becomes invalid after the specified line.
|
|
Informs about single line modification event. Generally, this type of event can be processed much faster because of pre-checking line's changed structure and cancelling further parsing in case of unmodified text structure.
|
|
Informs about changes in visible range of text lines. This information is used to make assumptions about text structure and to make faster parsing.
|
|
Informs about total lines count change. This must include initial lines number setting. |