Main Page   Class Hierarchy   Compound List   File List   Compound Members  

service.h

00001 /*
00002  *  Interface to register SLP services - Service Descriptor
00003  *  Copyright (C) 2002-2003 Tim Jansen <tim@tjansen.de>
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Library General Public
00007  *  License as published by the Free Software Foundation; either
00008  *  version 2 of the License, or (at your option) any later version.
00009  *
00010  *  This library is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  *  Library General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU Library General Public License
00016  *  along with this library; see the file COPYING.LIB.  If not, write to
00017  *  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018  *  Boston, MA 02111-1307, USA.
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

Generated on Tue Jun 24 20:14:35 2003 for KDE::SLP by doxygen1.2.18