1 /* 2 * Copyright 2006-2007, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 9 #ifndef MULTIPLE_MANIPULATOR_STATE_H 10 #define MULTIPLE_MANIPULATOR_STATE_H 11 12 #include <List.h> 13 14 #include "ViewState.h" 15 16 class Manipulator; 17 18 class MultipleManipulatorState : public ViewState { 19 public: 20 MultipleManipulatorState(StateView* view); 21 virtual ~MultipleManipulatorState(); 22 23 // ViewState interface 24 virtual void Init(); 25 virtual void Cleanup(); 26 27 virtual void Draw(BView* into, BRect updateRect); 28 virtual bool MessageReceived(BMessage* message, 29 Command** _command); 30 31 virtual void MouseDown(BPoint where, 32 uint32 buttons, 33 uint32 clicks); 34 35 virtual void MouseMoved(BPoint where, 36 uint32 transit, 37 const BMessage* dragMessage); 38 virtual Command* MouseUp(); 39 40 virtual void ModifiersChanged(uint32 modifiers); 41 42 virtual bool HandleKeyDown(uint32 key, uint32 modifiers, 43 Command** _command); 44 virtual bool HandleKeyUp(uint32 key, uint32 modifiers, 45 Command** _command); 46 47 virtual bool UpdateCursor(); 48 49 // MultipleManipulatorState 50 bool AddManipulator(Manipulator* manipulator); 51 Manipulator* RemoveManipulator(int32 index); 52 void DeleteManipulators(); 53 54 int32 CountManipulators() const; 55 Manipulator* ManipulatorAt(int32 index) const; 56 Manipulator* ManipulatorAtFast(int32 index) const; 57 58 private: 59 void _UpdateCursor(); 60 void _ShowContextMenu(BPoint where); 61 62 63 BList fManipulators; 64 Manipulator* fCurrentManipulator; 65 Manipulator* fPreviousManipulator; 66 }; 67 68 #endif // MULTIPLE_MANIPULATOR_STATE_H 69