xref: /haiku/src/apps/icon-o-matic/generic/gui/stateview/MultipleManipulatorState.h (revision 1acbe440b8dd798953bec31d18ee589aa3f71b73)
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 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 	// MultipleManipulatorState
48 			bool				AddManipulator(Manipulator* manipulator);
49 			Manipulator*		RemoveManipulator(int32 index);
50 			void				DeleteManipulators();
51 
52 			int32				CountManipulators() const;
53 			Manipulator*		ManipulatorAt(int32 index) const;
54 			Manipulator*		ManipulatorAtFast(int32 index) const;
55 
56  private:
57 			void				_UpdateCursor();
58 			void				_ShowContextMenu(BPoint where);
59 
60 
61 			BList				fManipulators;
62 			Manipulator*		fCurrentManipulator;
63 			Manipulator*		fPreviousManipulator;
64 };
65 
66 #endif // MULTIPLE_MANIPULATOR_STATE_H
67