]>
Commit | Line | Data |
---|---|---|
9ce192d4 | 1 | // Scintilla source code edit control |
65ec6247 RD |
2 | /** @file ScintillaBase.h |
3 | ** Defines an enhanced subclass of Editor with calltips, autocomplete and context menu. | |
4 | **/ | |
1a2fb4cd | 5 | // Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org> |
9ce192d4 RD |
6 | // The License.txt file describes the conditions under which this software may be distributed. |
7 | ||
8 | #ifndef SCINTILLABASE_H | |
9 | #define SCINTILLABASE_H | |
10 | ||
7e0c58e9 RD |
11 | #ifdef SCI_NAMESPACE |
12 | namespace Scintilla { | |
13 | #endif | |
14 | ||
65ec6247 RD |
15 | /** |
16 | */ | |
9ce192d4 | 17 | class ScintillaBase : public Editor { |
f6bcfd97 | 18 | // Private so ScintillaBase objects can not be copied |
9e96e16f RD |
19 | ScintillaBase(const ScintillaBase &); |
20 | ScintillaBase &operator=(const ScintillaBase &); | |
65ec6247 | 21 | |
9ce192d4 | 22 | protected: |
65ec6247 | 23 | /** Enumeration of commands and child windows. */ |
9ce192d4 RD |
24 | enum { |
25 | idCallTip=1, | |
26 | idAutoComplete=2, | |
1a2fb4cd | 27 | |
9ce192d4 RD |
28 | idcmdUndo=10, |
29 | idcmdRedo=11, | |
30 | idcmdCut=12, | |
31 | idcmdCopy=13, | |
32 | idcmdPaste=14, | |
33 | idcmdDelete=15, | |
34 | idcmdSelectAll=16 | |
35 | }; | |
36 | ||
b8b0e402 | 37 | bool displayPopupMenu; |
9ce192d4 RD |
38 | Menu popup; |
39 | AutoComplete ac; | |
40 | ||
41 | CallTip ct; | |
42 | ||
65ec6247 | 43 | int listType; ///< 0 is an autocomplete list |
1e9bafca RD |
44 | int maxListWidth; /// Maximum width of list, in average character widths |
45 | ||
9ce192d4 | 46 | #ifdef SCI_LEXER |
9e96e16f | 47 | bool performingStyle; ///< Prevent reentrance |
9ce192d4 | 48 | int lexLanguage; |
1a2fb4cd | 49 | const LexerModule *lexCurrent; |
9e96e16f | 50 | PropSetSimple props; |
88a8b04e | 51 | enum {numWordLists=KEYWORDSET_MAX+1}; |
65ec6247 RD |
52 | WordList *keyWordLists[numWordLists+1]; |
53 | void SetLexer(uptr_t wParam); | |
54 | void SetLexerLanguage(const char *languageName); | |
9ce192d4 RD |
55 | void Colourise(int start, int end); |
56 | #endif | |
57 | ||
58 | ScintillaBase(); | |
59 | virtual ~ScintillaBase(); | |
60 | virtual void Initialise() = 0; | |
61 | virtual void Finalise() = 0; | |
62 | ||
63 | virtual void RefreshColourPalette(Palette &pal, bool want); | |
1a2fb4cd RD |
64 | |
65 | virtual void AddCharUTF(char *s, unsigned int len, bool treatAsDBCS=false); | |
9ce192d4 | 66 | void Command(int cmdId); |
d134f170 RD |
67 | virtual void CancelModes(); |
68 | virtual int KeyCommand(unsigned int iMessage); | |
1a2fb4cd | 69 | |
9ce192d4 RD |
70 | void AutoCompleteStart(int lenEntered, const char *list); |
71 | void AutoCompleteCancel(); | |
72 | void AutoCompleteMove(int delta); | |
8e54aaed | 73 | int AutoCompleteGetCurrent(); |
9e96e16f | 74 | int AutoCompleteGetCurrentText(char *buffer); |
f114b858 RD |
75 | void AutoCompleteCharacterAdded(char ch); |
76 | void AutoCompleteCharacterDeleted(); | |
a834585d | 77 | void AutoCompleteCompleted(); |
d134f170 | 78 | void AutoCompleteMoveToCurrentWord(); |
1a2fb4cd | 79 | static void AutoCompleteDoubleClick(void* p); |
9ce192d4 | 80 | |
9e730a78 RD |
81 | void CallTipClick(); |
82 | void CallTipShow(Point pt, const char *defn); | |
9ce192d4 | 83 | virtual void CreateCallTipWindow(PRectangle rc) = 0; |
1a2fb4cd | 84 | |
9ce192d4 RD |
85 | virtual void AddToPopUp(const char *label, int cmd=0, bool enabled=true) = 0; |
86 | void ContextMenu(Point pt); | |
1a2fb4cd | 87 | |
9ce192d4 RD |
88 | virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt); |
89 | ||
f6bcfd97 | 90 | virtual void NotifyStyleToNeeded(int endStyleNeeded); |
9ce192d4 RD |
91 | public: |
92 | // Public so scintilla_send_message can use it | |
65ec6247 | 93 | virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); |
9ce192d4 RD |
94 | }; |
95 | ||
7e0c58e9 RD |
96 | #ifdef SCI_NAMESPACE |
97 | } | |
98 | #endif | |
99 | ||
9ce192d4 | 100 | #endif |