MyGUI 3.2.2

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

MyGUI_DDItemInfo.h
Go to the documentation of this file.
1 /*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7 #ifndef MYGUI_ITEM_DROP_INFO_H_
8 #define MYGUI_ITEM_DROP_INFO_H_
9
10 #include "MyGUI_Prerequest.h"
11
12 namespace MyGUI
13 {
14
15 struct MYGUI_EXPORT DDItemState
16 {
17 enum Enum
18 {
19 None,
20 Start,
21 End,
22 Miss,
23 Accept,
24 Refuse
25 };
26
27 DDItemState(Enum _value = None) :
28 mValue(_value)
29 {
30 }
31
32 friend bool operator == (DDItemState const& a, DDItemState const& b)
33 {
34 return a.mValue == b.mValue;
35 }
36
37 friend bool operator != (DDItemState const& a, DDItemState const& b)
38 {
39 return a.mValue != b.mValue;
40 }
41
42 int getValue() const
43 {
44 return mValue;
45 }
46
47 private:
48 Enum mValue;
49 };
50
51 // структура информации об индексах дропа
53 struct MYGUI_EXPORT DDItemInfo
54 {
55 DDItemInfo() :
56 sender(nullptr),
57 sender_index(ITEM_NONE),
58 receiver(nullptr),
59 receiver_index(ITEM_NONE)
60 {
61 }
62
63 DDItemInfo(DDContainer* _sender, size_t _sender_index, DDContainer* _receiver, size_t _receiver_index) :
64 sender(_sender),
65 sender_index(_sender_index),
66 receiver(_receiver),
67 receiver_index(_receiver_index)
68 {
69 }
70
71 void set(DDContainer* _sender, size_t _sender_index, DDContainer* _receiver, size_t _receiver_index)
72 {
73 sender = _sender;
74 sender_index = _sender_index;
75 receiver = _receiver;
76 receiver_index = _receiver_index;
77 }
78
79 void reset()
80 {
81 sender = nullptr;
82 sender_index = ITEM_NONE;
83 receiver = nullptr;
84 receiver_index = ITEM_NONE;
85 }
86
88 DDContainer* sender;
90 size_t sender_index;
91
93 DDContainer* receiver;
95 size_t receiver_index;
96 };
97
98 struct MYGUI_EXPORT DDWidgetState
99 {
100 DDWidgetState(size_t _index) :
101 index(_index),
102 update(true),
103 accept(false),
104 refuse(false)
105 {
106 }
107
109 size_t index;
111 bool update;
113 bool accept;
115 bool refuse;
116 };
117
118 } // namespace MyGUI
119
120 #endif // MYGUI_ITEM_DROP_INFO_H_
MyGUI::FontCodeType::Enum
Enum
Definition: MyGUI_FontData.h:18
MyGUI::DDItemInfo::set
void set(DDContainer *_sender, size_t _sender_index, DDContainer *_receiver, size_t _receiver_index)
Definition: MyGUI_DDItemInfo.h:71
MyGUI::DDItemState::End
Definition: MyGUI_DDItemInfo.h:21
MyGUI_Prerequest.h
MyGUI::DDWidgetState::refuse
bool refuse
Definition: MyGUI_DDItemInfo.h:115
MyGUI::DDItemState::Miss
Definition: MyGUI_DDItemInfo.h:22
MyGUI::DDItemInfo::reset
void reset()
Definition: MyGUI_DDItemInfo.h:79
MyGUI::operator!=
bool operator!=(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition: MyGUI_UString.h:1048
MyGUI::DDItemState
Definition: MyGUI_DDItemInfo.h:15
MyGUI::operator==
bool operator==(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition: MyGUI_UString.h:1045
MyGUI::DDItemState::Start
Definition: MyGUI_DDItemInfo.h:20
MyGUI::ITEM_NONE
const size_t ITEM_NONE
Definition: MyGUI_Macros.h:17
MyGUI::DDWidgetState
Definition: MyGUI_DDItemInfo.h:98
MyGUI::DDWidgetState::DDWidgetState
DDWidgetState(size_t _index)
Definition: MyGUI_DDItemInfo.h:100
nullptr
#define nullptr
Definition: MyGUI_Prerequest.h:29
MyGUI::DDItemState::Enum
Enum
Definition: MyGUI_DDItemInfo.h:17
MyGUI::DDItemInfo::sender_index
size_t sender_index
Definition: MyGUI_DDItemInfo.h:90
MyGUI::DDItemInfo::receiver
DDContainer * receiver
Definition: MyGUI_DDItemInfo.h:93
MyGUI::DDItemInfo
Definition: MyGUI_DDItemInfo.h:53
MyGUI::DDWidgetState::update
bool update
Definition: MyGUI_DDItemInfo.h:111
MyGUI
Definition: MyGUI_ActionController.h:14
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:103
MyGUI::DDItemInfo::DDItemInfo
DDItemInfo(DDContainer *_sender, size_t _sender_index, DDContainer *_receiver, size_t _receiver_index)
Definition: MyGUI_DDItemInfo.h:63
MyGUI::DDItemInfo::receiver_index
size_t receiver_index
Definition: MyGUI_DDItemInfo.h:95
MyGUI::DDItemState::None
Definition: MyGUI_DDItemInfo.h:19
MyGUI::DDContainer
DDContainer properties. DDContainer_skin_childs Skin childs. DDContainer widget description should b...
Definition: MyGUI_DDContainer.h:27
MyGUI::DDItemInfo::sender
DDContainer * sender
Definition: MyGUI_DDItemInfo.h:88
MyGUI::DDItemState::getValue
int getValue() const
Definition: MyGUI_DDItemInfo.h:42
MyGUI::DDItemState::DDItemState
DDItemState(Enum _value=None)
Definition: MyGUI_DDItemInfo.h:27
MyGUI::DDItemInfo::DDItemInfo
DDItemInfo()
Definition: MyGUI_DDItemInfo.h:55
MyGUI::DDWidgetState::index
size_t index
Definition: MyGUI_DDItemInfo.h:109
MyGUI::DDWidgetState::accept
bool accept
Definition: MyGUI_DDItemInfo.h:113
MyGUI::DDItemState::Accept
Definition: MyGUI_DDItemInfo.h:23