1/*
2 * Copyright 2003-2006, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Stefano Ceccherini (burton666@libero.it)
7 */
8
9#ifndef __INLINEINPUT_H
10#define __INLINEINPUT_H
11
12#include <Messenger.h>
13#include <TextView.h>
14
15struct clause;
16
17class BTextView::InlineInput {
18public:
19	InlineInput(BMessenger);
20	~InlineInput();
21
22	const BMessenger *Method() const;
23
24	bool IsActive() const;
25	void SetActive(bool active);
26
27	int32 Length() const;
28	void SetLength(int32 length);
29
30	int32 Offset() const;
31	void SetOffset(int32 offset);
32
33	int32 SelectionLength() const;
34	void SetSelectionLength(int32);
35
36	int32 SelectionOffset() const;
37	void SetSelectionOffset(int32 offset);
38
39	bool AddClause(int32, int32);
40	bool GetClause(int32 index, int32 *start, int32 *end) const;
41	int32 CountClauses() const;
42
43	void ResetClauses();
44
45private:
46	const BMessenger fMessenger;
47
48	bool fActive;
49
50	int32 fOffset;
51	int32 fLength;
52
53	int32 fSelectionOffset;
54	int32 fSelectionLength;
55
56	int32 fNumClauses;
57	clause *fClauses;
58};
59
60#endif //__INLINEINPUT_H
61