LeaveEvent.h
1 /* Copyright (C) 2015 Laurentiu-Gheorghe Crisan
2 
3  This library is free software; you can redistribute it and/or
4  modify it under the terms of the GNU Lesser General Public
5  License as published by the Free Software Foundation; either
6  version 2.1 of the License, or (at your option) any later version.
7 
8  As a special exception, you may use this file as part of a free
9  software library without restriction. Specifically, if other files
10  instantiate templates or use macros or inline functions from this
11  file, or you compile this file and link it with other files to
12  produce an executable, this file does not by itself cause the
13  resulting executable to be covered by the GNU General Public
14  License. This exception does not however invalidate any other
15  reasons why the executable file might be covered by the GNU Library
16  General Public License.
17 
18  This library is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  Lesser General Public License for more details.
22 
23  You should have received a copy of the GNU Lesser General Public
24  License along with this library; if not, write to the Free Software
25  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26  02110-1301 USA
27 */
28 
29 #ifndef Pt_Forms_LeaveEvent_h
30 #define Pt_Forms_LeaveEvent_h
31 
32 #include <Pt/Forms/Api.h>
33 #include <Pt/Forms/Widget.h>
34 #include <Pt/Types.h>
35 #include <Pt/Event.h>
36 
37 namespace Pt {
38 
39 namespace Forms {
40 
48 class PT_FORMS_API LeaveEvent : public Pt::BasicEvent<LeaveEvent>
49 {
50  public:
53  LeaveEvent(Widget& widget)
54  : _widgetId_( widget.id() )
55  , _widget(&widget)
56  , _reserved0(0)
57  , _reserved1(0)
58  {
59  }
60 
63  virtual ~LeaveEvent()
64  {
65  }
66 
70  {
71  return _widgetId_;
72  }
73 
76  Widget* widget() const
77  {
78  return _widget;
79  }
80 
83  void* r0()
84  { return _reserved0; }
85 
89  { return _reserved1; }
90 
91  private:
92  Pt::uint64_t _widgetId_;
93  Widget* _widget;
94  void* _reserved0;
95  Pt::uint64_t _reserved1;
96 };
97 
98 } // namespace
99 
100 } // namespace
101 
102 #endif
Core module.
Definition: Allocator.h:33
void * r0()
Returns reserved extension storage.
Definition: LeaveEvent.h:83
Common type of every visual Forms object.
Definition: Widget.h:105
Pt::uint64_t widgetId() const
Returns the ID of the widget that lost the pointer.
Definition: LeaveEvent.h:69
Pt::uint64_t r1()
Returns reserved extension storage.
Definition: LeaveEvent.h:88
Widget * widget() const
Returns the widget that lost the pointer.
Definition: LeaveEvent.h:76
LeaveEvent(Widget &widget)
Creates an event for pointer departure from widget.
Definition: LeaveEvent.h:53
Pointer left a widget.
Definition: LeaveEvent.h:49
virtual ~LeaveEvent()
Destructor.
Definition: LeaveEvent.h:63
uint_type uint64_t
Unsigned 64-bit integer type.
Definition: Api-Types.h:62