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 Methods | |
| BaseEditor (ParserFactory *pf, LineSource *lineSource) | |
| Initial constructor. | |
| void | setRegionCompact (bool compact) |
| This method informs handler about internal form of requeried LineRegion lists, which returned after parse 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. | |
| void | setFileType (const String &fileType) |
| Initial HRC type, used for parse processing. | |
| void | chooseFileType (const String *fileName) |
| Tries to choose appropriate file type from HRC database using passed fileName and first line of text (if avaiable 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. | |
| PairMatch * | getPairMatch (int lineNo, int pos) |
| Searches and creates pair match object. | |
| 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. | |
| void | searchLocalPair (PairMatch *pm) |
| Searches pair match in currently visible text. | |
| void | searchGlobalPair (PairMatch *pm) |
| Searches pair match in all avaiable text, possibly, making additional processing. | |
| LineRegion * | getLineRegions (int lno) |
| Return parsed and colored LineRegions of requested line. | |
| void | validate (int lno) |
| Validates current state of editor and runs parser, if needed. | |
| 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 |
| Basic HRC region mapping. | |
| const RegionDefine * | rd_def_VertCross |
| Basic HRC region mapping. | |
Protected Attributes | |
| ErrorHandler * | feh |
|
||||||||||||
|
Initial constructor. Creates uninitialized base editor functionality support.
|
|
|
This method informs handler about internal form of requeried LineRegion lists, which returned after parse process. Compact regions are guaranteed not to overlap with each other (this is achieved with more internal processing and more extensive cpu use); non-compact regions are placed directly as they created by 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.
|
|
|
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. Returned object could be lately used in pair search methods. This object is valid only until reparse of it's line occured. After that event information about line region's references in it becomes invalid and, if used, can produce faults.
|
|
||||||||||||
|
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.
|
|
|
Frees previously allocated PairMatch object.
|
|
|
Searches pair match in currently visible text.
|
|
|
Searches pair match in all avaiable text, possibly, making additional processing.
|
|
|
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 editor and runs parser, if needed. This method can be called periodically in background thread to make possible background parsing process.
|
|
|
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. |