OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ |
| 10 |
| 11 #ifndef WEBRTC_LIBJINGLE_XMPP_IQTASK_H_ |
| 12 #define WEBRTC_LIBJINGLE_XMPP_IQTASK_H_ |
| 13 |
| 14 #include <memory> |
| 15 #include <string> |
| 16 |
| 17 #include "third_party/xmpp/xmppengine.h" |
| 18 #include "third_party/xmpp/xmpptask.h" |
| 19 |
| 20 namespace buzz { |
| 21 |
| 22 class IqTask : public XmppTask { |
| 23 public: |
| 24 IqTask(XmppTaskParentInterface* parent, |
| 25 const std::string& verb, const Jid& to, |
| 26 XmlElement* el); |
| 27 virtual ~IqTask() {} |
| 28 |
| 29 const XmlElement* stanza() const { return stanza_.get(); } |
| 30 |
| 31 sigslot::signal2<IqTask*, |
| 32 const XmlElement*> SignalError; |
| 33 |
| 34 protected: |
| 35 virtual void HandleResult(const XmlElement* element) = 0; |
| 36 |
| 37 private: |
| 38 virtual int ProcessStart(); |
| 39 virtual bool HandleStanza(const XmlElement* stanza); |
| 40 virtual int ProcessResponse(); |
| 41 virtual int OnTimeout(); |
| 42 |
| 43 Jid to_; |
| 44 std::unique_ptr<XmlElement> stanza_; |
| 45 }; |
| 46 |
| 47 } // namespace buzz |
| 48 |
| 49 #endif // WEBRTC_LIBJINGLE_XMPP_IQTASK_H_ |
OLD | NEW |