KDSOAP 1.2
|
00001 /**************************************************************************** 00002 ** Copyright (C) 2010-2012 Klaralvdalens Datakonsult AB. All rights reserved. 00003 ** 00004 ** This file is part of the KD Soap library. 00005 ** 00006 ** Licensees holding valid commercial KD Soap licenses may use this file in 00007 ** accordance with the KD Soap Commercial License Agreement provided with 00008 ** the Software. 00009 ** 00010 ** 00011 ** This file may be distributed and/or modified under the terms of the 00012 ** GNU General Public License version 2 and version 3 as published by the 00013 ** Free Software Foundation and appearing in the file LICENSE.GPL.txt included. 00014 ** 00015 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00016 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00017 ** 00018 ** Contact info@kdab.com if any conditions of this licensing are not 00019 ** clear to you. 00020 ** 00021 **********************************************************************/ 00022 #ifndef KDSOAPMESSAGE_H 00023 #define KDSOAPMESSAGE_H 00024 00025 #include <QSharedDataPointer> 00026 #include <QVariant> 00027 #include "KDSoapValue.h" 00028 class QString; 00029 class KDSoapMessageData; 00030 class KDSoapHeaders; 00031 00035 class KDSOAP_EXPORT KDSoapMessage : public KDSoapValue 00036 { 00037 public: 00041 KDSoapMessage(); 00045 ~KDSoapMessage(); 00046 00050 KDSoapMessage(const KDSoapMessage& other); 00054 KDSoapMessage &operator=(const KDSoapMessage &other); 00055 00059 KDSoapMessage &operator=(const KDSoapValue &other); 00060 00064 bool operator==(const KDSoapMessage &other) const; 00065 00069 bool operator!=(const KDSoapMessage &other) const; 00070 00075 void setUse(Use use); 00079 Use use() const; 00080 00097 void addArgument(const QString& argumentName, const QVariant& argumentValue, const QString& typeNameSpace = QString(), const QString& typeName = QString()); 00098 00114 void addArgument(const QString& argumentName, const KDSoapValueList& argumentValueList, const QString& typeNameSpace = QString(), const QString& typeName = QString()); 00115 00120 KDSoapValueList& arguments(); 00121 00126 const KDSoapValueList& arguments() const; 00127 00135 bool isFault() const; 00136 00140 QString faultAsString() const; 00141 00146 void setFault(bool fault); 00147 00148 private: 00149 bool isNull() const; 00150 friend class KDSoapPendingCall; 00151 friend class KDSoapServerSocket; 00152 friend class KDSoapMessageWriter; 00153 QSharedDataPointer<KDSoapMessageData> d; 00154 }; 00155 00160 class KDSOAP_EXPORT KDSoapHeaders : public QList<KDSoapMessage> 00161 { 00162 public: 00166 KDSoapMessage header(const QString& name) const; 00167 }; 00168 00172 KDSOAP_EXPORT QDebug operator<<(QDebug dbg, const KDSoapMessage &msg); 00173 00174 Q_DECLARE_METATYPE(KDSoapMessage) 00175 00176 #endif // KDSOAPMESSAGE_H