service_selector_cbe.h
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 #include <libglademm/xml.h>
00032
00033 namespace fawkes {
00034 #if 0
00035 }
00036 #endif
00037
00038 class FawkesNetworkClient;
00039 class ServiceModel;
00040 class ConnectionDispatcher;
00041
00042 class ServiceSelectorCBE
00043 {
00044 public:
00045 ServiceSelectorCBE( Gtk::ComboBoxEntry* services,
00046 Gtk::Button* connect,
00047 Gtk::Window* parent,
00048 const char* service = "_fawkes._tcp" );
00049 ServiceSelectorCBE( Gtk::ComboBoxEntry* services,
00050 Gtk::ToolButton* connect,
00051 Gtk::Window* parent,
00052 const char* service = "_fawkes._tcp" );
00053 ServiceSelectorCBE( Glib::RefPtr<Gnome::Glade::Xml> ref_xml,
00054 const char* cbe_name = "cbeServices",
00055 const char* btn_name = "btnConnect",
00056 const char* wnd_name = "wndMain",
00057 const char* service = "_fawkes._tcp" );
00058 virtual ~ServiceSelectorCBE();
00059
00060 FawkesNetworkClient* get_network_client();
00061 Glib::ustring get_hostname();
00062 Glib::ustring get_name();
00063 unsigned int get_port();
00064
00065 sigc::signal<void> signal_connected();
00066 sigc::signal<void> signal_disconnected();
00067
00068 protected:
00069 void initialize();
00070 void on_btn_connect_clicked();
00071 void on_service_selected();
00072 void on_connected();
00073 void on_disconnected();
00074
00075 protected:
00076 Gtk::ComboBoxEntry *m_cbe_services;
00077 Gtk::Button *m_btn_connect;
00078 Gtk::ToolButton *m_tbtn_connect;
00079 Gtk::Window *m_parent;
00080
00081 ConnectionDispatcher *m_dispatcher;
00082 ServiceModel *m_service_model;
00083
00084 private:
00085 Glib::ustring __hostname;
00086 Glib::ustring __servicename;
00087 unsigned short __port;
00088 };
00089
00090 }
00091 #endif