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