1 /* 2 * Copyright 2006-2009, Stephan Aßmus <superstippi@gmx.de>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef INPUT_TEXT_VIEW_H 6 #define INPUT_TEXT_VIEW_H 7 8 #include <Invoker.h> 9 #include <String.h> 10 #include <TextView.h> 11 12 class InputTextView : public BTextView, 13 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 bool fWasFocus; 38 BString fTextBeforeFocus; 39 }; 40 41 #endif // INPUT_TEXT_VIEW_H 42 43 44