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