aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Decoration.h
blob: 1461f2f983b1289c876bbeebc91ee31e2c87c466 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/** @file Decoration.h
 ** Visual elements added over text.
 **/
// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.

#ifndef DECORATION_H
#define DECORATION_H

namespace Scintilla {

class IDecoration {
public:
	virtual ~IDecoration() {}
	virtual bool Empty() const = 0;
	virtual int Indicator() const = 0;
	virtual Sci::Position Length() const = 0;
	virtual int ValueAt(Sci::Position position) const = 0;
	virtual Sci::Position StartRun(Sci::Position position) const = 0;
	virtual Sci::Position EndRun(Sci::Position position) const = 0;
	virtual void SetValueAt(Sci::Position position, int value) = 0;
	virtual void InsertSpace(Sci::Position position, Sci::Position insertLength) = 0;
	virtual Sci::Position Runs() const = 0;
};

class IDecorationList {
public:
	virtual ~IDecorationList() {}

	virtual const std::vector<const IDecoration*> &View() const =0;

	virtual void SetCurrentIndicator(int indicator) = 0;
	virtual int GetCurrentIndicator() const = 0;

	virtual void SetCurrentValue(int value) = 0;
	virtual int GetCurrentValue() const = 0;

	// Returns with changed=true if some values may have changed
	virtual FillResult<Sci::Position> FillRange(Sci::Position position, int value, Sci::Position fillLength) = 0;
	virtual void InsertSpace(Sci::Position position, Sci::Position insertLength) = 0;
	virtual void DeleteRange(Sci::Position position, Sci::Position deleteLength) = 0;
	virtual void DeleteLexerDecorations() = 0;

	virtual int AllOnFor(Sci::Position position) const = 0;
	virtual int ValueAt(int indicator, Sci::Position position) = 0;
	virtual Sci::Position Start(int indicator, Sci::Position position) = 0;
	virtual Sci::Position End(int indicator, Sci::Position position) = 0;

	virtual bool ClickNotified() const = 0;
	virtual void SetClickNotified(bool notified) = 0;
};

std::unique_ptr<IDecoration> DecorationCreate(bool largeDocument, int indicator);

std::unique_ptr<IDecorationList> DecorationListCreate(bool largeDocument);

}

#endif