MyGUI  3.2.2
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  {
21  End,
22  Miss,
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  {
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 
90  size_t sender_index;
91 
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::DDWidgetState::DDWidgetState
DDWidgetState(size_t _index)
Definition: MyGUI_DDItemInfo.h:100
MyGUI::DDItemInfo::sender_index
size_t sender_index
Definition: MyGUI_DDItemInfo.h:90
MyGUI::DDItemState
Definition: MyGUI_DDItemInfo.h:15
MyGUI::DDItemInfo::set
void set(DDContainer *_sender, size_t _sender_index, DDContainer *_receiver, size_t _receiver_index)
Definition: MyGUI_DDItemInfo.h:71
MyGUI::DDItemInfo::DDItemInfo
DDItemInfo(DDContainer *_sender, size_t _sender_index, DDContainer *_receiver, size_t _receiver_index)
Definition: MyGUI_DDItemInfo.h:63
MyGUI::DDItemState::Enum
Enum
Definition: MyGUI_DDItemInfo.h:17
MyGUI::DDItemInfo::reset
void reset()
Definition: MyGUI_DDItemInfo.h:79
MyGUI::DDItemInfo::receiver_index
size_t receiver_index
Definition: MyGUI_DDItemInfo.h:95
MyGUI::ITEM_NONE
const size_t ITEM_NONE
Definition: MyGUI_Macros.h:17
MyGUI::DDItemState::Miss
@ Miss
Definition: MyGUI_DDItemInfo.h:22
MyGUI::DDItemState::getValue
int getValue() const
Definition: MyGUI_DDItemInfo.h:42
MyGUI::operator!=
bool operator!=(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition: MyGUI_UString.h:1048
MyGUI::DDWidgetState::index
size_t index
Definition: MyGUI_DDItemInfo.h:109
MyGUI::DDItemInfo::receiver
DDContainer * receiver
Definition: MyGUI_DDItemInfo.h:93
MyGUI::DDItemInfo
Definition: MyGUI_DDItemInfo.h:53
MyGUI_Prerequest.h
MyGUI::DDWidgetState
Definition: MyGUI_DDItemInfo.h:98
MyGUI::DDItemInfo::DDItemInfo
DDItemInfo()
Definition: MyGUI_DDItemInfo.h:55
MyGUI::DDWidgetState::update
bool update
Definition: MyGUI_DDItemInfo.h:111
MyGUI::DDItemState::DDItemState
DDItemState(Enum _value=None)
Definition: MyGUI_DDItemInfo.h:27
MyGUI::DDWidgetState::refuse
bool refuse
Definition: MyGUI_DDItemInfo.h:115
nullptr
#define nullptr
Definition: MyGUI_Prerequest.h:29
MyGUI::DDItemState::Start
@ Start
Definition: MyGUI_DDItemInfo.h:20
MyGUI::DDItemState::Accept
@ Accept
Definition: MyGUI_DDItemInfo.h:23
MyGUI::DDItemState::None
@ None
Definition: MyGUI_DDItemInfo.h:19
MyGUI::DDContainer
DDContainer properties. Skin childs. DDContainer widget description should be here.
Definition: MyGUI_DDContainer.h:27
MyGUI::DDItemInfo::sender
DDContainer * sender
Definition: MyGUI_DDItemInfo.h:88
MyGUI::DDWidgetState::accept
bool accept
Definition: MyGUI_DDItemInfo.h:113
MyGUI
Definition: MyGUI_ActionController.h:14
MyGUI::DDItemState::End
@ End
Definition: MyGUI_DDItemInfo.h:21
MyGUI::operator==
bool operator==(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition: MyGUI_UString.h:1045