2 * Copyright 2013, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef TERMVIEW_HIGHLIGHT_H
6 #define TERMVIEW_HIGHLIGHT_H
9 #include <GraphicsDefs.h>
14 class TermViewHighlighter
{
16 virtual ~TermViewHighlighter();
18 virtual rgb_color
ForegroundColor() = 0;
19 virtual rgb_color
BackgroundColor() = 0;
20 virtual uint32
AdjustTextAttributes(uint32 attributes
);
24 class TermViewHighlight
{
34 TermViewHighlighter
* Highlighter() const
39 void SetHighlighter(TermViewHighlighter
* highligher
)
41 fHighlighter
= highligher
;
44 const TermPos
& Start() const
49 const TermPos
& End() const
56 return fStart
== fEnd
;
59 bool RangeContains(const TermPos
& pos
) const
61 return pos
>= fStart
&& pos
< fEnd
;
64 void SetRange(const TermPos
& start
, const TermPos
& end
)
70 void ScrollRange(int32 byLines
)
77 TermViewHighlighter
* fHighlighter
;
83 #endif // TERMVIEW_HIGHLIGHT_H