BatteryMonitor Class Reference

A battery monitor. More...

#include <tools/battery_monitor/battery_monitor.h>

Inheritance diagram for BatteryMonitor:

[legend]
List of all members.

Public Member Functions

 BatteryMonitor (Glib::RefPtr< Gnome::Glade::Xml > ref_xml)
 Constructor.
 ~BatteryMonitor ()
 Destructor.
Gtk::Window & get_window () const
 Obtain the main window.

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.

Detailed Description

A battery monitor.

Author:
Daniel Beck

Definition at line 40 of file battery_monitor.h.


Constructor & Destructor Documentation

BatteryMonitor::BatteryMonitor ( Glib::RefPtr< Gnome::Glade::Xml >  ref_xml  ) 

Constructor.

Parameters:
ref_xml Glade XML object

Definition at line 39 of file battery_monitor.cpp.

References fawkes::Thread::start(), and fawkes::AvahiThread::watch_service().

BatteryMonitor::~BatteryMonitor (  ) 

Destructor.

Definition at line 53 of file battery_monitor.cpp.

References fawkes::Thread::cancel(), and fawkes::Thread::join().


Member Function Documentation

void BatteryMonitor::all_for_now (  )  [protected, virtual]

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 70 of file battery_monitor.cpp.

void BatteryMonitor::browse_failed ( const char *  name,
const char *  type,
const char *  domain 
) [protected, virtual]

Failed to browse for a given service.

Parameters:
name name of the service
type type of the service
domain domain of the service

Implements fawkes::ServiceBrowseHandler.

Definition at line 80 of file battery_monitor.cpp.

void BatteryMonitor::cache_exhausted (  )  [protected, virtual]

Cache exhausted.

Implements fawkes::ServiceBrowseHandler.

Definition at line 75 of file battery_monitor.cpp.

Gtk::Window & BatteryMonitor::get_window (  )  const

Obtain the main window.

Returns:
the main window

Definition at line 64 of file battery_monitor.cpp.

void BatteryMonitor::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 
) [protected, virtual]

A service has been announced on the network.

Parameters:
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 87 of file battery_monitor.cpp.

References BatteryMonitorTreeView::add_host().

void BatteryMonitor::service_removed ( const char *  name,
const char *  type,
const char *  domain 
) [protected, virtual]

A service has been removed from the network.

Parameters:
name name of the service
type type of the service
domain domain of the service

Implements fawkes::ServiceBrowseHandler.

Definition at line 104 of file battery_monitor.cpp.

References BatteryMonitorTreeView::rem_host().


The documentation for this class was generated from the following files:
Generated on Tue Feb 22 13:31:31 2011 for Fawkes API by  doxygen 1.4.7