00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CONEXUSMMPORTENTRY_H
00020 #define CONEXUSMMPORTENTRY_H
00021
00022 #include <gtkmm.h>
00023 #include <conexus.h>
00024
00025 #include <conexusmm/addresscontainer.h>
00026
00027 namespace ConexusGtk {
00028
00033 class PortEntry : public AddressContainer, public Gtk::VBox
00034 {
00035 public:
00036 PortEntry(unsigned validate = IPV4|IPV6);
00037 PortEntry(Conexus::IPv4::Address& addr, unsigned validate = IPV4);
00038 PortEntry(Conexus::IPv6::Address& addr, unsigned validate = IPV6);
00039
00040 ~PortEntry();
00041
00042 Gtk::SpinButton& get_port_button();
00043 Gtk::Adjustment& get_port_adjustment();
00044
00045 uint32_t get_port();
00046 void set_port(uint32_t p);
00047
00048 sigc::signal<void> signal_port_changed();
00049
00050 bool get_show_servicename_label();
00051
00052 void set_show_servicename_label(bool show=true);
00053
00054 protected:
00055 sigc::signal<void> m_signal_port_changed;
00056
00057 Gtk::SpinButton m_port;
00058 Gtk::Adjustment m_port_adjustment;
00059 Gtk::Label m_servicename_label;
00060
00061 virtual void on_port_changed();
00062
00063 void on_spinbutton_text_entry( const Glib::ustring & text, int * position );
00064 void on_spinbutton_text_delete(int start, int end);
00065
00066 virtual void on_connect(Conexus::IPv4::Address& address);
00067 virtual void on_connect(Conexus::IPv6::Address& address);
00068
00069 virtual void on_validate_type_changed();
00070
00071 private:
00072 void setup_widget();
00073
00074 };
00075
00076 }
00077
00078 #endif