xref: /haiku/src/apps/deskcalc/InputTextView.h (revision 9f5d4ecd972134f48a330f95d8a9a9ea49dbc3a1)
1 /*
2  * Copyright 2006 Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef INPUT_TEXT_VIEW_H
6 #define INPUT_TEXT_VIEW_H
7 
8 
9 #include <Invoker.h>
10 #include <TextView.h>
11 
12 
13 class InputTextView : public BTextView, public BInvoker {
14  public:
15 								InputTextView(BRect frame,
16 									const char* name,
17 									BRect textRect,
18 									uint32 resizingMode,
19 									uint32 flags);
20 	virtual						~InputTextView();
21 
22 	// BTextView interface
23 	virtual	void				MouseDown(BPoint where);
24 	virtual	void				MouseUp(BPoint where);
25 
26 	virtual	void				KeyDown(const char* bytes, int32 numBytes);
27 	virtual	void				MakeFocus(bool focus);
28 
29 	// BInvoker interface
30 	virtual	status_t			Invoke(BMessage* message = NULL);
31 
32 	// InputTextView
33 	virtual	void				RevertChanges() = 0;
34 	virtual	void				ApplyChanges() = 0;
35 
36  protected:
37 								// BTextView
38 	virtual	void				Select(int32 start, int32 finish);
39 
40 	virtual	void				InsertText(const char* inText,
41 									int32 inLength,
42 									int32 inOffset,
43 									const text_run_array* inRuns);
44 	virtual	void				DeleteText(int32 fromOffset,
45 									int32 toOffset);
46 
47 			void				_CheckTextRect();
48 
49 			bool				fWasFocus;
50 };
51 
52 #endif // INPUT_TEXT_VIEW_H
53