Added GPLv3 headers all over the place.
[fail.git] / src / gui / game / Draggable.h
blob37aaf5f705f61e6c171b0d1dd27749d120d51d94
1 /*
2 Fail game engine
3 Copyright 2007 Antoine Chavasse <a.chavasse@gmail.com>
5 This file is part of Fail.
7 Fail is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 3
9 as published by the Free Software Foundation.
11 Fail is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef FAIL_GUI_GAME_DRAGGABLE_H_
20 #define FAIL_GUI_GAME_DRAGGABLE_H_
22 #include "core/core.h"
23 #include "gui/game/guigame_export.h"
24 #include "Container.h"
25 #include "Theme.h"
26 #include <string>
28 namespace fail { namespace gui { namespace game
30 class FLGUIGAME_EXPORT Draggable : public Widget
32 public:
33 enum e_State
35 s_Idle,
36 s_Hilighted,
37 s_Dragging
38 };
40 Draggable( Container* pParent_ );
42 const e_State& getState() const { return m_State; }
43 void setState( const e_State& x ) { m_State = x; }
45 virtual void mouseEnter( const math::Vector2f& pos );
46 virtual void mouseExit();
47 virtual bool mouseMotionEvent( const math::Vector2f& pos, const math::Vector2f& rel );
48 virtual bool mouseButtonEvent( const math::Vector2f& pos, e_MouseButton Button, bool bPressed );
50 Signal< math::Vector2f, math::Vector2f > m_Dragging;
52 private:
53 e_State m_State;
54 math::Vector2f m_Offset;
56 }}}
58 #endif