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

Generated on Sat Aug 26 17:35:29 2006 by  doxygen 1.4.6