2 * Copyright 2002-2006, project beam (http://sourceforge.net/projects/beam).
3 * All rights reserved. Distributed under the terms of the MIT License.
6 * Oliver Tappe <beam@hirschkaefer.de>
8 #ifndef TEXT_CONTROL_COMPLETER_H
9 #define TEXT_CONTROL_COMPLETER_H
11 #include <MessageFilter.h>
13 #include "AutoCompleter.h"
18 class TextViewCompleter
: protected BAutoCompleter
, public BMessageFilter
{
20 TextViewCompleter(BTextView
* textView
,
21 ChoiceModel
* choiceModel
= NULL
,
22 PatternSelector
* patternSelector
= NULL
);
23 virtual ~TextViewCompleter();
25 void SetModificationsReported(bool reported
);
26 void TextModified(bool updateChoices
);
29 virtual filter_result
Filter(BMessage
* message
, BHandler
** target
);
31 class TextViewWrapper
: public EditView
{
33 TextViewWrapper(BTextView
* textView
);
34 virtual BRect
GetAdjustmentFrame();
35 virtual void GetEditViewState(BString
& text
,
37 virtual void SetEditViewState(const BString
& text
,
38 int32 caretPos
, int32 selectionLength
= 0);
45 bool fModificationsReported
;
48 #endif // TEXT_CONTROL_COMPLETER_H