Gorgon Game Engine
DragInfo Class Reference

Contains information about a drag operation. More...

Public Member Functions

 DragInfo ()
 Constructor, requires the source for drag operation. More...
 
 DragInfo (DragSource &source)
 Constructor, requires the source for drag operation. More...
 
 ~DragInfo ()
 Destructor. More...
 
void AddData (ExchangeData &data)
 Adds data to this info object, ownership of the data is not transfered. More...
 
void AddFileData (const std::string &text)
 Adds file data to this info object. More...
 
void AddTextData (const std::string &text)
 Adds text data to this info object. More...
 
void AssumeData (ExchangeData &data)
 Adds data to this info object, ownership of the data is transfered. More...
 
Containers::Collection< ExchangeData >::Iterator begin ()
 For range based iteration. More...
 
void DataReady ()
 Marks drag data as ready. More...
 
Containers::Collection< ExchangeData >::Iterator end ()
 For range based iteration. More...
 
ExchangeDataGetData (Resource::GID::Type type) const
 Returns the data associated with the given type, throws runtime_error if data does not exists. More...
 
int GetSize () const
 Returns the number of data stored in this object. More...
 
DragSourceGetSource () const
 Returns the drag source. More...
 
DropTargetGetTarget () const
 Returns the target of the drag operation. More...
 
bool HasData (Resource::GID::Type type) const
 Check whether this drag info has the given data. More...
 
bool HasSource () const
 Whether this object has a source. More...
 
bool HasTarget () const
 If this drag operation has a target. More...
 
bool IsDataReady () const
 Check wheather the drag data is ready. More...
 
bool IsFromOS ()
 Returns whether the DnD operation is coming from OS. More...
 
void MarkAsOS ()
 Marks this DnD operation coming from OS. More...
 
ExchangeDataoperator[] (int ind) const
 Returns the data at the given index. More...
 
void RemoveTarget ()
 Removes the target of the drag operation. More...
 
void SetTarget (DropTarget &value)
 Sets the target of the drag operation. More...
 

Detailed Description

Contains information about a drag operation.

Drag operations can contain multiple data types. DragSource is necessary for event handling, if the source events are not required source can be left empty.

Constructor & Destructor Documentation

◆ DragInfo() [1/2]

DragInfo ( DragSource source)
explicit

Constructor, requires the source for drag operation.

◆ DragInfo() [2/2]

DragInfo ( )

Constructor, requires the source for drag operation.

◆ ~DragInfo()

~DragInfo ( )

Destructor.

Member Function Documentation

◆ AddData()

void AddData ( ExchangeData data)

Adds data to this info object, ownership of the data is not transfered.

◆ AddFileData()

void AddFileData ( const std::string &  text)

Adds file data to this info object.

References DragInfo::AssumeData().

◆ AddTextData()

void AddTextData ( const std::string &  text)

Adds text data to this info object.

References DragInfo::AssumeData().

◆ AssumeData()

void AssumeData ( ExchangeData data)

Adds data to this info object, ownership of the data is transfered.

◆ begin()

Containers::Collection<ExchangeData>::Iterator begin ( )

For range based iteration.

◆ DataReady()

void DataReady ( )

Marks drag data as ready.

◆ end()

For range based iteration.

◆ GetData()

ExchangeData & GetData ( Resource::GID::Type  type) const

Returns the data associated with the given type, throws runtime_error if data does not exists.

◆ GetSize()

int GetSize ( ) const

Returns the number of data stored in this object.

◆ GetSource()

DragSource& GetSource ( ) const

Returns the drag source.

Throws runtime_error if source does not exists

◆ GetTarget()

DropTarget& GetTarget ( ) const

Returns the target of the drag operation.

The target should accept drag over event for it to be registered. Throws runtime_error if target does not exists

◆ HasData()

bool HasData ( Resource::GID::Type  type) const

Check whether this drag info has the given data.

◆ HasSource()

bool HasSource ( ) const

Whether this object has a source.

◆ HasTarget()

bool HasTarget ( ) const

If this drag operation has a target.

The target should accept drag over event for it to be registered

◆ IsDataReady()

bool IsDataReady ( ) const

Check wheather the drag data is ready.

◆ IsFromOS()

bool IsFromOS ( )

Returns whether the DnD operation is coming from OS.

◆ MarkAsOS()

void MarkAsOS ( )

Marks this DnD operation coming from OS.

◆ operator[]()

ExchangeData& operator[] ( int  ind) const

Returns the data at the given index.

◆ RemoveTarget()

void RemoveTarget ( )

Removes the target of the drag operation.

This function is automatically called. Manually calling this function might have unintended consequences.

◆ SetTarget()

void SetTarget ( DropTarget value)

Sets the target of the drag operation.

This function is automatically called. Manually calling this function might have unintended consequences.


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