![]() |
Gorgon Game Engine
|
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... | |
| ExchangeData & | GetData (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... | |
| DragSource & | GetSource () const |
| Returns the drag source. More... | |
| DropTarget & | GetTarget () 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... | |
| ExchangeData & | operator[] (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... | |
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.
|
explicit |
Constructor, requires the source for drag operation.
| DragInfo | ( | ) |
Constructor, requires the source for drag operation.
| ~DragInfo | ( | ) |
Destructor.
| void AddData | ( | ExchangeData & | data | ) |
Adds data to this info object, ownership of the data is not transfered.
| void AddFileData | ( | const std::string & | text | ) |
Adds file data to this info object.
References DragInfo::AssumeData().
| void AddTextData | ( | const std::string & | text | ) |
Adds text data to this info object.
References DragInfo::AssumeData().
| void AssumeData | ( | ExchangeData & | data | ) |
Adds data to this info object, ownership of the data is transfered.
| Containers::Collection<ExchangeData>::Iterator begin | ( | ) |
For range based iteration.
| void DataReady | ( | ) |
Marks drag data as ready.
| Containers::Collection<ExchangeData>::Iterator end | ( | ) |
For range based iteration.
| ExchangeData & GetData | ( | Resource::GID::Type | type | ) | const |
Returns the data associated with the given type, throws runtime_error if data does not exists.
| int GetSize | ( | ) | const |
Returns the number of data stored in this object.
| DragSource& GetSource | ( | ) | const |
Returns the drag source.
Throws runtime_error if source does not exists
| 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
| bool HasData | ( | Resource::GID::Type | type | ) | const |
Check whether this drag info has the given data.
| bool HasSource | ( | ) | const |
Whether this object has a source.
| bool HasTarget | ( | ) | const |
If this drag operation has a target.
The target should accept drag over event for it to be registered
| bool IsDataReady | ( | ) | const |
Check wheather the drag data is ready.
| bool IsFromOS | ( | ) |
Returns whether the DnD operation is coming from OS.
| void MarkAsOS | ( | ) |
Marks this DnD operation coming from OS.
| ExchangeData& operator[] | ( | int | ind | ) | const |
Returns the data at the given index.
| void RemoveTarget | ( | ) |
Removes the target of the drag operation.
This function is automatically called. Manually calling this function might have unintended consequences.
| void SetTarget | ( | DropTarget & | value | ) |
Sets the target of the drag operation.
This function is automatically called. Manually calling this function might have unintended consequences.