1// Scintilla source code edit control
2/** @file ContractionState.h
3 ** Manages visibility of lines for folding and wrapping.
4 **/
5// Copyright 1998-2007 by Neil Hodgson <neilh@scintilla.org>
6// The License.txt file describes the conditions under which this software may be distributed.
7
8#ifndef CONTRACTIONSTATE_H
9#define CONTRACTIONSTATE_H
10
11namespace Scintilla::Internal {
12
13/**
14*/
15class IContractionState {
16public:
17 virtual ~IContractionState() {};
18
19 virtual void Clear()=0;
20
21 virtual Sci::Line LinesInDoc() const noexcept=0;
22 virtual Sci::Line LinesDisplayed() const noexcept=0;
23 virtual Sci::Line DisplayFromDoc(Sci::Line lineDoc) const noexcept=0;
24 virtual Sci::Line DisplayLastFromDoc(Sci::Line lineDoc) const noexcept=0;
25 virtual Sci::Line DocFromDisplay(Sci::Line lineDisplay) const noexcept=0;
26
27 virtual void InsertLines(Sci::Line lineDoc, Sci::Line lineCount)=0;
28 virtual void DeleteLines(Sci::Line lineDoc, Sci::Line lineCount)=0;
29
30 virtual bool GetVisible(Sci::Line lineDoc) const noexcept=0;
31 virtual bool SetVisible(Sci::Line lineDocStart, Sci::Line lineDocEnd, bool isVisible)=0;
32 virtual bool HiddenLines() const noexcept=0;
33
34 virtual const char *GetFoldDisplayText(Sci::Line lineDoc) const noexcept=0;
35 virtual bool SetFoldDisplayText(Sci::Line lineDoc, const char *text)=0;
36
37 virtual bool GetExpanded(Sci::Line lineDoc) const noexcept=0;
38 virtual bool SetExpanded(Sci::Line lineDoc, bool isExpanded)=0;
39 virtual Sci::Line ContractedNext(Sci::Line lineDocStart) const noexcept =0;
40
41 virtual int GetHeight(Sci::Line lineDoc) const noexcept=0;
42 virtual bool SetHeight(Sci::Line lineDoc, int height)=0;
43
44 virtual void ShowAll() noexcept=0;
45};
46
47std::unique_ptr<IContractionState> ContractionStateCreate(bool largeDocument);
48
49}
50
51#endif
52