portentry.h

00001 /***************************************************************************
00002  *   Copyright (C) 2001 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation version 2.1.                *
00008  *                                                                         *
00009  *   This program is distributed in the hope that it will be useful,       *
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012  *   GNU General Public License for more details.                          *
00013  *                                                                         *
00014  *   You should have received a copy of the GNU Lesser General Public      *
00015  *   License along with this library; if not, write to the                 *
00016  *   Free Software Foundation, Inc.,                                       *
00017  *   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA              *
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

Generated on Sun Mar 11 10:01:08 2007 by  doxygen 1.5.1