Update Tortoise.pot
[TortoiseGit.git] / ext / scintilla / src / ScintillaBase.h
blob0df6e279dd2f963a7d1c0be8680927aa48cc0f1e
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 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 enum { maxLenInputIME = 200 };
39 int displayPopupMenu;
40 Menu popup;
41 AutoComplete ac;
43 CallTip ct;
45 int listType; ///< 0 is an autocomplete list
46 int maxListWidth; /// Maximum width of list, in average character widths
47 int multiAutoCMode; /// Mode for autocompleting when multiple selections are present
49 #ifdef SCI_LEXER
50 LexState *DocumentLexState();
51 void SetLexer(uptr_t wParam);
52 void SetLexerLanguage(const char *languageName);
53 void Colourise(int start, int end);
54 #endif
56 ScintillaBase();
57 // Deleted so ScintillaBase objects can not be copied.
58 explicit ScintillaBase(const ScintillaBase &) = delete;
59 ScintillaBase &operator=(const ScintillaBase &) = delete;
60 virtual ~ScintillaBase();
61 void Initialise() override {}
62 void Finalise() override;
64 void AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS=false) override;
65 void Command(int cmdId);
66 void CancelModes() override;
67 int KeyCommand(unsigned int iMessage) override;
69 void AutoCompleteInsert(Sci::Position startPos, int removeLen, const char *text, int textLen);
70 void AutoCompleteStart(int lenEntered, const char *list);
71 void AutoCompleteCancel();
72 void AutoCompleteMove(int delta);
73 int AutoCompleteGetCurrent() const;
74 int AutoCompleteGetCurrentText(char *buffer) const;
75 void AutoCompleteCharacterAdded(char ch);
76 void AutoCompleteCharacterDeleted();
77 void AutoCompleteCompleted(char ch, unsigned int completionMethod);
78 void AutoCompleteMoveToCurrentWord();
79 static void AutoCompleteDoubleClick(void *p);
81 void CallTipClick();
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 bool ShouldDisplayPopup(Point ptInWindowCoordinates) const;
87 void ContextMenu(Point pt);
89 void ButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers) override;
90 void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt) override;
91 void RightButtonDownWithModifiers(Point pt, unsigned int curTime, int modifiers) override;
93 void NotifyStyleToNeeded(Sci::Position endStyleNeeded) override;
94 void NotifyLexerChanged(Document *doc, void *userData) override;
96 public:
97 // Public so scintilla_send_message can use it
98 sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) override;
101 #ifdef SCI_NAMESPACE
103 #endif
105 #endif