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
&) : Editor() {}
20 ScintillaBase
&operator=(const ScintillaBase
&) { return *this; }
23 /** Enumeration of commands and child windows. */
37 bool displayPopupMenu
;
43 int listType
; ///< 0 is an autocomplete list
44 SString listSelected
; ///< Receives listbox selected string
45 int maxListWidth
; /// Maximum width of list, in average character widths
47 bool performingStyle
; ///< Prevent reentrance
51 const LexerModule
*lexCurrent
;
53 enum {numWordLists
=KEYWORDSET_MAX
+1};
54 WordList
*keyWordLists
[numWordLists
+1];
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() = 0;
65 virtual void RefreshColourPalette(Palette
&pal
, bool want
);
67 virtual void AddCharUTF(char *s
, unsigned int len
, bool treatAsDBCS
=false);
68 void Command(int cmdId
);
69 virtual void CancelModes();
70 virtual int KeyCommand(unsigned int iMessage
);
72 void AutoCompleteStart(int lenEntered
, const char *list
);
73 void AutoCompleteCancel();
74 void AutoCompleteMove(int delta
);
75 int AutoCompleteGetCurrent();
76 void AutoCompleteCharacterAdded(char ch
);
77 void AutoCompleteCharacterDeleted();
78 void AutoCompleteCompleted();
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 void ContextMenu(Point pt
);
89 virtual void ButtonDown(Point pt
, unsigned int curTime
, bool shift
, bool ctrl
, bool alt
);
91 virtual void NotifyStyleToNeeded(int endStyleNeeded
);
93 // Public so scintilla_send_message can use it
94 virtual sptr_t
WndProc(unsigned int iMessage
, uptr_t wParam
, sptr_t lParam
);