1 /* 2 * Copyright 2006, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 9 #ifndef PROPERTY_EDITOR_VIEW_H 10 #define PROPERTY_EDITOR_VIEW_H 11 12 #include <View.h> 13 14 class Property; 15 class PropertyItemView; 16 17 class PropertyEditorView : public BView { 18 public: 19 PropertyEditorView(); 20 virtual ~PropertyEditorView(); 21 22 // BView 23 virtual void Draw(BRect updateRect); 24 25 virtual void MouseDown(BPoint where); 26 virtual void MouseUp(BPoint where); 27 virtual void MouseMoved(BPoint where, uint32 transit, 28 const BMessage* dragMessage); 29 30 // PropertyEditorView 31 virtual float PreferredHeight() const; 32 33 void SetSelected(bool selected); 34 bool IsSelected() const 35 { return fSelected; } 36 virtual void SetEnabled(bool enabled) = 0; 37 virtual bool IsFocused() const 38 { return IsFocus(); } 39 40 void SetItemView(PropertyItemView* parent); 41 42 // used to trigger an update on the 43 // represented object 44 virtual void ValueChanged(); 45 46 virtual bool AdoptProperty(Property* property) = 0; 47 virtual Property* GetProperty() const = 0; 48 49 protected: 50 PropertyItemView* fParent; 51 52 private: 53 bool fSelected; 54 }; 55 56 #endif // PROPERTY_EDITOR_VIEW_H 57 58 59