MyGUI 3.2.0

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

- File List
- Globals

MyGUI_DDItemInfo.h
Go to the documentation of this file.
1
6 /*
7 This file is part of MyGUI.
8
9 MyGUI is free software: you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 MyGUI is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_ITEM_DROP_INFO_H__
23 #define __MYGUI_ITEM_DROP_INFO_H__
24
25 #include "MyGUI_Prerequest.h"
26
27 namespace MyGUI
28 {
29
30 struct MYGUI_EXPORT DDItemState
31 {
32 enum Enum
33 {
34 None,
35 Start,
36 End,
37 Miss,
38 Accept,
39 Refuse
40 };
41
42 DDItemState(Enum _value = None) :
43 value(_value)
44 {
45 }
46
47 friend bool operator == (DDItemState const& a, DDItemState const& b)
48 {
49 return a.value == b.value;
50 }
51
52 friend bool operator != (DDItemState const& a, DDItemState const& b)
53 {
54 return a.value != b.value;
55 }
56
57 private:
58 Enum value;
59 };
60
61 // структура информации об индексах дропа
63 struct MYGUI_EXPORT DDItemInfo
64 {
65 DDItemInfo() :
66 sender(nullptr),
67 sender_index(ITEM_NONE),
68 receiver(nullptr),
69 receiver_index(ITEM_NONE)
70 {
71 }
72
73 DDItemInfo(DDContainer* _sender, size_t _sender_index, DDContainer* _receiver, size_t _receiver_index) :
74 sender(_sender),
75 sender_index(_sender_index),
76 receiver(_receiver),
77 receiver_index(_receiver_index)
78 {
79 }
80
81 void set(DDContainer* _sender, size_t _sender_index, DDContainer* _receiver, size_t _receiver_index)
82 {
83 sender = _sender;
84 sender_index = _sender_index;
85 receiver = _receiver;
86 receiver_index = _receiver_index;
87 }
88
89 void reset()
90 {
91 sender = nullptr;
92 sender_index = ITEM_NONE;
93 receiver = nullptr;
94 receiver_index = ITEM_NONE;
95 }
96
98 DDContainer* sender;
100 size_t sender_index;
101
103 DDContainer* receiver;
105 size_t receiver_index;
106 };
107
108 struct MYGUI_EXPORT DDWidgetState
109 {
110 DDWidgetState(size_t _index) :
111 index(_index),
112 update(true),
113 accept(false),
114 refuse(false)
115 {
116 }
117
119 size_t index;
121 bool update;
123 bool accept;
125 bool refuse;
126 };
127
128 } // namespace MyGUI
129
130 #endif // __MYGUI_ITEM_DROP_INFO_H__
MyGUI::FontCodeType::Enum
Enum
Definition: MyGUI_FontData.h:33
MyGUI::DDItemInfo::set
void set(DDContainer *_sender, size_t _sender_index, DDContainer *_receiver, size_t _receiver_index)
Definition: MyGUI_DDItemInfo.h:81
MyGUI::DDItemState::End
Definition: MyGUI_DDItemInfo.h:36
MyGUI_Prerequest.h
MyGUI::DDWidgetState::refuse
bool refuse
Definition: MyGUI_DDItemInfo.h:125
MyGUI::DDItemState::Miss
Definition: MyGUI_DDItemInfo.h:37
MyGUI::DDItemInfo::reset
void reset()
Definition: MyGUI_DDItemInfo.h:89
MyGUI::operator!=
bool operator!=(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition: MyGUI_UString.h:1049
MyGUI::DDItemState
Definition: MyGUI_DDItemInfo.h:30
MyGUI::operator==
bool operator==(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition: MyGUI_UString.h:1046
MyGUI::DDItemState::Start
Definition: MyGUI_DDItemInfo.h:35
MyGUI::ITEM_NONE
const size_t ITEM_NONE
Definition: MyGUI_Macros.h:32
MyGUI::DDWidgetState
Definition: MyGUI_DDItemInfo.h:108
MyGUI::DDWidgetState::DDWidgetState
DDWidgetState(size_t _index)
Definition: MyGUI_DDItemInfo.h:110
nullptr
#define nullptr
Definition: MyGUI_Prerequest.h:47
MyGUI::DDItemState::Enum
Enum
Definition: MyGUI_DDItemInfo.h:32
MyGUI::DDItemInfo::sender_index
size_t sender_index
Definition: MyGUI_DDItemInfo.h:100
MyGUI::DDItemInfo::receiver
DDContainer * receiver
Definition: MyGUI_DDItemInfo.h:103
MyGUI::DDItemInfo
Definition: MyGUI_DDItemInfo.h:63
MyGUI::DDWidgetState::update
bool update
Definition: MyGUI_DDItemInfo.h:121
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:120
MyGUI::DDItemInfo::DDItemInfo
DDItemInfo(DDContainer *_sender, size_t _sender_index, DDContainer *_receiver, size_t _receiver_index)
Definition: MyGUI_DDItemInfo.h:73
MyGUI::DDItemInfo::receiver_index
size_t receiver_index
Definition: MyGUI_DDItemInfo.h:105
MyGUI::DDItemState::None
Definition: MyGUI_DDItemInfo.h:34
MyGUI::DDContainer
Definition: MyGUI_DDContainer.h:39
MyGUI::DDItemInfo::sender
DDContainer * sender
Definition: MyGUI_DDItemInfo.h:98
MyGUI::DDItemState::DDItemState
DDItemState(Enum _value=None)
Definition: MyGUI_DDItemInfo.h:42
MyGUI::DDItemInfo::DDItemInfo
DDItemInfo()
Definition: MyGUI_DDItemInfo.h:65
MyGUI::DDWidgetState::index
size_t index
Definition: MyGUI_DDItemInfo.h:119
MyGUI::DDWidgetState::accept
bool accept
Definition: MyGUI_DDItemInfo.h:123
MyGUI::DDItemState::Accept
Definition: MyGUI_DDItemInfo.h:38