00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CONEXUSMMHOSTENTRY_H
00020 #define CONEXUSMMHOSTENTRY_H
00021
00022 #include <string>
00023 #include <gtkmm.h>
00024 #include <conexus/conexus.h>
00025
00026 #include <conexusmm/addresscontainer.h>
00027
00028 namespace ConexusGtk {
00029
00035 class HostEntry : public AddressContainer, public Gtk::VBox
00036 {
00037 public:
00038 HostEntry(unsigned validate = IPV4|IPV6);
00039 HostEntry(Conexus::IPv4::Address& address, unsigned validate = IPV4);
00040 HostEntry(Conexus::IPv6::Address& address, unsigned validate = IPV6);
00041
00042 ~HostEntry();
00043
00044 void set_hostname(std::string s);
00045
00046 Gtk::ComboBoxEntryText& get_hostname_box();
00047 Gtk::Image& get_good_hostname_image();
00048 Gtk::Image& get_bad_hostname_image();
00049
00050 std::string get_hostname();
00051 sigc::signal<void, bool> signal_host_changed();
00052
00053 bool get_show_hostname_label();
00054 bool get_show_address_label();
00055 bool get_show_host_image();
00056
00057 void set_show_hostname_label(bool show=true);
00058 void set_show_address_label(bool show=true);
00059 void set_show_host_image(bool show=true);
00060
00061 protected:
00062 bool m_change_lock;
00063 std::set<std::string> m_host_names;
00064 sigc::connection m_address_connection;
00065
00066 Gtk::Label m_hostname_label;
00067 Gtk::Label m_address_label;
00068 Gtk::ComboBoxEntryText m_host;
00069 Gtk::EventBox m_image_holder;
00070 Gtk::Image m_good_host_image;
00071 Gtk::Image m_bad_host_image;
00072
00073 sigc::signal<void, bool> m_signal_host_changed;
00074
00075 virtual void on_hostname_changed();
00076
00077 virtual void on_connect(Conexus::IPv4::Address& address);
00078 virtual void on_connect(Conexus::IPv6::Address& address);
00079
00080 virtual void on_validate_type_changed();
00081
00082
00083 private:
00084 void setup_widget();
00085
00086 };
00087
00088 }
00089
00090 #endif