vfs: check userland buffers before reading them.
[haiku.git] / src / apps / deskcalc / InputTextView.h
blob0667522697a625d18c0d716294f11cf9949e3be7
1 /*
2 * Copyright 2006 Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Stephan Aßmus, superstippi@gmx.de
7 */
8 #ifndef INPUT_TEXT_VIEW_H
9 #define INPUT_TEXT_VIEW_H
12 #include <Invoker.h>
13 #include <TextView.h>
16 class InputTextView : public BTextView, public BInvoker {
17 public:
18 InputTextView(BRect frame,
19 const char* name,
20 BRect textRect,
21 uint32 resizingMode,
22 uint32 flags);
23 virtual ~InputTextView();
25 // BTextView interface
26 virtual void MouseDown(BPoint where);
27 virtual void MouseUp(BPoint where);
29 virtual void KeyDown(const char* bytes, int32 numBytes);
30 virtual void MakeFocus(bool focus);
32 // BInvoker interface
33 virtual status_t Invoke(BMessage* message = NULL);
35 // InputTextView
36 virtual void RevertChanges() = 0;
37 virtual void ApplyChanges() = 0;
39 protected:
40 // BTextView
41 virtual void Select(int32 start, int32 finish);
43 virtual void InsertText(const char* inText,
44 int32 inLength,
45 int32 inOffset,
46 const text_run_array* inRuns);
47 virtual void DeleteText(int32 fromOffset,
48 int32 toOffset);
50 void _CheckTextRect();
52 bool fWasFocus;
55 #endif // INPUT_TEXT_VIEW_H