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. More... | |
ServiceModel (fawkes::AvahiThread *avahi_thread) | |
Constructor. More... | |
virtual | ~ServiceModel () |
Destructor. More... | |
Glib::RefPtr< Gtk::ListStore > & | get_list_store () |
Get a reference to the model. More... | |
ServiceRecord & | get_column_record () |
Access the column record. More... | |
![]() | |
virtual | ~ServiceBrowseHandler () |
Virtual destructor. More... | |
Protected Member Functions | |
void | all_for_now () |
All results have been retrieved. More... | |
void | cache_exhausted () |
Cache exhausted. More... | |
void | browse_failed (const char *name, const char *type, const char *domain) |
Failed to browse for a given service. More... | |
void | service_added (const char *name, const char *type, const char *domain, const char *host_name, const char *interface, 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. More... | |
void | service_removed (const char *name, const char *type, const char *domain) |
A service has been removed from the network. More... | |
virtual void | on_service_added () |
Signal handler for the service-added signal. More... | |
virtual void | on_service_removed () |
Signal handler for the service-removed signal. More... | |
Protected Attributes | |
fawkes::LockQueue< ServiceAddedRecord > | m_added_services |
Queue that holds the newly added services. More... | |
fawkes::LockQueue< ServiceRemovedRecord > | m_removed_services |
Queue that holds the recently removed services. More... | |
Glib::Dispatcher | m_signal_service_added |
This signal is emitted whenever a new service has been added. More... | |
Glib::Dispatcher | m_signal_service_removed |
This signal is emitted whenever a service is removed. More... | |
Glib::RefPtr< Gtk::ListStore > | m_service_list |
Storage object. More... | |
ServiceRecord | m_service_record |
Column record class. More... | |
fawkes::AvahiThread * | m_avahi |
Avahi thread. More... | |
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 88 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 106 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 144 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 154 of file service_model.cpp.
|
protectedvirtual |
Cache exhausted.
Implements fawkes::ServiceBrowseHandler.
Definition at line 149 of file service_model.cpp.
ServiceModel::ServiceRecord & ServiceModel::get_column_record | ( | ) |
Access the column record.
Definition at line 138 of file service_model.cpp.
Referenced by fawkes::ServiceChooserDialog::get_selected_service(), fawkes::ServiceSelectorCBE::initialize(), fawkes::ServiceSelectorCBE::on_btn_connect_clicked(), fawkes::ServiceSelectorCBE::on_service_selected(), and fawkes::ServiceChooserDialog::~ServiceChooserDialog().
Glib::RefPtr< Gtk::ListStore > & ServiceModel::get_list_store | ( | ) |
Get a reference to the model.
Definition at line 129 of file service_model.cpp.
Referenced by fawkes::ServiceSelectorCBE::initialize(), and fawkes::ServiceChooserDialog::~ServiceChooserDialog().
|
protectedvirtual |
Signal handler for the service-added signal.
Definition at line 220 of file service_model.cpp.
References fawkes::ServiceModel::ServiceAddedRecord::addrport, fawkes::ServiceModel::ServiceAddedRecord::domain, fawkes::ServiceModel::ServiceAddedRecord::hostname, fawkes::ServiceModel::ServiceAddedRecord::interface, fawkes::ServiceModel::ServiceAddedRecord::ipaddr, fawkes::ServiceModel::ServiceAddedRecord::name, fawkes::ServiceModel::ServiceAddedRecord::port, fawkes::ServiceModel::ServiceAddedRecord::sockaddr, and fawkes::ServiceModel::ServiceAddedRecord::type.
|
protectedvirtual |
Signal handler for the service-removed signal.
Definition at line 248 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 |
interface | name of network interface to reach 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 161 of file service_model.cpp.
References fawkes::ServiceModel::ServiceAddedRecord::addrport, fawkes::ServiceModel::ServiceAddedRecord::domain, fawkes::ServiceModel::ServiceAddedRecord::hostname, fawkes::ServiceModel::ServiceAddedRecord::interface, fawkes::ServiceModel::ServiceAddedRecord::ipaddr, fawkes::ServiceModel::ServiceAddedRecord::name, fawkes::ServiceModel::ServiceAddedRecord::port, fawkes::ServiceModel::ServiceAddedRecord::sockaddr, 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 206 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 105 of file service_model.h.
|
protected |
Avahi thread.
Definition at line 117 of file service_model.h.
|
protected |
Queue that holds the recently removed services.
Definition at line 106 of file service_model.h.
|
protected |
Storage object.
Definition at line 114 of file service_model.h.
|
protected |
Column record class.
Definition at line 115 of file service_model.h.
|
protected |
This signal is emitted whenever a new service has been added.
Definition at line 108 of file service_model.h.
|
protected |
This signal is emitted whenever a service is removed.
Definition at line 109 of file service_model.h.