1*8af74909SZhong Yang // Scintilla source code edit control 2*8af74909SZhong Yang /** @file EditModel.h 3*8af74909SZhong Yang ** Defines the editor state that must be visible to EditorView. 4*8af74909SZhong Yang **/ 5*8af74909SZhong Yang // Copyright 1998-2014 by Neil Hodgson <[email protected]> 6*8af74909SZhong Yang // The License.txt file describes the conditions under which this software may be distributed. 7*8af74909SZhong Yang 8*8af74909SZhong Yang #ifndef EDITMODEL_H 9*8af74909SZhong Yang #define EDITMODEL_H 10*8af74909SZhong Yang 11*8af74909SZhong Yang namespace Scintilla { 12*8af74909SZhong Yang 13*8af74909SZhong Yang /** 14*8af74909SZhong Yang */ 15*8af74909SZhong Yang class Caret { 16*8af74909SZhong Yang public: 17*8af74909SZhong Yang bool active; 18*8af74909SZhong Yang bool on; 19*8af74909SZhong Yang int period; 20*8af74909SZhong Yang 21*8af74909SZhong Yang Caret() noexcept; 22*8af74909SZhong Yang }; 23*8af74909SZhong Yang 24*8af74909SZhong Yang class EditModel { 25*8af74909SZhong Yang public: 26*8af74909SZhong Yang bool inOverstrike; 27*8af74909SZhong Yang int xOffset; ///< Horizontal scrolled amount in pixels 28*8af74909SZhong Yang bool trackLineWidth; 29*8af74909SZhong Yang 30*8af74909SZhong Yang SpecialRepresentations reprs; 31*8af74909SZhong Yang Caret caret; 32*8af74909SZhong Yang SelectionPosition posDrag; 33*8af74909SZhong Yang Sci::Position braces[2]; 34*8af74909SZhong Yang int bracesMatchStyle; 35*8af74909SZhong Yang int highlightGuideColumn; 36*8af74909SZhong Yang Selection sel; 37*8af74909SZhong Yang bool primarySelection; 38*8af74909SZhong Yang 39*8af74909SZhong Yang enum IMEInteraction { imeWindowed, imeInline } imeInteraction; 40*8af74909SZhong Yang enum class CharacterSource { directInput, tentativeInput, imeResult }; 41*8af74909SZhong Yang enum class Bidirectional { bidiDisabled, bidiL2R, bidiR2L } bidirectional; 42*8af74909SZhong Yang 43*8af74909SZhong Yang int foldFlags; 44*8af74909SZhong Yang int foldDisplayTextStyle; 45*8af74909SZhong Yang UniqueString defaultFoldDisplayText; 46*8af74909SZhong Yang std::unique_ptr<IContractionState> pcs; 47*8af74909SZhong Yang // Hotspot support 48*8af74909SZhong Yang Range hotspot; 49*8af74909SZhong Yang Sci::Position hoverIndicatorPos; 50*8af74909SZhong Yang 51*8af74909SZhong Yang // Wrapping support 52*8af74909SZhong Yang int wrapWidth; 53*8af74909SZhong Yang 54*8af74909SZhong Yang Document *pdoc; 55*8af74909SZhong Yang 56*8af74909SZhong Yang EditModel(); 57*8af74909SZhong Yang // Deleted so EditModel objects can not be copied. 58*8af74909SZhong Yang EditModel(const EditModel &) = delete; 59*8af74909SZhong Yang EditModel(EditModel &&) = delete; 60*8af74909SZhong Yang EditModel &operator=(const EditModel &) = delete; 61*8af74909SZhong Yang EditModel &operator=(EditModel &&) = delete; 62*8af74909SZhong Yang virtual ~EditModel(); 63*8af74909SZhong Yang virtual Sci::Line TopLineOfMain() const = 0; 64*8af74909SZhong Yang virtual Point GetVisibleOriginInMain() const = 0; 65*8af74909SZhong Yang virtual Sci::Line LinesOnScreen() const = 0; 66*8af74909SZhong Yang virtual Range GetHotSpotRange() const noexcept = 0; 67*8af74909SZhong Yang bool BidirectionalEnabled() const noexcept; 68*8af74909SZhong Yang bool BidirectionalR2L() const noexcept; 69*8af74909SZhong Yang void SetDefaultFoldDisplayText(const char *text); 70*8af74909SZhong Yang const char *GetDefaultFoldDisplayText() const noexcept; 71*8af74909SZhong Yang const char *GetFoldDisplayText(Sci::Line lineDoc) const noexcept; 72*8af74909SZhong Yang }; 73*8af74909SZhong Yang 74*8af74909SZhong Yang } 75*8af74909SZhong Yang 76*8af74909SZhong Yang #endif 77