MyGUI  3.4.0
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 
13 namespace MyGUI
14 {
15 
17  {
18  enum Enum
19  {
22  End,
23  Miss,
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 
91  size_t sender_index;
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_
MyGUI::FontCodeType::Enum
Enum
Definition: MyGUI_FontData.h:20
MyGUI::DDWidgetState::DDWidgetState
DDWidgetState(size_t _index)
Definition: MyGUI_DDItemInfo.h:101
MyGUI::DDItemInfo::sender_index
size_t sender_index
Definition: MyGUI_DDItemInfo.h:91
MyGUI::DDItemState
Definition: MyGUI_DDItemInfo.h:17
MyGUI::DDItemInfo::set
void set(DDContainer *_sender, size_t _sender_index, DDContainer *_receiver, size_t _receiver_index)
Definition: MyGUI_DDItemInfo.h:72
MyGUI::DDItemInfo::DDItemInfo
DDItemInfo(DDContainer *_sender, size_t _sender_index, DDContainer *_receiver, size_t _receiver_index)
Definition: MyGUI_DDItemInfo.h:64
MyGUI::DDItemState::Enum
Enum
Definition: MyGUI_DDItemInfo.h:19
MyGUI::DDItemInfo::reset
void reset()
Definition: MyGUI_DDItemInfo.h:80
MyGUI::DDItemInfo::receiver_index
size_t receiver_index
Definition: MyGUI_DDItemInfo.h:96
MyGUI::ITEM_NONE
const size_t ITEM_NONE
Definition: MyGUI_Macros.h:17
MyGUI::DDItemState::Miss
@ Miss
Definition: MyGUI_DDItemInfo.h:23
MyGUI::DDItemState::getValue
int getValue() const
Definition: MyGUI_DDItemInfo.h:43
MyGUI::operator!=
bool operator!=(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition: MyGUI_UString.h:1054
MyGUI::DDWidgetState::index
size_t index
Definition: MyGUI_DDItemInfo.h:110
MyGUI::DDItemInfo::receiver
DDContainer * receiver
Definition: MyGUI_DDItemInfo.h:94
MyGUI::DDItemInfo
Definition: MyGUI_DDItemInfo.h:55
MyGUI_Prerequest.h
MyGUI::DDWidgetState
Definition: MyGUI_DDItemInfo.h:100
MyGUI::DDItemInfo::DDItemInfo
DDItemInfo()
Definition: MyGUI_DDItemInfo.h:56
MyGUI::DDWidgetState::update
bool update
Definition: MyGUI_DDItemInfo.h:112
MyGUI::DDItemState::DDItemState
DDItemState(Enum _value=None)
Definition: MyGUI_DDItemInfo.h:28
MyGUI::DDWidgetState::refuse
bool refuse
Definition: MyGUI_DDItemInfo.h:116
MyGUI::DDItemState::Start
@ Start
Definition: MyGUI_DDItemInfo.h:21
MyGUI::DDItemState::Accept
@ Accept
Definition: MyGUI_DDItemInfo.h:24
MyGUI::DDItemState::None
@ None
Definition: MyGUI_DDItemInfo.h:20
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:89
MyGUI::DDContainer
DDContainer properties. Skin childs. DDContainer widget description should be here.
Definition: MyGUI_DDContainer.h:29
MyGUI::DDItemInfo::sender
DDContainer * sender
Definition: MyGUI_DDItemInfo.h:89
MyGUI_Macros.h
MyGUI::DDWidgetState::accept
bool accept
Definition: MyGUI_DDItemInfo.h:114
MyGUI
Definition: MyGUI_ActionController.h:15
MyGUI::DDItemState::End
@ End
Definition: MyGUI_DDItemInfo.h:22
MyGUI::operator==
bool operator==(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition: MyGUI_UString.h:1051