Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef GUI_DIALOGS_WML_MESSAGE_HPP_INCLUDED
00017 #define GUI_DIALOGS_WML_MESSAGE_HPP_INCLUDED
00018
00019 #include "gui/dialogs/dialog.hpp"
00020
00021 namespace gui2 {
00022
00023
00024
00025
00026
00027
00028 class twml_message_
00029 : public tdialog
00030 {
00031 public:
00032 twml_message_(const std::string& title, const std::string& message,
00033 const std::string& portrait, const bool mirror)
00034 : title_(title)
00035 , image_("")
00036 , message_(message)
00037 , portrait_(portrait)
00038 , mirror_(mirror)
00039 , has_input_(false)
00040 , input_caption_("")
00041 , input_text_(NULL)
00042 , input_maximum_length_(0)
00043 , option_list_()
00044 , chosen_option_(NULL)
00045 {
00046 }
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 void set_input(const std::string& caption,
00057 std::string* text, const unsigned maximum_length);
00058
00059 void set_option_list(
00060 const std::vector<std::string>& option_list, int* chosen_option);
00061
00062 private:
00063
00064
00065 std::string title_;
00066
00067
00068
00069
00070
00071
00072 std::string image_;
00073
00074
00075 std::string message_;
00076
00077 std::string portrait_;
00078
00079
00080 bool mirror_;
00081
00082
00083 bool has_input_;
00084
00085
00086 std::string input_caption_;
00087
00088
00089 std::string* input_text_;
00090
00091
00092 unsigned input_maximum_length_;
00093
00094
00095 std::vector<std::string> option_list_;
00096
00097
00098 int *chosen_option_;
00099
00100
00101 void pre_show(CVideo& video, twindow& window);
00102
00103
00104 void post_show(twindow& window);
00105 };
00106
00107
00108 class twml_message_left : public twml_message_
00109 {
00110 public:
00111 twml_message_left(const std::string& title, const std::string& message,
00112 const std::string& portrait, const bool mirror)
00113 : twml_message_(title, message, portrait, mirror)
00114 {
00115 }
00116
00117 private:
00118
00119
00120 virtual const std::string& window_id() const;
00121 };
00122
00123
00124 class twml_message_right : public twml_message_
00125 {
00126 public:
00127 twml_message_right(const std::string& title, const std::string& message,
00128 const std::string& portrait, const bool mirror)
00129 : twml_message_(title, message, portrait, mirror)
00130 {
00131 }
00132
00133 private:
00134
00135
00136 virtual const std::string& window_id() const;
00137 };
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164 int show_wml_message(const bool left_side
00165 , CVideo& video
00166 , const std::string& title
00167 , const std::string& message
00168 , const std::string& portrait
00169 , const bool mirror
00170 , const bool has_input
00171 , const std::string& input_caption
00172 , std::string* input_text
00173 , const unsigned maximum_length
00174 , const std::vector<std::string>& option_list
00175 , int* chosen_option);
00176
00177
00178 }
00179
00180 #endif
00181