| 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 QSERVICE_PACKAGE_H |
| 41 |
#define QSERVICE_PACKAGE_H |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
#include "qserviceframeworkglobal.h" |
| 55 |
#include <QExplicitlySharedDataPointer> |
| 56 |
#include <QSharedData> |
| 57 |
#include <QUuid> |
| 58 |
#include <QVariant> |
| 59 |
#include "qserviceclientcredentials_p.h" |
| 60 |
#include "qremoteserviceregister.h" |
| 61 |
|
| 62 |
QT_BEGIN_NAMESPACE |
| 63 |
|
| 64 |
class QDataStream; |
| 65 |
class QDebug; |
| 66 |
|
| 67 |
class QServicePackagePrivate; |
| 68 |
class Q_AUTOTEST_EXPORT QServicePackage |
| 69 |
{ |
| 70 |
Q_GADGET |
| 71 |
public: |
| 72 |
QServicePackage(); |
| 73 |
QServicePackage(const QServicePackage& other); |
| 74 |
QServicePackage& operator=(const QServicePackage& other); |
| 75 |
~QServicePackage(); |
| 76 |
|
| 77 |
enum Type { |
| 78 |
ObjectCreation = 0, |
| 79 |
MethodCall, |
| 80 |
PropertyCall |
| 81 |
}; |
| 82 |
Q_ENUMS(Type) |
| 83 |
|
| 84 |
enum ResponseType { |
| 85 |
NotAResponse = 0, |
| 86 |
Success, |
| 87 |
Failed |
| 88 |
}; |
| 89 |
Q_ENUMS(ResponseType) |
| 90 |
|
| 91 |
QServicePackage createResponse() const; |
| 92 |
|
| 93 |
bool isValid() const; |
| 94 |
|
| 95 |
QExplicitlySharedDataPointer<QServicePackagePrivate> d; |
| 96 |
|
| 97 |
#ifndef QT_NO_DATASTREAM |
| 98 |
friend QDataStream &operator<<(QDataStream &, const QServicePackage&); |
| 99 |
friend QDataStream &operator>>(QDataStream &, QServicePackage&); |
| 100 |
#endif |
| 101 |
}; |
| 102 |
|
| 103 |
#ifndef QT_NO_DATASTREAM |
| 104 |
QDataStream &operator<<(QDataStream &, const QServicePackage&); |
| 105 |
QDataStream &operator>>(QDataStream &, QServicePackage&); |
| 106 |
#endif |
| 107 |
|
| 108 |
#ifndef QT_NO_DEBUG_STREAM |
| 109 |
QDebug operator<<(QDebug, const QServicePackage&); |
| 110 |
#endif |
| 111 |
|
| 112 |
class QServicePackagePrivate : public QSharedData |
| 113 |
{ |
| 114 |
public: |
| 115 |
QServicePackagePrivate() |
| 116 |
: packageType(QServicePackage::ObjectCreation), |
| 117 |
entry(QRemoteServiceRegister::Entry()), payload(QVariant()), |
| 118 |
messageId(QUuid()), instanceId(QUuid()), responseType(QServicePackage::NotAResponse) |
| 119 |
{ |
| 120 |
} |
| 121 |
|
| 122 |
QServicePackage::Type packageType; |
| 123 |
QRemoteServiceRegister::Entry entry; |
| 124 |
QVariant payload; |
| 125 |
QUuid messageId; |
| 126 |
QUuid instanceId; |
| 127 |
QServicePackage::ResponseType responseType; |
| 128 |
|
| 129 |
void clean() |
| 130 |
{ |
| 131 |
packageType = QServicePackage::ObjectCreation; |
| 132 |
messageId = QUuid(); |
| 133 |
instanceId = QUuid(); |
| 134 |
payload = QVariant(); |
| 135 |
entry = QRemoteServiceRegister::Entry(); |
| 136 |
responseType = QServicePackage::NotAResponse; |
| 137 |
} |
| 138 |
}; |
| 139 |
|
| 140 |
QT_END_NAMESPACE |
| 141 |
|
| 142 |
#endif |