Scintilla 4.0.3
[TortoiseGit.git] / ext / scintilla / src / Decoration.h
blobef1f330994b4720050ccf1c4cc1a4cf91b5e0313
1 /** @file Decoration.h
2 ** Visual elements added over text.
3 **/
4 // Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
5 // The License.txt file describes the conditions under which this software may be distributed.
7 #ifndef DECORATION_H
8 #define DECORATION_H
10 namespace Scintilla {
12 class Decoration {
13 int indicator;
14 public:
15 RunStyles<int, int> rs;
17 explicit Decoration(int indicator_);
18 ~Decoration();
20 bool Empty() const;
21 int Indicator() const {
22 return indicator;
26 class DecorationList {
27 int currentIndicator;
28 int currentValue;
29 Decoration *current; // Cached so FillRange doesn't have to search for each call.
30 int lengthDocument;
31 // Ordered by indicator
32 std::vector<std::unique_ptr<Decoration>> decorationList;
33 std::vector<const Decoration*> decorationView; // Read-only view of decorationList
34 bool clickNotified;
36 Decoration *DecorationFromIndicator(int indicator);
37 Decoration *Create(int indicator, int length);
38 void Delete(int indicator);
39 void DeleteAnyEmpty();
40 void SetView();
41 public:
43 DecorationList();
44 ~DecorationList();
46 const std::vector<const Decoration*> &View() const { return decorationView; }
48 void SetCurrentIndicator(int indicator);
49 int GetCurrentIndicator() const { return currentIndicator; }
51 void SetCurrentValue(int value);
52 int GetCurrentValue() const { return currentValue; }
54 // Returns true if some values may have changed
55 bool FillRange(int &position, int value, int &fillLength);
57 void InsertSpace(int position, int insertLength);
58 void DeleteRange(int position, int deleteLength);
60 void DeleteLexerDecorations();
62 int AllOnFor(int position) const;
63 int ValueAt(int indicator, int position);
64 int Start(int indicator, int position);
65 int End(int indicator, int position);
67 bool ClickNotified() const {
68 return clickNotified;
70 void SetClickNotified(bool notified) {
71 clickNotified = notified;
77 #endif