Fawkes API
Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * service_browser.h - Webview service browser 00004 * 00005 * Created: Thu Jul 02 17:54:57 2009 (RoboCup 2009, Graz) 00006 * Copyright 2006-2009 Tim Niemueller [www.niemueller.de] 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Library General Public License for more details. 00019 * 00020 * Read the full text in the LICENSE.GPL file in the doc directory. 00021 */ 00022 00023 #ifndef __PLUGINS_WEBVIEW_SERVICE_BROWSER_H_ 00024 #define __PLUGINS_WEBVIEW_SERVICE_BROWSER_H_ 00025 00026 #include <netcomm/service_discovery/service.h> 00027 #include <netcomm/service_discovery/browse_handler.h> 00028 00029 #include <map> 00030 #include <string> 00031 00032 namespace fawkes { 00033 class Logger; 00034 } 00035 00036 class WebviewServiceBrowseHandler : public fawkes::ServiceBrowseHandler 00037 { 00038 public: 00039 WebviewServiceBrowseHandler(fawkes::Logger *logger, fawkes::NetworkService *webview_service); 00040 00041 virtual void all_for_now(); 00042 virtual void cache_exhausted(); 00043 virtual void browse_failed(const char *name, 00044 const char *type, 00045 const char *domain); 00046 virtual void service_added(const char *name, 00047 const char *type, 00048 const char *domain, 00049 const char *host_name, 00050 const struct sockaddr *addr, 00051 const socklen_t addr_size, 00052 uint16_t port, 00053 std::list<std::string> &txt, 00054 int flags); 00055 virtual void service_removed(const char *name, 00056 const char *type, 00057 const char *domain); 00058 00059 /** A map of services. 00060 * Maps service names to NetworkService instances describing the service 00061 * in more detail. */ 00062 typedef std::map<std::string, fawkes::NetworkService *> ServiceList; 00063 00064 ServiceList & service_list(); 00065 00066 private: 00067 fawkes::Logger *__logger; 00068 fawkes::NetworkService *__webview_service; 00069 ServiceList __service_list; 00070 }; 00071 00072 #endif