1 /*!
2 	@file
3 	@author		Albert Semenov
4 	@date		10/2010
5 */
6 #ifndef __MESSAGE_BOX_STYLE_H__
7 #define __MESSAGE_BOX_STYLE_H__
8 #include <vector>
9 #include <cstddef>
10 //#include <MyGUI_Prerequest.h>
11 
12 
13 namespace MyGUI
14 {
15 
16 	struct MessageBoxStyle
17 	{
18 			#define MYGUI_FLAG_NONE  0
19 			#define MYGUI_FLAG(num)  (1<<(num))
20 		enum Enum
21 		{
22 			None = MYGUI_FLAG_NONE,
23 			Ok = MYGUI_FLAG(0),
24 			Yes = MYGUI_FLAG(1),
25 			No = MYGUI_FLAG(2),
26 			Abort = MYGUI_FLAG(3),
27 			Retry = MYGUI_FLAG(4),
28 			Ignore = MYGUI_FLAG(5),
29 			Cancel = MYGUI_FLAG(6),
30 			Try = MYGUI_FLAG(7),
31 			Continue = MYGUI_FLAG(8),
32 
33 			_IndexUserButton1 = 9, // индекс первой кнопки юзера
34 
35 			Button1 = MYGUI_FLAG(_IndexUserButton1),
36 			Button2 = MYGUI_FLAG(_IndexUserButton1 + 1),
37 			Button3 = MYGUI_FLAG(_IndexUserButton1 + 2),
38 			Button4 = MYGUI_FLAG(_IndexUserButton1 + 3),
39 
40 			_CountUserButtons = 4, // колличество кнопок юзера
41 			_IndexIcon1 = _IndexUserButton1 + _CountUserButtons, // индекс первой иконки
42 
43 			IconDefault = MYGUI_FLAG(_IndexIcon1),
44 
45 			IconInfo = MYGUI_FLAG(_IndexIcon1),
46 			IconQuest = MYGUI_FLAG(_IndexIcon1 + 1),
47 			IconError = MYGUI_FLAG(_IndexIcon1 + 2),
48 			IconWarning = MYGUI_FLAG(_IndexIcon1 + 3),
49 
50 			Icon1 = MYGUI_FLAG(_IndexIcon1),
51 			Icon2 = MYGUI_FLAG(_IndexIcon1 + 1),
52 			Icon3 = MYGUI_FLAG(_IndexIcon1 + 2),
53 			Icon4 = MYGUI_FLAG(_IndexIcon1 + 3),
54 			Icon5 = MYGUI_FLAG(_IndexIcon1 + 4),
55 			Icon6 = MYGUI_FLAG(_IndexIcon1 + 5),
56 			Icon7 = MYGUI_FLAG(_IndexIcon1 + 6),
57 			Icon8 = MYGUI_FLAG(_IndexIcon1 + 7)
58 		};
59 
60 		MessageBoxStyle(Enum _value = None) :
valueMessageBoxStyle61 			value(_value)
62 		{	}
63 
64 		MessageBoxStyle& operator |= (MessageBoxStyle const& _other)
65 		{
66 			value = Enum(int(value) | int(_other.value));
67 			return *this;
68 		}
69 
70 		friend MessageBoxStyle operator | (Enum const& a, Enum const& b)
71 		{
72 			return MessageBoxStyle(Enum(int(a) | int(b)));
73 		}
74 
75 		MessageBoxStyle operator | (Enum const& a)
76 		{
77 			return MessageBoxStyle(Enum(int(value) | int(a)));
78 		}
79 
80 		friend bool operator == (MessageBoxStyle const& a, MessageBoxStyle const& b)
81 		{
82 			return a.value == b.value;
83 		}
84 
85 		friend bool operator != (MessageBoxStyle const& a, MessageBoxStyle const& b)
86 		{
87 			return a.value != b.value;
88 		}
89 
90 		/*friend std::ostream& operator << (std::ostream& _stream, const MessageBoxStyle&  _value)
91 		{
92 			//_stream << _value.print();
93 			return _stream;
94 		}
95 
96 		friend std::istream& operator >> (std::istream& _stream, MessageBoxStyle&  _value)
97 		{
98 			std::string value;
99 			_stream >> value;
100 			_value = parse(value);
101 			return _stream;
102 		}*/
103 
104 		size_t getIconIndex();
105 
106 		size_t getButtonIndex();
107 
108 		std::vector<MessageBoxStyle> getButtons();
109 
110 		//typedef std::map<std::string, int> MapAlign;
111 
112 		//static MessageBoxStyle parse(const std::string& _value);
113 
114 	//private:
115 		//const MapAlign& getValueNames();
116 
117 	private:
118 		Enum value;
119 	};
120 
121 } // namespace MyGUI
122 
123 #endif // __MESSAGE_BOX_STYLE_H__
124