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 CONEXUSGTKMMHOSTPORTENTRY_H 00020 #define CONEXUSGTKMMHOSTPORTENTRY_H 00021 00022 #include <gtkmm.h> 00023 00024 #include <conexus-gtkmm/hostentry.h> 00025 #include <conexus-gtkmm/portentry.h> 00026 00027 namespace Conexus 00028 { 00029 namespace Gtk 00030 { 00031 00035 class HostPortEntry : public ::Gtk::Table 00036 { 00037 public: 00038 typedef enum Layout { VERTICAL, HORIZONTAL } Layout; 00039 HostPortEntry ( Layout layout = VERTICAL ); 00040 00041 ~HostPortEntry(); 00042 00043 HostEntry& host_entry(); 00044 PortEntry& port_entry(); 00045 00046 std::string hostname(); 00047 void set_hostname ( std::string ); 00048 00049 uint32_t port(); 00050 void set_port ( uint32_t p ); 00051 00052 void connect ( Conexus::IPv4::Address& address ); 00053 void connect ( Conexus::IPv6::Address& address ); 00054 void disconnect ( Conexus::IPv4::Address& address ); 00055 void disconnect ( Conexus::IPv6::Address& address ); 00056 00057 sigc::signal<void, bool> signal_host_changed(); 00058 sigc::signal<void> signal_port_changed(); 00059 00060 Layout layout(); 00061 void set_layout ( Layout layout ); 00062 00063 protected: 00064 HostEntry m_host; 00065 PortEntry m_port; 00066 ::Gtk::Alignment m_host_alignment, m_port_alignment; 00067 Layout m_layout; 00068 00069 void setup_widget(); 00070 }; 00071 00072 } 00073 00074 } 00075 00076 #endif