1269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org/*
2269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org *  Copyright 2004 The WebRTC Project Authors. All rights reserved.
3269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org *
4269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org *  Use of this source code is governed by a BSD-style license
5269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org *  that can be found in the LICENSE file in the root of the source
6269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org *  tree. An additional intellectual property rights grant can be found
7269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org *  in the file PATENTS.  All contributing project authors may
8269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org *  be found in the AUTHORS file in the root of the source tree.
9269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org */
10269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org
11269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org#ifndef WEBRTC_LIBJINGLE_XMPP_XMPPTHREAD_H_
12269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org#define WEBRTC_LIBJINGLE_XMPP_XMPPTHREAD_H_
13269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org
14269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org#include "webrtc/libjingle/xmpp/xmppclientsettings.h"
15269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org#include "webrtc/libjingle/xmpp/xmppengine.h"
16269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org#include "webrtc/libjingle/xmpp/xmpppump.h"
17269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org#include "webrtc/libjingle/xmpp/xmppsocket.h"
18269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org#include "webrtc/base/thread.h"
19269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org
20269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.orgnamespace buzz {
21269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org
22269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.orgclass XmppThread:
23269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org    public rtc::Thread, buzz::XmppPumpNotify, rtc::MessageHandler {
24269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.orgpublic:
25269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org  XmppThread();
26269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org  ~XmppThread();
27269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org
28269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org  buzz::XmppClient* client() { return pump_->client(); }
29269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org
30269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org  void ProcessMessages(int cms);
31269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org
32269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org  void Login(const buzz::XmppClientSettings & xcs);
33269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org  void Disconnect();
34269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org
35269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.orgprivate:
36269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org  buzz::XmppPump* pump_;
37269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org
38269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org  void OnStateChange(buzz::XmppEngine::State state);
39269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org  void OnMessage(rtc::Message* pmsg);
40269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org};
41269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org
42269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org}  // namespace buzz
43269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org
44269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org#endif  // WEBRTC_LIBJINGLE_XMPP_XMPPTHREAD_H_
45269fb4bc90b79bebbb8311da0110ccd6803fd0a8henrike@webrtc.org
46