00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TBonjourBrowser
00013 #define ROOT_TBonjourBrowser
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef ROOT_TObject
00038 #include "TObject.h"
00039 #endif
00040 #ifndef ROOT_TQObject
00041 #include "TQObject.h"
00042 #endif
00043 #ifndef ROOT_TString
00044 #include "TString.h"
00045 #endif
00046
00047 #if !defined(__CINT__)
00048 #include <dns_sd.h>
00049 #else
00050 typedef ULong_t DNSServiceRef;
00051 typedef UInt_t DNSServiceFlags;
00052 typedef Int_t DNSServiceErrorType;
00053 #endif
00054
00055 class TFileHandler;
00056 class TList;
00057
00058
00059 class TBonjourBrowser : public TObject, public TQObject {
00060
00061 private:
00062 DNSServiceRef fDNSRef;
00063 TFileHandler *fBonjourSocketHandler;
00064 TList *fBonjourRecords;
00065 TString fBrowsingType;
00066
00067 void *GetSender() { return this; }
00068
00069 #if !defined(__CINT__)
00070 static void DNSSD_API BonjourBrowseReply(DNSServiceRef,
00071 DNSServiceFlags, UInt_t, DNSServiceErrorType,
00072 const char *, const char *, const char *, void *);
00073 #else
00074 static void BonjourBrowseReply(DNSServiceRef,
00075 DNSServiceFlags, Int_t, DNSServiceErrorType,
00076 const char *, const char *, const char *, void *);
00077 #endif
00078
00079 public:
00080 TBonjourBrowser();
00081 virtual ~TBonjourBrowser();
00082
00083 Int_t BrowseForServiceType(const char *serviceType);
00084 TList *CurrentRecords() const { return fBonjourRecords; }
00085 const char *ServiceType() const { return fBrowsingType; }
00086
00087 void CurrentBonjourRecordsChanged(TList *bonjourRecords);
00088
00089 void BonjourSocketReadyRead();
00090
00091 ClassDef(TBonjourBrowser,0)
00092 };
00093
00094 #endif