00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __LIBS_GUI_UTILS_SERVICE_SELECTOR_CBE_H_
00026 #define __LIBS_GUI_UTILS_SERVICE_SELECTOR_CBE_H_
00027
00028 #include <netcomm/fawkes/client_handler.h>
00029
00030 #include <gtkmm.h>
00031 #ifdef HAVE_GLADEMM
00032 # include <libglademm/xml.h>
00033 #endif
00034
00035 namespace fawkes {
00036 #if 0
00037 }
00038 #endif
00039
00040 class FawkesNetworkClient;
00041 class ServiceModel;
00042 class ConnectionDispatcher;
00043
00044 class ServiceSelectorCBE
00045 {
00046 public:
00047 ServiceSelectorCBE( Gtk::ComboBoxEntry* services,
00048 Gtk::Button* connect,
00049 Gtk::Window* parent,
00050 const char* service = "_fawkes._tcp" );
00051 ServiceSelectorCBE( Gtk::ComboBoxEntry* services,
00052 Gtk::ToolButton* connect,
00053 Gtk::Window* parent,
00054 const char* service = "_fawkes._tcp" );
00055 #ifdef HAVE_GLADEMM
00056 ServiceSelectorCBE( Glib::RefPtr<Gnome::Glade::Xml> ref_xml,
00057 const char* cbe_name = "cbeServices",
00058 const char* btn_name = "btnConnect",
00059 const char* wnd_name = "wndMain",
00060 const char* service = "_fawkes._tcp" );
00061 #endif
00062 virtual ~ServiceSelectorCBE();
00063
00064 FawkesNetworkClient* get_network_client();
00065 Glib::ustring get_hostname();
00066 Glib::ustring get_name();
00067 unsigned int get_port();
00068
00069 sigc::signal<void> signal_connected();
00070 sigc::signal<void> signal_disconnected();
00071
00072 protected:
00073 void initialize();
00074 void on_btn_connect_clicked();
00075 void on_service_selected();
00076 void on_connected();
00077 void on_disconnected();
00078
00079 protected:
00080 Gtk::ComboBoxEntry *m_cbe_services;
00081 Gtk::Button *m_btn_connect;
00082 Gtk::ToolButton *m_tbtn_connect;
00083 Gtk::Window *m_parent;
00084
00085 ConnectionDispatcher *m_dispatcher;
00086 ServiceModel *m_service_model;
00087
00088 private:
00089 Glib::ustring __hostname;
00090 Glib::ustring __servicename;
00091 unsigned short __port;
00092 };
00093
00094 }
00095 #endif