00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KDE_SLP_RFCREGISTRYIMPL_H
00022 #define KDE_SLP_RFCREGISTRYIMPL_H
00023
00024 #include <kde/slp/registryimpl.h>
00025 #include <qvaluevector.h>
00026 #include <slp.h>
00027
00028 class QCustomEvent;
00029
00030 namespace KDE {
00031 namespace SLP {
00032
00033
00040 class RFCRegistryImpl : public RegistryImpl {
00041 Q_OBJECT
00042
00043 private:
00044 QString m_language;
00045 bool m_allowAnyLanguage;
00046
00047 bool m_syncOpSuccess;
00048
00049 QValueList<SLPHandle> m_freeHandles;
00050 QValueList<SLPHandle> m_usedHandles;
00051 QStringList m_autoDeregisterServices;
00052
00053 SLPHandle getHandle();
00054 void returnHandle(SLPHandle h);
00055 bool callbackError(const QString &reason, SLPError e);
00056 static void callbackSLPRegReport(SLPHandle,
00057 SLPError errcode,
00058 void *cookie);
00059 protected:
00060 virtual void customEvent(QCustomEvent *ce);
00061
00062 bool findServiceTypesInternal(const QString &token,
00063 const QString &namingAuthority,
00064 const QStringList &scopeList,
00065 bool async);
00066 bool findServicesInternal(const QString &token,
00067 const QString &srvtype,
00068 bool fetchAttributes,
00069 const KDE::SLP::Filter::List &filters,
00070 const QString &scopelist,
00071 bool async);
00072 bool findAttributesInternal(const QString &token,
00073 const QString &serviceUrl,
00074 const QStringList &attributeIds,
00075 bool async);
00076 bool findScopesInternal(const QString &token,
00077 bool async);
00078
00079 public:
00080 RFCRegistryImpl(const QString &language,
00081 bool allowAnyLanguage);
00082 ~RFCRegistryImpl();
00083
00084
00085 QString getError(SLPError e);
00086 bool error(const QString &msg, SLPError e);
00087 virtual bool available() const;
00088 virtual bool supportsAutoAddress() const;
00089 virtual bool registerService(const KDE::SLP::Service &service,
00090 bool autoAddress,
00091 bool autoDeregister,
00092 const QStringList &scopes,
00093 unsigned short lifetime,
00094 bool autoLifetimeExtension,
00095 const QString &language);
00096 virtual bool deregister(const QString &serviceURL);
00097 virtual bool deregister(const KDE::SLP::Service &service);
00098 virtual bool findServiceTypes(const QString &token,
00099 const QString &namingAuthority,
00100 const QStringList &scopeList,
00101 const QString &language,
00102 bool allowAnyLanguage);
00103 virtual bool findServiceTypesAsync(const QString &token,
00104 const QString &namingAuthority,
00105 const QStringList &scopeList,
00106 const QString &language,
00107 bool allowAnyLanguage);
00108 virtual bool findServices(const QString &token,
00109 const QString &srvtype,
00110 bool fetchAttributes,
00111 const KDE::SLP::Filter::List &filters,
00112 const QString &scopelist,
00113 const QString &language,
00114 bool allowAnyLanguage);
00115 virtual bool findServicesAsync(const QString &token,
00116 const QString &srvtype,
00117 bool fetchAttributes,
00118 const KDE::SLP::Filter::List &filters,
00119 const QString &scopelist,
00120 const QString &language,
00121 bool allowAnyLanguage);
00122 virtual bool findAttributes(const QString &token,
00123 const QString &serviceUrl,
00124 const QStringList &attributeIds,
00125 const QString &language,
00126 bool allowAnyLanguage);
00127 virtual bool findAttributesAsync(const QString &token,
00128 const QString &serviceUrl,
00129 const QStringList &attributeIds,
00130 const QString &language,
00131 bool allowAnyLanguage);
00132 virtual bool findScopes(const QString &token,
00133 const QString &language,
00134 bool allowAnyLanguage);
00135 virtual bool findScopesAsync(const QString &token,
00136 const QString &language,
00137 bool allowAnyLanguage);
00138
00139 signals:
00140 void foundServiceTypes(QString token, QStringList serviceTypes);
00141 void foundService(QString token,
00142 KDE::SLP::Service service,
00143 int lifetime);
00144 void foundAttributes(QString token,
00145 KDE::SLP::Service service);
00146 void foundScopes(QString token,
00147 QStringList scopeList);
00148 void operationFinished(QString token, bool success, QString msg);
00149 };
00150
00151 }
00152 }
00153
00154 #endif