00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef INSTIGATE_TOOLKIT_MESSAGEBOX
00010 #define INSTIGATE_TOOLKIT_MESSAGEBOX
00011
00022
00023
00024
00025
00026
00027 #include <gtkmm.h>
00028 #include <QMessageBox>
00029
00030
00031
00032 namespace instigate {
00033 namespace toolkit {
00034 class messagebox;
00035 }
00036 }
00037
00057 class instigate::toolkit::messagebox
00058 {
00059 public:
00061 void set_message(const std::string&) throw();
00062
00064 void set_icon(const std::string&) throw();
00065
00067 void set_title(const std::string&) throw();
00068 public:
00077 void add_response(int a, const std::string&, bool t = false) throw();
00078
00079
00081 int get_response() throw();
00082 public:
00084 void run() throw();
00085 private:
00086 void qt_run() throw();
00087 void gtk_run() throw();
00088 void set_qt_message(const std::string&) throw();
00089 void set_gtk_message(const std::string&) throw();
00090 void set_qt_icon(const std::string&) throw();
00091 void set_gtk_icon(const std::string&) throw();
00092 void set_qt_title(const std::string&) throw();
00093 void set_gtk_title(const std::string&) throw();
00094 void add_qt_response(int, const std::string&, bool) throw();
00095 void add_gtk_response(int, const std::string&, bool) throw();
00096 int get_qt_response() throw();
00097 int get_gtk_response() throw();
00098 void collect_qt_standard_icons() throw();
00099 void collect_gtk_standard_icons() throw();
00100 void fill_stock_id() throw();
00101 void create_qt_messagebox() throw();
00102 void create_gtk_messagebox() throw();
00103 private:
00105 typedef std::map<std::string, const std::string> gtk_stock_ids;
00106
00108 typedef std::map<std::string, QMessageBox::Icon >
00109 qt_stock_ids;
00110
00112 typedef std::map<QAbstractButton*, int > qt_answers;
00113 private:
00114 QMessageBox* m_qt_messagebox;
00115 Gtk::Dialog* m_gtk_messagebox;
00116 Gtk::HBox* m_gtk_horizontal_layout;
00117 qt_stock_ids m_qt_standard_icons;
00118 gtk_stock_ids m_gtk_stock_ids;
00119 sigc::connection m_connection;
00120 int m_qt_response;
00121 int m_gtk_response;
00122 bool m_qt_indicate;
00123 bool m_gtk_indicate;
00124 qt_answers m_qt_answers;
00125 public:
00126 messagebox() throw();
00127 ~messagebox() throw();
00128 };
00129
00130 #endif // INSTIGATE_TOOLKIT_MESSAGEBOX