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
00035 class exception;
00036
00037 namespace DnsSd
00038 {
00039
00040
00041 typedef struct GnomeVFSDNSSDBrowseHandle BrowseHandle;
00042 typedef struct GnomeVFSDNSSDResolveHandle ResolveHandle;
00043
00044
00045 class Service
00046 {
00047 public:
00048 Glib::ustring name;
00049 Glib::ustring type;
00050 Glib::ustring domain;
00051 };
00052
00056 typedef sigc::slot<void, BrowseHandle*, GnomeVFSDNSSDServiceStatus, const Service&> BrowseSlot;
00057
00058
00059 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00060 BrowseHandle* browse(const Glib::ustring& domain, const Glib::ustring& type, const BrowseSlot& slot);
00061 #else
00062 BrowseHandle* browse(const Glib::ustring& domain, const Glib::ustring& type, const BrowseSlot& slot, std::auto_ptr<Gnome::Vfs::exception>& error);
00063 #endif //GLIBMM_EXCEPTIONS_ENABLED
00064
00065 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00066 void stop_browse(BrowseHandle* handle);
00067 #else
00068 void stop_browse(BrowseHandle* handle, std::auto_ptr<Gnome::Vfs::exception>& error);
00069 #endif //GLIBMM_EXCEPTIONS_ENABLED
00070
00071 typedef std::map<Glib::ustring, Glib::ustring> ServiceOptions;
00072
00077 typedef sigc::slot<void, ResolveHandle*, Result, const Service&, const Glib::ustring&, int,
00078 const ServiceOptions&> ResolveSlot;
00079
00080
00081 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00082 ResolveHandle* resolve(const Glib::ustring& name, const Glib::ustring& type, const Glib::ustring& domain,
00083 int timeout, const ResolveSlot& slot);
00084 #else
00085 ResolveHandle* resolve(const Glib::ustring& name, const Glib::ustring& type, const Glib::ustring& domain,
00086 int timeout, const ResolveSlot& slot, std::auto_ptr<Gnome::Vfs::exception>& error);
00087 #endif //GLIBMM_EXCEPTIONS_ENABLED
00088
00089 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00090 void cancel_resolve(ResolveHandle* handle);
00091 #else
00092 void cancel_resolve(ResolveHandle* handle, std::auto_ptr<Gnome::Vfs::exception>& error);
00093 #endif //GLIBMM_EXCEPTIONS_ENABLED
00094
00095
00096 typedef Glib::ListHandle<Service> ListHandleServices;
00097
00098
00099 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00100 void browse_sync(const Glib::ustring& domain, const Glib::ustring& type, int timeout_msec, std::list<Service>& services);
00101 #else
00102 void browse_sync(const Glib::ustring& domain, const Glib::ustring& type, int timeout_msec, std::list<Service>& services, std::auto_ptr<Gnome::Vfs::exception>& error);
00103 #endif //GLIBMM_EXCEPTIONS_ENABLED
00104
00105
00106 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00107 void resolve_sync(const Glib::ustring& name, const Glib::ustring& type, const Glib::ustring& domain,
00108 int timeout_msec, Glib::ustring& host, int& port, ServiceOptions& options);
00109 #else
00110 void resolve_sync(const Glib::ustring& name, const Glib::ustring& type, const Glib::ustring& domain,
00111 int timeout_msec, Glib::ustring& host, int& port, ServiceOptions& options, std::auto_ptr<Gnome::Vfs::exception>& error);
00112 #endif //GLIBMM_EXCEPTIONS_ENABLED
00113
00114 typedef Glib::ListHandle<Glib::ustring> ListHandleStrings;
00115
00116 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00117 ListHandleStrings list_browse_domains_sync(const Glib::ustring& domain, int timeout_msec);
00118 #else
00119 ListHandleStrings list_browse_domains_sync(const Glib::ustring& domain, int timeout_msec, std::auto_ptr<Gnome::Vfs::exception>& error);
00120 #endif //GLIBMM_EXCEPTIONS_ENABLED
00121
00122 ListHandleStrings get_default_browse_domains();
00123
00124
00125 }
00126
00127 }
00128
00129 }
00130
00131 #endif