hostentry.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 CONEXUSMMHOSTENTRY_H
00020 #define CONEXUSMMHOSTENTRY_H
00021 
00022 #include <string>
00023 #include <gtkmm.h>
00024 #include <conexus/conexus.h>
00025 
00026 #include <conexusmm/addresscontainer.h>
00027 
00028 namespace ConexusGtk {
00029 
00035 class HostEntry : public AddressContainer, public Gtk::VBox
00036 {
00037 public:
00038     HostEntry(unsigned validate = IPV4|IPV6);
00039     HostEntry(Conexus::IPv4::Address& address, unsigned validate = IPV4);
00040     HostEntry(Conexus::IPv6::Address& address, unsigned validate = IPV6);
00041 
00042     ~HostEntry();
00043 
00044     void set_hostname(std::string s);
00045     
00046     Gtk::ComboBoxEntryText& get_hostname_box();
00047     Gtk::Image& get_good_hostname_image();
00048     Gtk::Image& get_bad_hostname_image();
00049 
00050     std::string get_hostname();
00051     sigc::signal<void, bool> signal_host_changed();
00052     
00053     bool get_show_hostname_label();
00054     bool get_show_address_label();
00055     bool get_show_host_image();
00056     
00057     void set_show_hostname_label(bool show=true);
00058     void set_show_address_label(bool show=true);
00059     void set_show_host_image(bool show=true);
00060 
00061   protected:
00062     bool m_change_lock;
00063     std::set<std::string> m_host_names;
00064     sigc::connection m_address_connection;
00065 
00066     Gtk::Label m_hostname_label;
00067     Gtk::Label m_address_label;
00068     Gtk::ComboBoxEntryText m_host;
00069     Gtk::EventBox m_image_holder;
00070     Gtk::Image m_good_host_image;
00071     Gtk::Image m_bad_host_image;
00072 
00073     sigc::signal<void, bool> m_signal_host_changed;
00074 
00075     virtual void on_hostname_changed();
00076     
00077     virtual void on_connect(Conexus::IPv4::Address& address);
00078     virtual void on_connect(Conexus::IPv6::Address& address);
00079     
00080     virtual void on_validate_type_changed();
00081 
00082 
00083   private:
00084     void setup_widget();
00085 
00086 };
00087 
00088 }
00089 
00090 #endif

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