Upgraded to scintilla 3.2.3
[TortoiseGit.git] / ext / scintilla / src / AutoComplete.h
blobed215ec7bd6621c2e7c476e8778d6d1ca4b6fb6e
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.
8 #ifndef AUTOCOMPLETE_H
9 #define AUTOCOMPLETE_H
11 #ifdef SCI_NAMESPACE
12 namespace Scintilla {
13 #endif
15 /**
17 class AutoComplete {
18 bool active;
19 char stopChars[256];
20 char fillUpChars[256];
21 char separator;
22 char typesep; // Type seperator
23 enum { maxItemLen=1000 };
25 public:
27 bool ignoreCase;
28 bool chooseSingle;
29 ListBox *lb;
30 int posStart;
31 int startLen;
32 /// Should autocompletion be canceled if editor's currentPos <= startPos?
33 bool cancelAtStartPos;
34 bool autoHide;
35 bool dropRestOfWord;
36 unsigned int ignoreCaseBehaviour;
37 int widthLBDefault;
38 int heightLBDefault;
40 AutoComplete();
41 ~AutoComplete();
43 /// Is the auto completion list displayed?
44 bool Active() const;
46 /// Display the auto completion list positioned to be near a character position
47 void Start(Window &parent, int ctrlID, int position, Point location,
48 int startLen_, int lineHeight, bool unicodeMode, int technology);
50 /// The stop chars are characters which, when typed, cause the auto completion list to disappear
51 void SetStopChars(const char *stopChars_);
52 bool IsStopChar(char ch);
54 /// The fillup chars are characters which, when typed, fill up the selected word
55 void SetFillUpChars(const char *fillUpChars_);
56 bool IsFillUpChar(char ch);
58 /// The separator character is used when interpreting the list in SetList
59 void SetSeparator(char separator_);
60 char GetSeparator() const;
62 /// The typesep character is used for seperating the word from the type
63 void SetTypesep(char separator_);
64 char GetTypesep() const;
66 /// The list string contains a sequence of words separated by the separator character
67 void SetList(const char *list);
69 /// Return the position of the currently selected list item
70 int GetSelection() const;
72 /// Return the value of an item in the list
73 std::string GetValue(int item) const;
75 void Show(bool show);
76 void Cancel();
78 /// Move the current list element by delta, scrolling appropriately
79 void Move(int delta);
81 /// Select a list element that starts with word as the current element
82 void Select(const char *word);
85 #ifdef SCI_NAMESPACE
87 #endif
89 #endif