Add an UI to enable/disable specific overlay handlers.
[TortoiseGit.git] / ext / scintilla / src / ScintillaBase.h
blob9eb52fef812f2d2530fd83eaa6bca2185bda46f0
1 // Scintilla source code edit control
2 /** @file ScintillaBase.h
3 ** Defines an enhanced subclass of Editor with calltips, autocomplete and context menu.
4 **/
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
11 #ifdef SCI_NAMESPACE
12 namespace Scintilla {
13 #endif
15 /**
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; }
22 protected:
23 /** Enumeration of commands and child windows. */
24 enum {
25 idCallTip=1,
26 idAutoComplete=2,
28 idcmdUndo=10,
29 idcmdRedo=11,
30 idcmdCut=12,
31 idcmdCopy=13,
32 idcmdPaste=14,
33 idcmdDelete=15,
34 idcmdSelectAll=16
37 bool displayPopupMenu;
38 Menu popup;
39 AutoComplete ac;
41 CallTip ct;
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
49 #ifdef SCI_LEXER
50 int lexLanguage;
51 const LexerModule *lexCurrent;
52 PropSet props;
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);
58 #endif
60 ScintillaBase();
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);
82 void CallTipClick();
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);
92 public:
93 // Public so scintilla_send_message can use it
94 virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
97 #ifdef SCI_NAMESPACE
99 #endif
101 #endif