1 // Scintilla source code edit control
2 /** @file ScintillaBase.h
3 ** Defines an enhanced subclass of Editor with calltips, autocomplete and context menu.
5 // Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
8 #ifndef SCINTILLABASE_H
9 #define SCINTILLABASE_H
21 class ScintillaBase
: public Editor
{
22 // Private so ScintillaBase objects can not be copied
23 explicit ScintillaBase(const ScintillaBase
&);
24 ScintillaBase
&operator=(const ScintillaBase
&);
27 /** Enumeration of commands and child windows. */
41 enum { maxLenInputIME
= 200 };
49 int listType
; ///< 0 is an autocomplete list
50 int maxListWidth
; /// Maximum width of list, in average character widths
51 int multiAutoCMode
; /// Mode for autocompleting when multiple selections are present
54 LexState
*DocumentLexState();
55 void SetLexer(uptr_t wParam
);
56 void SetLexerLanguage(const char *languageName
);
57 void Colourise(int start
, int end
);
61 virtual ~ScintillaBase();
62 virtual void Initialise() = 0;
63 virtual void Finalise();
65 virtual void AddCharUTF(const char *s
, unsigned int len
, bool treatAsDBCS
=false);
66 void Command(int cmdId
);
67 virtual void CancelModes();
68 virtual int KeyCommand(unsigned int iMessage
);
70 void AutoCompleteInsert(Position startPos
, int removeLen
, const char *text
, int textLen
);
71 void AutoCompleteStart(int lenEntered
, const char *list
);
72 void AutoCompleteCancel();
73 void AutoCompleteMove(int delta
);
74 int AutoCompleteGetCurrent() const;
75 int AutoCompleteGetCurrentText(char *buffer
) const;
76 void AutoCompleteCharacterAdded(char ch
);
77 void AutoCompleteCharacterDeleted();
78 void AutoCompleteCompleted(char ch
, unsigned int completionMethod
);
79 void AutoCompleteMoveToCurrentWord();
80 static void AutoCompleteDoubleClick(void *p
);
83 void CallTipShow(Point pt
, const char *defn
);
84 virtual void CreateCallTipWindow(PRectangle rc
) = 0;
86 virtual void AddToPopUp(const char *label
, int cmd
=0, bool enabled
=true) = 0;
87 bool ShouldDisplayPopup(Point ptInWindowCoordinates
) const;
88 void ContextMenu(Point pt
);
90 virtual void ButtonDownWithModifiers(Point pt
, unsigned int curTime
, int modifiers
);
91 virtual void ButtonDown(Point pt
, unsigned int curTime
, bool shift
, bool ctrl
, bool alt
);
92 virtual void RightButtonDownWithModifiers(Point pt
, unsigned int curTime
, int modifiers
);
94 void NotifyStyleToNeeded(int endStyleNeeded
);
95 void NotifyLexerChanged(Document
*doc
, void *userData
);
98 // Public so scintilla_send_message can use it
99 virtual sptr_t
WndProc(unsigned int iMessage
, uptr_t wParam
, sptr_t lParam
);