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 ScintillaBase(const ScintillaBase
&);
24 ScintillaBase
&operator=(const ScintillaBase
&);
27 /** Enumeration of commands and child windows. */
41 bool displayPopupMenu
;
47 int listType
; ///< 0 is an autocomplete list
48 int maxListWidth
; /// Maximum width of list, in average character widths
51 LexState
*DocumentLexState();
52 void SetLexer(uptr_t wParam
);
53 void SetLexerLanguage(const char *languageName
);
54 void Colourise(int start
, int end
);
58 virtual ~ScintillaBase();
59 virtual void Initialise() = 0;
60 virtual void Finalise() = 0;
62 virtual void AddCharUTF(char *s
, unsigned int len
, bool treatAsDBCS
=false);
63 void Command(int cmdId
);
64 virtual void CancelModes();
65 virtual int KeyCommand(unsigned int iMessage
);
67 void AutoCompleteStart(int lenEntered
, const char *list
);
68 void AutoCompleteCancel();
69 void AutoCompleteMove(int delta
);
70 int AutoCompleteGetCurrent();
71 int AutoCompleteGetCurrentText(char *buffer
);
72 void AutoCompleteCharacterAdded(char ch
);
73 void AutoCompleteCharacterDeleted();
74 void AutoCompleteCompleted();
75 void AutoCompleteMoveToCurrentWord();
76 static void AutoCompleteDoubleClick(void *p
);
79 void CallTipShow(Point pt
, const char *defn
);
80 virtual void CreateCallTipWindow(PRectangle rc
) = 0;
82 virtual void AddToPopUp(const char *label
, int cmd
=0, bool enabled
=true) = 0;
83 void ContextMenu(Point pt
);
85 virtual void ButtonDown(Point pt
, unsigned int curTime
, bool shift
, bool ctrl
, bool alt
);
87 void NotifyStyleToNeeded(int endStyleNeeded
);
88 void NotifyLexerChanged(Document
*doc
, void *userData
);
91 // Public so scintilla_send_message can use it
92 virtual sptr_t
WndProc(unsigned int iMessage
, uptr_t wParam
, sptr_t lParam
);