|
Fawkes API
Fawkes Development Version
|
Abstract base class for widgets that allow to view the detected
services of a certain type. More...
#include <gui_utils/service_model.h>

Classes | |
| struct | ServiceAddedRecord |
| Data structure to hold information about a newly added services. More... | |
| class | ServiceRecord |
| Detects services and manages information about detected services. More... | |
| struct | ServiceRemovedRecord |
| Data structure to hold information about a recently removed services. More... | |
Public Member Functions | |
| ServiceModel (const char *service="_fawkes._tcp") | |
| Constructor. | |
| ServiceModel (fawkes::AvahiThread *avahi_thread) | |
| Constructor. | |
| virtual | ~ServiceModel () |
| Destructor. | |
| Glib::RefPtr< Gtk::ListStore > & | get_list_store () |
| Get a reference to the model. | |
| ServiceRecord & | get_column_record () |
| Access the column record. | |
Public Member Functions inherited from fawkes::ServiceBrowseHandler | |
| virtual | ~ServiceBrowseHandler () |
| Virtual destructor. | |
Protected Member Functions | |
| void | all_for_now () |
| All results have been retrieved. | |
| void | cache_exhausted () |
| Cache exhausted. | |
| void | browse_failed (const char *name, const char *type, const char *domain) |
| Failed to browse for a given service. | |
| void | service_added (const char *name, const char *type, const char *domain, const char *host_name, const struct sockaddr *addr, const socklen_t addr_size, uint16_t port, std::list< std::string > &txt, int flags) |
| A service has been announced on the network. | |
| void | service_removed (const char *name, const char *type, const char *domain) |
| A service has been removed from the network. | |
| virtual void | on_service_added () |
| Signal handler for the service-added signal. | |
| virtual void | on_service_removed () |
| Signal handler for the service-removed signal. | |
Protected Attributes | |
| fawkes::LockQueue < ServiceAddedRecord > | m_added_services |
| Queue that holds the newly added services. | |
| fawkes::LockQueue < ServiceRemovedRecord > | m_removed_services |
| Queue that holds the recently removed services. | |
| Glib::Dispatcher | m_signal_service_added |
| This signal is emitted whenever a new service has been added. | |
| Glib::Dispatcher | m_signal_service_removed |
| This signal is emitted whenever a service is removed. | |
| Glib::RefPtr< Gtk::ListStore > | m_service_list |
| Storage object. | |
| ServiceRecord | m_service_record |
| Column record class. | |
| fawkes::AvahiThread * | m_avahi |
| Avahi thread. | |
Abstract base class for widgets that allow to view the detected
services of a certain type.
Definition at line 34 of file service_model.h.
| ServiceModel::ServiceModel | ( | const char * | service = "_fawkes._tcp" | ) |
Constructor.
| service | the service identifier |
Definition at line 86 of file service_model.cpp.
| ServiceModel::ServiceModel | ( | fawkes::AvahiThread * | avahi_thread | ) |
Constructor.
| avahi_thread | an AvahiThread that already watches for the desired type of services |
Definition at line 104 of file service_model.cpp.
|
virtual |
|
protectedvirtual |
All results have been retrieved.
If you read the DNS-SD specs you will see that there is no explicit "not existent" or "end of records" message - it cannot be. But after some time it is assumed that there are no more records. If that is the case this method is called.
Implements fawkes::ServiceBrowseHandler.
Definition at line 142 of file service_model.cpp.
|
protectedvirtual |
Failed to browse for a given service.
| name | name of the service |
| type | type of the service |
| domain | domain of the service |
Implements fawkes::ServiceBrowseHandler.
Definition at line 152 of file service_model.cpp.
|
protectedvirtual |
Cache exhausted.
Implements fawkes::ServiceBrowseHandler.
Definition at line 147 of file service_model.cpp.
| ServiceModel::ServiceRecord & ServiceModel::get_column_record | ( | ) |
Access the column record.
Definition at line 136 of file service_model.cpp.
Referenced by fawkes::ServiceChooserDialog::get_selected_service(), fawkes::ServiceSelectorCBE::initialize(), fawkes::ServiceSelectorCBE::on_btn_connect_clicked(), and fawkes::ServiceSelectorCBE::on_service_selected().
| Glib::RefPtr< Gtk::ListStore > & ServiceModel::get_list_store | ( | ) |
Get a reference to the model.
Definition at line 127 of file service_model.cpp.
Referenced by fawkes::ServiceSelectorCBE::initialize().
|
protectedvirtual |
Signal handler for the service-added signal.
Definition at line 201 of file service_model.cpp.
References fawkes::ServiceModel::ServiceAddedRecord::domain, fawkes::ServiceModel::ServiceAddedRecord::hostname, fawkes::ServiceModel::ServiceAddedRecord::ipaddr, fawkes::ServiceModel::ServiceAddedRecord::name, fawkes::ServiceModel::ServiceAddedRecord::port, and fawkes::ServiceModel::ServiceAddedRecord::type.
|
protectedvirtual |
Signal handler for the service-removed signal.
Definition at line 226 of file service_model.cpp.
References fawkes::ServiceModel::ServiceRemovedRecord::domain, fawkes::ServiceModel::ServiceRemovedRecord::name, and fawkes::ServiceModel::ServiceRemovedRecord::type.
|
protectedvirtual |
A service has been announced on the network.
| name | name of the service |
| type | type of the service |
| domain | domain of the service |
| host_name | name of the host that provides the service |
| addr | pointer to sockaddr struct of appropriate type for address |
| addr_size | size of addr struct |
| port | port of the service |
| txt | list of txt records. |
| flags | extra flags, see Avahi documentation |
Implements fawkes::ServiceBrowseHandler.
Definition at line 159 of file service_model.cpp.
References fawkes::ServiceModel::ServiceAddedRecord::domain, fawkes::ServiceModel::ServiceAddedRecord::hostname, fawkes::ServiceModel::ServiceAddedRecord::ipaddr, fawkes::ServiceModel::ServiceAddedRecord::name, fawkes::ServiceModel::ServiceAddedRecord::port, and fawkes::ServiceModel::ServiceAddedRecord::type.
|
protectedvirtual |
A service has been removed from the network.
| name | name of the service |
| type | type of the service |
| domain | domain of the service |
Implements fawkes::ServiceBrowseHandler.
Definition at line 185 of file service_model.cpp.
References fawkes::ServiceModel::ServiceRemovedRecord::domain, fawkes::ServiceModel::ServiceRemovedRecord::name, and fawkes::ServiceModel::ServiceRemovedRecord::type.
|
protected |
Queue that holds the newly added services.
Definition at line 103 of file service_model.h.
|
protected |
Avahi thread.
Definition at line 115 of file service_model.h.
|
protected |
Queue that holds the recently removed services.
Definition at line 104 of file service_model.h.
|
protected |
Storage object.
Definition at line 112 of file service_model.h.
|
protected |
Column record class.
Definition at line 113 of file service_model.h.
|
protected |
This signal is emitted whenever a new service has been added.
Definition at line 106 of file service_model.h.
|
protected |
This signal is emitted whenever a service is removed.
Definition at line 107 of file service_model.h.