| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
#ifndef QSERVICEINTERFACEDESCRIPTOR_H |
| 41 |
#define QSERVICEINTERFACEDESCRIPTOR_H |
| 42 |
|
| 43 |
#include "qserviceframeworkglobal.h" |
| 44 |
#include <QString> |
| 45 |
#include <QVariant> |
| 46 |
#include "qservice.h" |
| 47 |
|
| 48 |
QT_USE_NAMESPACE |
| 49 |
|
| 50 |
#ifdef SERVICE_XML_GENERATOR |
| 51 |
#undef Q_SERVICEFW_EXPORT |
| 52 |
#define Q_SERVICEFW_EXPORT |
| 53 |
#endif |
| 54 |
|
| 55 |
|
| 56 |
QT_BEGIN_NAMESPACE |
| 57 |
|
| 58 |
class QDebug; |
| 59 |
class QStringList; |
| 60 |
class QDataStream; |
| 61 |
|
| 62 |
|
| 63 |
class QServiceInterfaceDescriptorPrivate; |
| 64 |
class Q_SERVICEFW_EXPORT QServiceInterfaceDescriptor |
| 65 |
{ |
| 66 |
public: |
| 67 |
enum Attribute { |
| 68 |
Capabilities = 0, |
| 69 |
Location, |
| 70 |
ServiceDescription, |
| 71 |
InterfaceDescription, |
| 72 |
ServiceType |
| 73 |
}; |
| 74 |
|
| 75 |
QServiceInterfaceDescriptor(); |
| 76 |
QServiceInterfaceDescriptor(const QServiceInterfaceDescriptor& other); |
| 77 |
~QServiceInterfaceDescriptor(); |
| 78 |
|
| 79 |
QServiceInterfaceDescriptor& operator=(const QServiceInterfaceDescriptor& other); |
| 80 |
bool operator==(const QServiceInterfaceDescriptor& other) const; |
| 81 |
inline bool operator!=(const QServiceInterfaceDescriptor& other) const |
| 82 |
{ return !operator==(other); } |
| 83 |
|
| 84 |
QString serviceName() const; |
| 85 |
QString interfaceName() const; |
| 86 |
int majorVersion() const; |
| 87 |
int minorVersion() const; |
| 88 |
|
| 89 |
bool isValid() const; |
| 90 |
|
| 91 |
QService::Scope scope() const; |
| 92 |
|
| 93 |
QVariant attribute(QServiceInterfaceDescriptor::Attribute which) const; |
| 94 |
QString customAttribute(const QString& which) const; |
| 95 |
QStringList customAttributes() const; |
| 96 |
|
| 97 |
private: |
| 98 |
QServiceInterfaceDescriptorPrivate* d; |
| 99 |
|
| 100 |
friend class QServiceInterfaceDescriptorPrivate; |
| 101 |
friend class QServiceManager; |
| 102 |
friend class ServiceDatabase; |
| 103 |
friend class ServiceMetaData; |
| 104 |
friend class DatabaseManager; |
| 105 |
#ifndef QT_NO_DATASTREAM |
| 106 |
friend Q_SERVICEFW_EXPORT QDataStream &operator<<(QDataStream &, const QServiceInterfaceDescriptor &); |
| 107 |
friend Q_SERVICEFW_EXPORT QDataStream &operator>>(QDataStream &, QServiceInterfaceDescriptor &); |
| 108 |
#endif |
| 109 |
}; |
| 110 |
|
| 111 |
inline uint qHash(const QServiceInterfaceDescriptor &desc) |
| 112 |
{ |
| 113 |
return qHash(desc.serviceName()) + qHash(desc.interfaceName()) + desc.majorVersion() * 7 + desc.minorVersion() * 7; |
| 114 |
} |
| 115 |
|
| 116 |
#ifndef QT_NO_DATASTREAM |
| 117 |
Q_SERVICEFW_EXPORT QDataStream &operator<<(QDataStream &, const QServiceInterfaceDescriptor &); |
| 118 |
Q_SERVICEFW_EXPORT QDataStream &operator>>(QDataStream &, QServiceInterfaceDescriptor &); |
| 119 |
#endif |
| 120 |
#ifndef QT_NO_DEBUG_STREAM |
| 121 |
Q_SERVICEFW_EXPORT QDebug operator<<(QDebug, const QServiceInterfaceDescriptor &); |
| 122 |
#endif |
| 123 |
|
| 124 |
|
| 125 |
QT_END_NAMESPACE |
| 126 |
|
| 127 |
#endif |