1*8af74909SZhong Yang /** @file Decoration.h 2*8af74909SZhong Yang ** Visual elements added over text. 3*8af74909SZhong Yang **/ 4*8af74909SZhong Yang // Copyright 1998-2007 by Neil Hodgson <[email protected]> 5*8af74909SZhong Yang // The License.txt file describes the conditions under which this software may be distributed. 6*8af74909SZhong Yang 7*8af74909SZhong Yang #ifndef DECORATION_H 8*8af74909SZhong Yang #define DECORATION_H 9*8af74909SZhong Yang 10*8af74909SZhong Yang namespace Scintilla { 11*8af74909SZhong Yang 12*8af74909SZhong Yang class IDecoration { 13*8af74909SZhong Yang public: ~IDecoration()14*8af74909SZhong Yang virtual ~IDecoration() {} 15*8af74909SZhong Yang virtual bool Empty() const noexcept = 0; 16*8af74909SZhong Yang virtual int Indicator() const noexcept = 0; 17*8af74909SZhong Yang virtual Sci::Position Length() const noexcept = 0; 18*8af74909SZhong Yang virtual int ValueAt(Sci::Position position) const noexcept = 0; 19*8af74909SZhong Yang virtual Sci::Position StartRun(Sci::Position position) const noexcept = 0; 20*8af74909SZhong Yang virtual Sci::Position EndRun(Sci::Position position) const noexcept = 0; 21*8af74909SZhong Yang virtual void SetValueAt(Sci::Position position, int value) = 0; 22*8af74909SZhong Yang virtual void InsertSpace(Sci::Position position, Sci::Position insertLength) = 0; 23*8af74909SZhong Yang virtual Sci::Position Runs() const noexcept = 0; 24*8af74909SZhong Yang }; 25*8af74909SZhong Yang 26*8af74909SZhong Yang class IDecorationList { 27*8af74909SZhong Yang public: ~IDecorationList()28*8af74909SZhong Yang virtual ~IDecorationList() {} 29*8af74909SZhong Yang 30*8af74909SZhong Yang virtual const std::vector<const IDecoration*> &View() const noexcept = 0; 31*8af74909SZhong Yang 32*8af74909SZhong Yang virtual void SetCurrentIndicator(int indicator) = 0; 33*8af74909SZhong Yang virtual int GetCurrentIndicator() const noexcept = 0; 34*8af74909SZhong Yang 35*8af74909SZhong Yang virtual void SetCurrentValue(int value) = 0; 36*8af74909SZhong Yang virtual int GetCurrentValue() const noexcept = 0; 37*8af74909SZhong Yang 38*8af74909SZhong Yang // Returns with changed=true if some values may have changed 39*8af74909SZhong Yang virtual FillResult<Sci::Position> FillRange(Sci::Position position, int value, Sci::Position fillLength) = 0; 40*8af74909SZhong Yang virtual void InsertSpace(Sci::Position position, Sci::Position insertLength) = 0; 41*8af74909SZhong Yang virtual void DeleteRange(Sci::Position position, Sci::Position deleteLength) = 0; 42*8af74909SZhong Yang virtual void DeleteLexerDecorations() = 0; 43*8af74909SZhong Yang 44*8af74909SZhong Yang virtual int AllOnFor(Sci::Position position) const noexcept = 0; 45*8af74909SZhong Yang virtual int ValueAt(int indicator, Sci::Position position) noexcept = 0; 46*8af74909SZhong Yang virtual Sci::Position Start(int indicator, Sci::Position position) noexcept = 0; 47*8af74909SZhong Yang virtual Sci::Position End(int indicator, Sci::Position position) noexcept = 0; 48*8af74909SZhong Yang 49*8af74909SZhong Yang virtual bool ClickNotified() const noexcept = 0; 50*8af74909SZhong Yang virtual void SetClickNotified(bool notified) noexcept = 0; 51*8af74909SZhong Yang }; 52*8af74909SZhong Yang 53*8af74909SZhong Yang std::unique_ptr<IDecoration> DecorationCreate(bool largeDocument, int indicator); 54*8af74909SZhong Yang 55*8af74909SZhong Yang std::unique_ptr<IDecorationList> DecorationListCreate(bool largeDocument); 56*8af74909SZhong Yang 57*8af74909SZhong Yang } 58*8af74909SZhong Yang 59*8af74909SZhong Yang #endif 60