]> git.saurik.com Git - wxWidgets.git/blob - src/stc/scintilla/src/AutoComplete.h
b10cdce82ff50e9a8a303de9c0123854135833a9
[wxWidgets.git] / src / stc / scintilla / src / AutoComplete.h
1 // Scintilla source code edit control
2 /** @file AutoComplete.h
3 ** Defines the auto completion list box.
4 **/
5 // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
7
8 #ifndef AUTOCOMPLETE_H
9 #define AUTOCOMPLETE_H
10
11 #ifdef SCI_NAMESPACE
12 namespace Scintilla {
13 #endif
14
15 /**
16 */
17 class AutoComplete {
18 bool active;
19 char stopChars[256];
20 char fillUpChars[256];
21 char separator;
22 char typesep; // Type seperator
23
24 public:
25 bool ignoreCase;
26 bool chooseSingle;
27 ListBox *lb;
28 int posStart;
29 int startLen;
30 /// Should autocompletion be canceled if editor's currentPos <= startPos?
31 bool cancelAtStartPos;
32 bool autoHide;
33 bool dropRestOfWord;
34
35 AutoComplete();
36 ~AutoComplete();
37
38 /// Is the auto completion list displayed?
39 bool Active();
40
41 /// Display the auto completion list positioned to be near a character position
42 void Start(Window &parent, int ctrlID, int position, Point location,
43 int startLen_, int lineHeight, bool unicodeMode);
44
45 /// The stop chars are characters which, when typed, cause the auto completion list to disappear
46 void SetStopChars(const char *stopChars_);
47 bool IsStopChar(char ch);
48
49 /// The fillup chars are characters which, when typed, fill up the selected word
50 void SetFillUpChars(const char *fillUpChars_);
51 bool IsFillUpChar(char ch);
52
53 /// The separator character is used when interpreting the list in SetList
54 void SetSeparator(char separator_);
55 char GetSeparator();
56
57 /// The typesep character is used for seperating the word from the type
58 void SetTypesep(char separator_);
59 char GetTypesep();
60
61 /// The list string contains a sequence of words separated by the separator character
62 void SetList(const char *list);
63
64 void Show(bool show);
65 void Cancel();
66
67 /// Move the current list element by delta, scrolling appropriately
68 void Move(int delta);
69
70 /// Select a list element that starts with word as the current element
71 void Select(const char *word);
72 };
73
74 #ifdef SCI_NAMESPACE
75 }
76 #endif
77
78 #endif