xref: /haiku/src/kits/interface/textview_support/InlineInput.h (revision 55b40aa53a835472ec7952b138ae4256203d02e4)
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 
14 struct clause;
15 class _BInlineInput_ {
16 public:
17 	_BInlineInput_(BMessenger);
18 	~_BInlineInput_();
19 
20 	const BMessenger *Method() const;
21 
22 	bool IsActive() const;
23 	void SetActive(bool active);
24 
25 	int32 Length() const;
26 	void SetLength(int32 length);
27 
28 	int32 Offset() const;
29 	void SetOffset(int32 offset);
30 
31 	int32 SelectionLength() const;
32 	void SetSelectionLength(int32);
33 
34 	int32 SelectionOffset() const;
35 	void SetSelectionOffset(int32 offset);
36 
37 	void AddClause(int32, int32);
38 	bool GetClause(int32 index, int32 *start, int32 *end) const;
39 	int32 CountClauses() const;
40 
41 	void ResetClauses();
42 
43 private:
44 	const BMessenger fMessenger;
45 
46 	bool fActive;
47 
48 	int32 fOffset;
49 	int32 fLength;
50 
51 	int32 fSelectionOffset;
52 	int32 fSelectionLength;
53 
54 	int32 fNumClauses;
55 	clause *fClauses;
56 };
57 
58 #endif //__INLINEINPUT_H
59