Update Scintilla to version 3.6.2
[geany-mirror.git] / scintilla / src / ScintillaBase.h
blob4bdf24ef266aa1ed42604541f6a01c717fd0d0f9
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 #ifdef SCI_LEXER
16 class LexState;
17 #endif
19 /**
21 class ScintillaBase : public Editor {
22 // Private so ScintillaBase objects can not be copied
23 explicit ScintillaBase(const ScintillaBase &);
24 ScintillaBase &operator=(const ScintillaBase &);
26 protected:
27 /** Enumeration of commands and child windows. */
28 enum {
29 idCallTip=1,
30 idAutoComplete=2,
32 idcmdUndo=10,
33 idcmdRedo=11,
34 idcmdCut=12,
35 idcmdCopy=13,
36 idcmdPaste=14,
37 idcmdDelete=15,
38 idcmdSelectAll=16
41 enum { maxLenInputIME = 200 };
43 bool displayPopupMenu;
44 Menu popup;
45 AutoComplete ac;
47 CallTip ct;
49 int listType; ///< 0 is an autocomplete list
50 int maxListWidth; /// Maximum width of list, in average character widths
51 int multiAutoCMode; /// Mode for autocompleting when multiple selections are present
53 #ifdef SCI_LEXER
54 LexState *DocumentLexState();
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();
65 virtual void AddCharUTF(const 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 AutoCompleteInsert(Position startPos, int removeLen, const char *text, int textLen);
71 void AutoCompleteStart(int lenEntered, const char *list);
72 void AutoCompleteCancel();
73 void AutoCompleteMove(int delta);
74 int AutoCompleteGetCurrent() const;
75 int AutoCompleteGetCurrentText(char *buffer) const;
76 void AutoCompleteCharacterAdded(char ch);
77 void AutoCompleteCharacterDeleted();
78 void AutoCompleteCompleted(char ch, unsigned int completionMethod);
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 ButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers);
90 virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
92 void NotifyStyleToNeeded(int endStyleNeeded);
93 void NotifyLexerChanged(Document *doc, void *userData);
95 public:
96 // Public so scintilla_send_message can use it
97 virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
100 #ifdef SCI_NAMESPACE
102 #endif
104 #endif