MyGUI 3.4.1
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#include "MyGUI_Macros.h"
12
13namespace MyGUI
14{
15
17 {
18 enum Enum
19 {
25 Refuse
26 };
27
28 DDItemState(Enum _value = None) :
29 mValue(_value)
30 {
31 }
32
33 friend bool operator == (DDItemState const& a, DDItemState const& b)
34 {
35 return a.mValue == b.mValue;
36 }
37
38 friend bool operator != (DDItemState const& a, DDItemState const& b)
39 {
40 return a.mValue != b.mValue;
41 }
42
43 int getValue() const
44 {
45 return mValue;
46 }
47
48 private:
49 Enum mValue;
50 };
51
52 // структура информации об индексах дропа
55 {
57 sender(nullptr),
58 sender_index(ITEM_NONE),
59 receiver(nullptr),
60 receiver_index(ITEM_NONE)
61 {
62 }
63
64 DDItemInfo(DDContainer* _sender, size_t _sender_index, DDContainer* _receiver, size_t _receiver_index) :
65 sender(_sender),
66 sender_index(_sender_index),
67 receiver(_receiver),
68 receiver_index(_receiver_index)
69 {
70 }
71
72 void set(DDContainer* _sender, size_t _sender_index, DDContainer* _receiver, size_t _receiver_index)
73 {
74 sender = _sender;
75 sender_index = _sender_index;
76 receiver = _receiver;
77 receiver_index = _receiver_index;
78 }
79
80 void reset()
81 {
82 sender = nullptr;
83 sender_index = ITEM_NONE;
84 receiver = nullptr;
85 receiver_index = ITEM_NONE;
86 }
87
92
97 };
98
100 {
101 DDWidgetState(size_t _index) :
102 index(_index),
103 update(true),
104 accept(false),
105 refuse(false)
106 {
107 }
108
110 size_t index;
112 bool update;
114 bool accept;
116 bool refuse;
117 };
118
119} // namespace MyGUI
120
121#endif // MYGUI_ITEM_DROP_INFO_H_
#define MYGUI_EXPORT
widget description should be here.
bool operator==(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
bool operator!=(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
const size_t ITEM_NONE
Definition: MyGUI_Macros.h:17
DDItemInfo(DDContainer *_sender, size_t _sender_index, DDContainer *_receiver, size_t _receiver_index)
DDContainer * sender
DDContainer * receiver
void set(DDContainer *_sender, size_t _sender_index, DDContainer *_receiver, size_t _receiver_index)
DDItemState(Enum _value=None)
DDWidgetState(size_t _index)