1 //
2 // Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004-2008
3 //
4 // Copyright: See COPYING file that comes with this distribution
5 //
6 
7 #ifndef HIGHLIGHTEVENT_H_
8 #define HIGHLIGHTEVENT_H_
9 
10 namespace srchilite {
11 
12 struct HighlightToken;
13 
14 /**
15  * Event concerning an highlighting operation (e.g., formatting, entering
16  * a new state, exiting a state, etc.)
17  */
18 struct HighlightEvent {
19     /// the type of the event
20     enum HighlightEventType {
21         FORMAT = 0, ///< a standard formatting event
22         FORMATDEFAULT, ///< formatting something as normal
23         ENTERSTATE, ///< entering a new formatting state
24         EXITSTATE ///< exiting a formatting state
25     };
26 
27     /// the token corresponding to the event
28     const HighlightToken &token;
29 
30     /// the type of event
31     HighlightEventType type;
32 
33     HighlightEvent(const HighlightToken &_token, HighlightEventType _type = FORMAT) :
tokenHighlightEvent34         token(_token), type(_type) {
35     }
~HighlightEventHighlightEvent36     ~HighlightEvent() {
37     }
38 };
39 
40 }
41 
42 #endif /*HIGHLIGHTEVENT_H_*/
43