MyGUI_DDItemInfo.h
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#ifndef MYGUI_ITEM_DROP_INFO_H_
#define MYGUI_ITEM_DROP_INFO_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_Macros.h"
namespace MyGUI
{
struct MYGUI_EXPORT DDItemState
{
enum Enum
{
None,
Start,
End,
Miss,
Accept,
Refuse
};
DDItemState(Enum _value = None) :
mValue(_value)
{
}
friend bool operator==(DDItemState const& a, DDItemState const& b)
{
return a.mValue == b.mValue;
}
friend bool operator!=(DDItemState const& a, DDItemState const& b)
{
return a.mValue != b.mValue;
}
int getValue() const
{
return mValue;
}
private:
Enum mValue;
};
// структура информации об индексах дропа
struct MYGUI_EXPORT DDItemInfo
{
DDItemInfo() :
sender(nullptr),
sender_index(ITEM_NONE),
receiver(nullptr),
receiver_index(ITEM_NONE)
{
}
DDItemInfo(DDContainer* _sender, size_t _sender_index, DDContainer* _receiver, size_t _receiver_index) :
sender(_sender),
sender_index(_sender_index),
receiver(_receiver),
receiver_index(_receiver_index)
{
}
void set(DDContainer* _sender, size_t _sender_index, DDContainer* _receiver, size_t _receiver_index)
{
sender = _sender;
sender_index = _sender_index;
receiver = _receiver;
receiver_index = _receiver_index;
}
void reset()
{
sender = nullptr;
sender_index = ITEM_NONE;
receiver = nullptr;
receiver_index = ITEM_NONE;
}
DDContainer* sender;
size_t sender_index;
DDContainer* receiver;
size_t receiver_index;
};
struct MYGUI_EXPORT DDWidgetState
{
DDWidgetState(size_t _index) :
index(_index)
{
}
size_t index;
bool update{true};
bool accept{false};
bool refuse{false};
};
} // namespace MyGUI
#endif // MYGUI_ITEM_DROP_INFO_H_
MyGUI_Macros.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MyGUI::DDContainer
widget description should be here.
Definition MyGUI_DDContainer.h:31
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::ITEM_NONE
constexpr size_t ITEM_NONE
Definition MyGUI_Macros.h:19
MyGUI::DDItemInfo::DDItemInfo
DDItemInfo(DDContainer *_sender, size_t _sender_index, DDContainer *_receiver, size_t _receiver_index)
Definition MyGUI_DDItemInfo.h:64
MyGUI::DDItemInfo::reset
void reset()
Definition MyGUI_DDItemInfo.h:80
MyGUI::DDItemInfo::sender
DDContainer * sender
Definition MyGUI_DDItemInfo.h:89
MyGUI::DDItemInfo::receiver
DDContainer * receiver
Definition MyGUI_DDItemInfo.h:94
MyGUI::DDItemInfo::DDItemInfo
DDItemInfo()
Definition MyGUI_DDItemInfo.h:56
MyGUI::DDItemInfo::set
void set(DDContainer *_sender, size_t _sender_index, DDContainer *_receiver, size_t _receiver_index)
Definition MyGUI_DDItemInfo.h:72
MyGUI::DDItemInfo::receiver_index
size_t receiver_index
Definition MyGUI_DDItemInfo.h:96
MyGUI::DDItemInfo::sender_index
size_t sender_index
Definition MyGUI_DDItemInfo.h:91
MyGUI::DDItemState::DDItemState
DDItemState(Enum _value=None)
Definition MyGUI_DDItemInfo.h:28
MyGUI::DDItemState::operator!=
friend bool operator!=(DDItemState const &a, DDItemState const &b)
Definition MyGUI_DDItemInfo.h:38
MyGUI::DDItemState::getValue
int getValue() const
Definition MyGUI_DDItemInfo.h:43
MyGUI::DDItemState::Enum
Enum
Definition MyGUI_DDItemInfo.h:19
MyGUI::DDItemState::End
@ End
Definition MyGUI_DDItemInfo.h:22
MyGUI::DDItemState::Accept
@ Accept
Definition MyGUI_DDItemInfo.h:24
MyGUI::DDItemState::None
@ None
Definition MyGUI_DDItemInfo.h:20
MyGUI::DDItemState::Start
@ Start
Definition MyGUI_DDItemInfo.h:21
MyGUI::DDItemState::Refuse
@ Refuse
Definition MyGUI_DDItemInfo.h:25
MyGUI::DDItemState::Miss
@ Miss
Definition MyGUI_DDItemInfo.h:23
MyGUI::DDItemState::operator==
friend bool operator==(DDItemState const &a, DDItemState const &b)
Definition MyGUI_DDItemInfo.h:33
MyGUI::DDWidgetState::update
bool update
Definition MyGUI_DDItemInfo.h:109
MyGUI::DDWidgetState::accept
bool accept
Definition MyGUI_DDItemInfo.h:111
MyGUI::DDWidgetState::refuse
bool refuse
Definition MyGUI_DDItemInfo.h:113
MyGUI::DDWidgetState::DDWidgetState
DDWidgetState(size_t _index)
Definition MyGUI_DDItemInfo.h:101
MyGUI::DDWidgetState::index
size_t index
Definition MyGUI_DDItemInfo.h:107