00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KDE_SLP_SERVICE_H
00022 #define KDE_SLP_SERVICE_H
00023
00024 #include <qstringlist.h>
00025 #include <qmap.h>
00026 #include <qvaluevector.h>
00027 #include <qcstring.h>
00028
00029 namespace KDE {
00030 namespace SLP {
00031
00080 class Service {
00081 private:
00082 QString m_url;
00083 QMap<QString,QString> m_attributes;
00084 void *reserved;
00085
00086 public:
00094 Service(const QString &url, const QString &attributes = QString::null);
00095
00100 Service(const Service &service);
00101
00107 Service &operator=(const Service &other);
00108
00115 bool operator==(const Service &other);
00116
00121 QString url() const;
00122
00134 QString serviceType() const;
00135
00136
00147 QString abstractServiceType() const;
00148
00156 bool areAttributesSet() const;
00157
00170 QString serializedAttributes() const;
00171
00178 void setSerializedAttributes(const QString &attributes);
00179
00192 QString serializedAttributeValue(const QString &name) const;
00193
00202 bool hasAttribute(const QString &attributeName) const;
00203
00215 bool isList(const QString &attributeName) const;
00216
00224 bool isTag(const QString &attributeName) const;
00225
00237 QString getString(const QString &attributeName) const;
00238
00249 bool getBool(const QString &attributeName) const;
00250
00260 int getInt(const QString &attributeName) const;
00261
00270 QByteArray getBlob(const QString &attributeName) const;
00271
00282 QStringList getStringList(const QString &attributeName) const;
00283
00294 QValueVector<bool> getBoolList(const QString &attributeName) const;
00295
00306 QValueVector<int> getIntList(const QString &attributeName) const;
00307
00318 QValueVector<QByteArray> getBlobList(const QString &attributeName) const;
00319
00325 void remove(const QString &attributeName);
00326
00333 void setTag(const QString &attributeName);
00334
00348 void setString(const QString &attributeName, const QString &value);
00349
00357 void setBool(const QString &attributeName, bool value);
00358
00366 void setInt(const QString &attributeName, int value);
00367
00381 void setBlob(const QString &attributeName, const QByteArray &value);
00382
00391 void setStringList(const QString &attributeName, const QStringList &values);
00392
00400 void setBoolList(const QString &attributeName,
00401 const QValueVector<bool> &values);
00402
00410 void setIntList(const QString &attributeName,
00411 const QValueVector<int> &values);
00412
00426 void setBlob(const QString &attributeName,
00427 const QValueVector<QByteArray> &values);
00428
00429 };
00430
00431
00432 }
00433 }
00434
00435 #endif