~ubuntu-branches/debian/experimental/kopete/experimental

« back to all changes in this revision

Viewing changes to protocols/jabber/googletalk/libjingle/talk/xmpp/xmppclientsettings.h

  • Committer: Package Import Robot
  • Author(s): Maximiliano Curia
  • Date: 2015-02-24 11:32:57 UTC
  • mfrom: (1.1.41 vivid)
  • Revision ID: package-import@ubuntu.com-20150224113257-gnupg4v7lzz18ij0
Tags: 4:14.12.2-1
* New upstream release (14.12.2).
* Bump Standards-Version to 3.9.6, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * libjingle
3
 
 * Copyright 2004--2005, Google Inc.
4
 
 *
5
 
 * Redistribution and use in source and binary forms, with or without 
6
 
 * modification, are permitted provided that the following conditions are met:
7
 
 *
8
 
 *  1. Redistributions of source code must retain the above copyright notice, 
9
 
 *     this list of conditions and the following disclaimer.
10
 
 *  2. Redistributions in binary form must reproduce the above copyright notice,
11
 
 *     this list of conditions and the following disclaimer in the documentation
12
 
 *     and/or other materials provided with the distribution.
13
 
 *  3. The name of the author may not be used to endorse or promote products 
14
 
 *     derived from this software without specific prior written permission.
15
 
 *
16
 
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17
 
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
18
 
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19
 
 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
20
 
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21
 
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22
 
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23
 
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
24
 
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
25
 
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
 
 */
27
 
 
28
 
#ifndef _XMPPCLIENTSETTINGS_H_
29
 
#define _XMPPCLIENTSETTINGS_H_
30
 
 
31
 
#include "talk/p2p/base/port.h"
32
 
#include "talk/base/cryptstring.h"
33
 
#include "talk/xmpp/xmppengine.h"
34
 
 
35
 
namespace buzz {
36
 
 
37
 
class XmppUserSettings {
38
 
 public:
39
 
  XmppUserSettings()
40
 
    : use_tls_(buzz::TLS_DISABLED),
41
 
      allow_plain_(false) {
42
 
  }
43
 
 
44
 
  void set_user(const std::string & user) { user_ = user; }
45
 
  void set_host(const std::string & host) { host_ = host; }
46
 
  void set_pass(const talk_base::CryptString & pass) { pass_ = pass; }
47
 
  void set_auth_cookie(const std::string & cookie) { auth_cookie_ = cookie; }
48
 
  void set_resource(const std::string & resource) { resource_ = resource; }
49
 
  void set_use_tls(const TlsOptions use_tls) { use_tls_ = use_tls; }
50
 
  void set_allow_plain(bool f) { allow_plain_ = f; }
51
 
  void set_test_server_domain(const std::string & test_server_domain) {
52
 
    test_server_domain_ = test_server_domain;
53
 
  }
54
 
  void set_token_service(const std::string & token_service) {
55
 
    token_service_ = token_service;
56
 
  }
57
 
 
58
 
  const std::string & user() const { return user_; }
59
 
  const std::string & host() const { return host_; }
60
 
  const talk_base::CryptString & pass() const { return pass_; }
61
 
  const std::string & auth_cookie() const { return auth_cookie_; }
62
 
  const std::string & resource() const { return resource_; }
63
 
  TlsOptions use_tls() const { return use_tls_; }
64
 
  bool allow_plain() const { return allow_plain_; }
65
 
  const std::string & test_server_domain() const { return test_server_domain_; }
66
 
  const std::string & token_service() const { return token_service_; }
67
 
 
68
 
 private:
69
 
  std::string user_;
70
 
  std::string host_;
71
 
  talk_base::CryptString pass_;
72
 
  std::string auth_cookie_;
73
 
  std::string resource_;
74
 
  TlsOptions use_tls_;
75
 
  bool allow_plain_;
76
 
  std::string test_server_domain_;
77
 
  std::string token_service_;
78
 
};
79
 
 
80
 
class XmppClientSettings : public XmppUserSettings {
81
 
 public:
82
 
  XmppClientSettings()
83
 
    : protocol_(cricket::PROTO_TCP),
84
 
      proxy_(talk_base::PROXY_NONE),
85
 
      proxy_port_(80),
86
 
      use_proxy_auth_(false) {
87
 
  }
88
 
 
89
 
  void set_server(const talk_base::SocketAddress & server) {
90
 
      server_ = server;
91
 
  }
92
 
  void set_protocol(cricket::ProtocolType protocol) { protocol_ = protocol; }
93
 
  void set_proxy(talk_base::ProxyType f) { proxy_ = f; }
94
 
  void set_proxy_host(const std::string & host) { proxy_host_ = host; }
95
 
  void set_proxy_port(int port) { proxy_port_ = port; };
96
 
  void set_use_proxy_auth(bool f) { use_proxy_auth_ = f; }
97
 
  void set_proxy_user(const std::string & user) { proxy_user_ = user; }
98
 
  void set_proxy_pass(const talk_base::CryptString & pass) { proxy_pass_ = pass; }
99
 
 
100
 
  const talk_base::SocketAddress & server() const { return server_; }
101
 
  cricket::ProtocolType protocol() const { return protocol_; }
102
 
  talk_base::ProxyType proxy() const { return proxy_; }
103
 
  const std::string & proxy_host() const { return proxy_host_; }
104
 
  int proxy_port() const { return proxy_port_; }
105
 
  bool use_proxy_auth() const { return use_proxy_auth_; }
106
 
  const std::string & proxy_user() const { return proxy_user_; }
107
 
  const talk_base::CryptString & proxy_pass() const { return proxy_pass_; }
108
 
 
109
 
 private:
110
 
  talk_base::SocketAddress server_;
111
 
  cricket::ProtocolType protocol_;
112
 
  talk_base::ProxyType proxy_;
113
 
  std::string proxy_host_;
114
 
  int proxy_port_;
115
 
  bool use_proxy_auth_;
116
 
  std::string proxy_user_;
117
 
  talk_base::CryptString proxy_pass_;
118
 
};
119
 
 
120
 
}
121
 
 
122
 
#endif