MouseEvent.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef _GAZEBO_MOUSEEVENT_HH_
18 #define _GAZEBO_MOUSEEVENT_HH_
19 
20 #include <ignition/math/Vector2.hh>
21 #include "gazebo/util/system.hh"
22 
23 namespace gazebo
24 {
25  namespace common
26  {
28  class MouseEventPrivate;
29 
32 
36  {
38  public: enum MouseButton
39  {
41  NO_BUTTON = 0x0,
42 
44  LEFT = 0x1,
45 
47  MIDDLE = 0x2,
48 
50  RIGHT = 0x4
51  };
52 
54  public: enum EventType
55  {
58 
61 
64 
67 
69  SCROLL
70  };
71 
73  public: MouseEvent();
74 
76  public: virtual ~MouseEvent();
77 
80  public: ignition::math::Vector2i Pos() const;
81 
84  public: void SetPos(const ignition::math::Vector2i &_pos);
85 
89  public: void SetPos(const int _x, const int _y);
90 
93  public: ignition::math::Vector2i PrevPos() const;
94 
97  public: void SetPrevPos(const ignition::math::Vector2i &_pos);
98 
102  public: void SetPrevPos(const int _x, const int _y);
103 
106  public: ignition::math::Vector2i PressPos() const;
107 
110  public: void SetPressPos(const ignition::math::Vector2i &_pos);
111 
115  public: void SetPressPos(const int _x, const int _y);
116 
119  public: ignition::math::Vector2i Scroll() const;
120 
123  public: void SetScroll(const ignition::math::Vector2i &_scroll);
124 
128  public: void SetScroll(const int _x, const int _y);
129 
132  public: float MoveScale() const;
133 
136  public: void SetMoveScale(const float _scale);
137 
141  public: bool Dragging() const;
142 
145  public: void SetDragging(const bool _dragging);
146 
149  public: EventType Type() const;
150 
153  public: void SetType(const EventType _type) const;
154 
157  public: MouseEvent::MouseButton Button() const;
158 
161  public: void SetButton(const MouseEvent::MouseButton _button) const;
162 
166  public: unsigned int Buttons() const;
167 
171  public: void SetButtons(const unsigned int &_buttons);
172 
175  public: bool Shift() const;
176 
179  public: void SetShift(const bool _shift) const;
180 
183  public: bool Alt() const;
184 
187  public: void SetAlt(const bool _alt);
188 
191  public: bool Control() const;
192 
195  public: void SetControl(const bool _control) const;
196 
199  private: MouseEventPrivate *dataPtr;
200  };
202  }
203 }
204 #endif
Move event.
Definition: MouseEvent.hh:60
Generic description of a mouse event.
Definition: MouseEvent.hh:35
MouseButton
Standard mouse buttons enumeration.
Definition: MouseEvent.hh:38
Press event.
Definition: MouseEvent.hh:63
EventType
Mouse event types enumeration.
Definition: MouseEvent.hh:54
#define GZ_COMMON_VISIBLE
Definition: system.hh:91
Release event.
Definition: MouseEvent.hh:66
Definition: MouseEventPrivate.hh:29
No event.
Definition: MouseEvent.hh:57