FifeGUI 0.2.0
A C++ GUI library designed for games.
fcn::DragEvent Class Reference

#include <dragevent.hpp>

Inheritance diagram for fcn::DragEvent:
fcn::Event

Public Types

enum class  Type : std::uint8_t {
  Enter , Leave , Hover , Drop ,
  Cancel
}

Public Member Functions

 DragEvent (Widget *source, DragPayload const *payload, Type type, int x, int y, int screenX, int screenY)
DragPayload const * getPayload () const
int getScreenX () const
int getScreenY () const
Type getType () const
int getX () const
int getY () const
Public Member Functions inherited from fcn::Event
 Event (Widget *source)
WidgetgetSource () const

Protected Attributes

DragPayload const * mPayload
int mScreenX
int mScreenY
Type mType
int mX
int mY
Protected Attributes inherited from fcn::Event
WidgetmSource {nullptr}

Friends

class DragHandler

Detailed Description

Drag and drop event type container.

Represents drag related events such as entering a widget, hovering, dropping or cancellation.

Definition at line 22 of file dragevent.hpp.

Member Enumeration Documentation

◆ Type

enum class fcn::DragEvent::Type : std::uint8_t
strong

Event for drag and drop actions.

Definition at line 28 of file dragevent.hpp.

Constructor & Destructor Documentation

◆ DragEvent()

fcn::DragEvent::DragEvent ( Widget * source,
DragPayload const * payload,
Type type,
int x,
int y,
int screenX,
int screenY )

Construct a drag event.

Definition at line 15 of file dragevent.cpp.

References fcn::Event::Event(), mPayload, mScreenX, mScreenY, mType, mX, and mY.

Member Function Documentation

◆ getPayload()

DragPayload const * fcn::DragEvent::getPayload ( ) const

Get the payload for this event.

Definition at line 29 of file dragevent.cpp.

References mPayload.

◆ getScreenX()

int fcn::DragEvent::getScreenX ( ) const

Get the X coordinate on the screen.

Definition at line 41 of file dragevent.cpp.

References mScreenX.

◆ getScreenY()

int fcn::DragEvent::getScreenY ( ) const

Get the Y coordinate on the screen.

Definition at line 45 of file dragevent.cpp.

References mScreenY.

◆ getType()

DragEvent::Type fcn::DragEvent::getType ( ) const

Get the event type.

Definition at line 25 of file dragevent.cpp.

References mType.

◆ getX()

int fcn::DragEvent::getX ( ) const

Get the X coordinate relative to the widget.

Definition at line 33 of file dragevent.cpp.

References mX.

◆ getY()

int fcn::DragEvent::getY ( ) const

Get the Y coordinate relative to the widget.

Definition at line 37 of file dragevent.cpp.

References mY.

◆ DragHandler

friend class DragHandler
friend

Definition at line 103 of file dragevent.hpp.

Member Data Documentation

◆ mPayload

DragPayload const* fcn::DragEvent::mPayload
protected

The associated payload for this event.

Definition at line 81 of file dragevent.hpp.

Referenced by DragEvent(), and getPayload().

◆ mScreenX

int fcn::DragEvent::mScreenX
protected

X coordinate on the screen.

Definition at line 96 of file dragevent.hpp.

Referenced by DragEvent(), and getScreenX().

◆ mScreenY

int fcn::DragEvent::mScreenY
protected

Y coordinate on the screen.

Definition at line 101 of file dragevent.hpp.

Referenced by DragEvent(), and getScreenY().

◆ mType

Type fcn::DragEvent::mType
protected

The event type.

Definition at line 76 of file dragevent.hpp.

Referenced by DragEvent(), and getType().

◆ mX

int fcn::DragEvent::mX
protected

X coordinate relative to the widget.

Definition at line 86 of file dragevent.hpp.

Referenced by DragEvent(), and getX().

◆ mY

int fcn::DragEvent::mY
protected

Y coordinate relative to the widget.

Definition at line 91 of file dragevent.hpp.

Referenced by DragEvent(), and getY().


The documentation for this class was generated from the following files: