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
17 class ScintillaBase
: public Editor
{
18 // Private so ScintillaBase objects can not be copied
19 ScintillaBase(const ScintillaBase
&);
20 ScintillaBase
&operator=(const ScintillaBase
&);
23 /** Enumeration of commands and child windows. */
37 bool displayPopupMenu
;
43 int listType
; ///< 0 is an autocomplete list
44 int maxListWidth
; /// Maximum width of list, in average character widths
47 bool performingStyle
; ///< Prevent reentrance
49 const LexerModule
*lexCurrent
;
51 enum {numWordLists
=KEYWORDSET_MAX
+1};
52 WordList
*keyWordLists
[numWordLists
+1];
53 void SetLexer(uptr_t wParam
);
54 void SetLexerLanguage(const char *languageName
);
55 void Colourise(int start
, int end
);
59 virtual ~ScintillaBase();
60 virtual void Initialise() = 0;
61 virtual void Finalise() = 0;
63 virtual void RefreshColourPalette(Palette
&pal
, bool want
);
65 virtual void AddCharUTF(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 AutoCompleteStart(int lenEntered
, const char *list
);
71 void AutoCompleteCancel();
72 void AutoCompleteMove(int delta
);
73 int AutoCompleteGetCurrent();
74 int AutoCompleteGetCurrentText(char *buffer
);
75 void AutoCompleteCharacterAdded(char ch
);
76 void AutoCompleteCharacterDeleted();
77 void AutoCompleteCompleted();
78 void AutoCompleteMoveToCurrentWord();
79 static void AutoCompleteDoubleClick(void *p
);
82 void CallTipShow(Point pt
, const char *defn
);
83 virtual void CreateCallTipWindow(PRectangle rc
) = 0;
85 virtual void AddToPopUp(const char *label
, int cmd
=0, bool enabled
=true) = 0;
86 void ContextMenu(Point pt
);
88 virtual void ButtonDown(Point pt
, unsigned int curTime
, bool shift
, bool ctrl
, bool alt
);
90 virtual void NotifyStyleToNeeded(int endStyleNeeded
);
92 // Public so scintilla_send_message can use it
93 virtual sptr_t
WndProc(unsigned int iMessage
, uptr_t wParam
, sptr_t lParam
);