conexus logo

portentry.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2001 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This file is part of the conexus library.                             *
00006  *                                                                         *
00007  *   The conexus library is free software; you can redistribute it and/or  *
00008  *   modify it under the terms of the GNU General Public License           *
00009  *   version 3 as published by the Free Software Foundation.               *
00010  *                                                                         *
00011  *   The conexus library is distributed in the hope that it will be        *
00012  *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty   *
00013  *   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   *
00014  *   General Public License for more details.                              *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU General Public License     *
00017  *   along with this software. If not see <http://www.gnu.org/licenses/>.  *
00018  ***************************************************************************/
00019 #ifndef CONEXUSGTKMMPORTENTRY_H
00020 #define CONEXUSGTKMMPORTENTRY_H
00021 
00022 #include <gtkmm.h>
00023 
00024 #include <conexus.h>
00025 #include <conexus-gtkmm/enums.h>
00026 
00027 namespace Conexus
00028 {
00029   namespace Gtk
00030   {
00031 
00036     class PortEntry : public ::Gtk::VBox
00037     {
00038       public:
00039         PortEntry( unsigned lookup = LOOKUP_IPV4|LOOKUP_IPV6 );
00040         PortEntry( IPAddressInterface* addr, unsigned lookup = LOOKUP_IPV4 );
00041         PortEntry( IPAddressInterface::pointer addr, unsigned lookup = LOOKUP_IPV4 );
00042         PortEntry( IPv4::Address& addr, unsigned lookup = LOOKUP_IPV4 );
00043         PortEntry( IPv6::Address& addr, unsigned lookup = LOOKUP_IPV6 );
00044 
00045         ~PortEntry();
00046 
00047         IPAddressInterface* address();
00048 
00049         void set_address( IPAddressInterface* addr, unsigned lookup = LOOKUP_IPV4 );
00050         void set_address( IPAddressInterface::pointer addr, unsigned lookup = LOOKUP_IPV4 );
00051         void set_address( IPv4::Address& addr, unsigned lookup = LOOKUP_IPV4 );
00052         void set_address( IPv6::Address& addr, unsigned lookup = LOOKUP_IPV6 );
00053 
00054         void unset_address();
00055 
00056         ::Gtk::SpinButton& port_widget();
00057         ::Gtk::Adjustment& port_widget_adjustment();
00058         uint32_t port();
00059         void set_port ( uint32_t p );
00060 
00061         std::string servicename();
00062 
00063         bool is_servicename_label_visible();
00064 
00065         void show_servicename_label ( bool show=true );
00066 
00067         ::Gtk::Button& apply_button();
00068 
00069         bool is_immediate_apply_enabled();
00070 
00071         void enable_immediate_apply( bool enable=true );
00072 
00073         void apply();
00074 
00075       protected:
00076         IPAddressInterface* m_address;
00077         
00078         unsigned m_lookup;
00079         bool m_immediate_apply;
00080 
00081         sigc::connection m_conn_address_port;
00082 
00083         ::Gtk::SpinButton m_port_widget;
00084         sigc::connection m_conn_port_widget_changed;
00085         ::Gtk::Adjustment m_port_widget_adjustment;
00086         ::Gtk::Label m_servicename_label;
00087         ::Gtk::Button m_apply_button;
00088 
00089         virtual void on_controlled_port_changed();
00090 
00091         virtual void on_port_widget_changed();
00092 
00093         void on_spinbutton_text_entry ( const Glib::ustring & text, int * position );
00094         void on_spinbutton_text_delete ( int start, int end );
00095 
00096       private:
00097         void setup_widget();
00098 
00099     };
00100 
00101   }
00102 
00103 }
00104 
00105 #endif

Generated on Wed Jul 8 15:50:08 2009 for conexus by doxygen 1.5.8