00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _LIBGNOMEVFSMM_DNS_SD_H
00019 #define _LIBGNOMEVFSMM_DNS_SD_H
00020
00021
00022 #include <libgnomevfsmm/enums.h>
00023 #include <glibmm.h>
00024 #include <libgnomevfs/gnome-vfs-dns-sd.h>
00025
00026
00027
00028 namespace Gnome
00029 {
00030
00031 namespace Vfs
00032 {
00033
00034 namespace DnsSd
00035 {
00036
00037
00038 typedef struct GnomeVFSDNSSDBrowseHandle BrowseHandle;
00039 typedef struct GnomeVFSDNSSDResolveHandle ResolveHandle;
00040
00041
00042 class Service
00043 {
00044 public:
00045 Glib::ustring name;
00046 Glib::ustring type;
00047 Glib::ustring domain;
00048 };
00049
00053 typedef sigc::slot<void, BrowseHandle*, GnomeVFSDNSSDServiceStatus, const Service&> BrowseSlot;
00054
00055
00056 BrowseHandle* browse(const Glib::ustring& domain, const Glib::ustring& type, const BrowseSlot& slot);
00057
00058 void stop_browse(BrowseHandle* handle);
00059
00060 typedef std::map<Glib::ustring, Glib::ustring> ServiceOptions;
00061
00066 typedef sigc::slot<void, ResolveHandle*, Result, const Service&, const Glib::ustring&, int,
00067 const ServiceOptions&> ResolveSlot;
00068
00069
00070 ResolveHandle* resolve(const Glib::ustring& name, const Glib::ustring& type, const Glib::ustring& domain,
00071 int timeout, const ResolveSlot& slot);
00072
00073 void cancel_resolve(ResolveHandle* handle);
00074
00075
00076 typedef Glib::ListHandle<Service> ListHandleServices;
00077
00078
00079 void browse_sync(const Glib::ustring& domain, const Glib::ustring& type, int timeout_msec, std::list<Service>& services);
00080
00081
00082 void resolve_sync(const Glib::ustring& name, const Glib::ustring& type, const Glib::ustring& domain,
00083 int timeout_msec, Glib::ustring& host, int& port, ServiceOptions& options);
00084
00085 typedef Glib::ListHandle<Glib::ustring> ListHandleStrings;
00086
00087 ListHandleStrings list_browse_domains_sync(const Glib::ustring& domain, int timeout_msec);
00088
00089 ListHandleStrings get_default_browse_domains();
00090
00091
00092 }
00093
00094 }
00095
00096 }
00097
00098 #endif