blob: 0db00711e8623cc65d3c52d6d6af3afa983ccdc2 [file] [log] [blame]
henrike@webrtc.org269fb4b2014-10-28 22:20:11 +00001/*
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
kwiberg322c4a02016-04-30 02:40:22 -070014#include <memory>
henrike@webrtc.org269fb4b2014-10-28 22:20:11 +000015#include <string>
16
17#include "webrtc/libjingle/xmpp/xmppengine.h"
18#include "webrtc/libjingle/xmpp/xmpptask.h"
19
20namespace buzz {
21
22class 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_;
kwiberg322c4a02016-04-30 02:40:22 -070044 std::unique_ptr<XmlElement> stanza_;
henrike@webrtc.org269fb4b2014-10-28 22:20:11 +000045};
46
47} // namespace buzz
48
49#endif // WEBRTC_LIBJINGLE_XMPP_IQTASK_H_