~ubuntu-branches/ubuntu/raring/glibmm2.4/raring

« back to all changes in this revision

Viewing changes to gio/giomm/tlsclientconnection.h

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2013-03-06 13:03:41 UTC
  • mfrom: (1.2.79)
  • Revision ID: package-import@ubuntu.com-20130306130341-02m9gb1ahbdcgbn5
Tags: 2.35.8-0ubuntu1
New upstream release based on GLib 2.35.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- c++ -*-
 
2
// Generated by gtkmmproc -- DO NOT MODIFY!
 
3
#ifndef _GIOMM_TLSCLIENTCONNECTION_H
 
4
#define _GIOMM_TLSCLIENTCONNECTION_H
 
5
 
 
6
 
 
7
#include <glibmm/ustring.h>
 
8
#include <sigc++/sigc++.h>
 
9
 
 
10
/* Copyright (C) 2013 The giomm Development Team
 
11
 *
 
12
 * This library is free software; you can redistribute it and/or
 
13
 * modify it under the terms of the GNU Lesser General Public
 
14
 * License as published by the Free Software Foundation; either
 
15
 * version 2.1 of the License, or (at your option) any later version.
 
16
 *
 
17
 * This library is distributed in the hope that it will be useful,
 
18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
19
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
20
 * Lesser General Public License for more details.
 
21
 *
 
22
 * You should have received a copy of the GNU Lesser General Public
 
23
 * License along with this library; if not, write to the Free
 
24
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
25
 */
 
26
 
 
27
#include <glibmm/interface.h>
 
28
#include <giomm/enums.h>
 
29
 
 
30
 
 
31
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
32
typedef struct _GTlsClientConnectionInterface GTlsClientConnectionInterface;
 
33
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
34
 
 
35
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
36
typedef struct _GTlsClientConnection GTlsClientConnection;
 
37
typedef struct _GTlsClientConnectionClass GTlsClientConnectionClass;
 
38
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
39
 
 
40
 
 
41
namespace Gio
 
42
{ class TlsClientConnection_Class; } // namespace Gio
 
43
namespace Gio
 
44
{
 
45
 
 
46
class SocketConnectable;
 
47
 
 
48
/** TlsClientConnection - TLS client-side connection.
 
49
 * TlsClientConnection is the client-side subclass of TlsConnection,
 
50
 * representing a client-side TLS connection.
 
51
 * @newin{2,36}
 
52
 */
 
53
 
 
54
class TlsClientConnection : public Glib::Interface
 
55
{
 
56
  
 
57
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
58
 
 
59
public:
 
60
  typedef TlsClientConnection CppObjectType;
 
61
  typedef TlsClientConnection_Class CppClassType;
 
62
  typedef GTlsClientConnection BaseObjectType;
 
63
  typedef GTlsClientConnectionInterface BaseClassType;
 
64
 
 
65
private:
 
66
  friend class TlsClientConnection_Class;
 
67
  static CppClassType tlsclientconnection_class_;
 
68
 
 
69
  // noncopyable
 
70
  TlsClientConnection(const TlsClientConnection&);
 
71
  TlsClientConnection& operator=(const TlsClientConnection&);
 
72
 
 
73
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
74
protected:
 
75
  /**
 
76
   * You should derive from this class to use it.
 
77
   */
 
78
  TlsClientConnection();
 
79
  
 
80
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
81
  /** Called by constructors of derived classes. Provide the result of 
 
82
   * the Class init() function to ensure that it is properly 
 
83
   * initialized.
 
84
   * 
 
85
   * @param interface_class The Class object for the derived type.
 
86
   */
 
87
  explicit TlsClientConnection(const Glib::Interface_Class& interface_class);
 
88
 
 
89
public:
 
90
  // This is public so that C++ wrapper instances can be
 
91
  // created for C instances of unwrapped types.
 
92
  // For instance, if an unexpected C type implements the C interface. 
 
93
  explicit TlsClientConnection(GTlsClientConnection* castitem);
 
94
 
 
95
protected:
 
96
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
97
 
 
98
public:
 
99
  virtual ~TlsClientConnection();
 
100
 
 
101
  static void add_interface(GType gtype_implementer);
 
102
 
 
103
  /** Get the GType for this class, for use with the underlying GObject type system.
 
104
   */
 
105
  static GType get_type()      G_GNUC_CONST;
 
106
 
 
107
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
108
  static GType get_base_type() G_GNUC_CONST;
 
109
#endif
 
110
 
 
111
  ///Provides access to the underlying C GObject.
 
112
  GTlsClientConnection*       gobj()       { return reinterpret_cast<GTlsClientConnection*>(gobject_); }
 
113
 
 
114
  ///Provides access to the underlying C GObject.
 
115
  const GTlsClientConnection* gobj() const { return reinterpret_cast<GTlsClientConnection*>(gobject_); }
 
116
 
 
117
private:
 
118
 
 
119
 
 
120
public:
 
121
  //TODO: This new function creates an IOStream, not a TlsClientConnection:
 
122
  // GIOStream* g_tls_client_connection_new(GIOStream *base_io_stream, GSocketConnectable *server_identity, GError **error);
 
123
 
 
124
  
 
125
  /** Sets @a conn's expected server identity, which is used both to tell
 
126
   * servers on virtual hosts which certificate to present, and also
 
127
   * to let @a conn know what name to look for in the certificate when
 
128
   * performing TLS_CERTIFICATE_BAD_IDENTITY validation, if enabled.
 
129
   * 
 
130
   * @newin{2,28}
 
131
   * @param identity A SocketConnectable describing the expected server identity.
 
132
   */
 
133
  void set_server_identity(const Glib::RefPtr<SocketConnectable>& identity);
 
134
 
 
135
  
 
136
  /** Gets @a conn's expected server identity
 
137
   * 
 
138
   * @newin{2,28}
 
139
   * @return A SocketConnectable describing the
 
140
   * expected server identity, or <tt>0</tt> if the expected identity is not
 
141
   * known.
 
142
   */
 
143
  Glib::RefPtr<SocketConnectable> get_server_identity();
 
144
  
 
145
  /** Gets @a conn's expected server identity
 
146
   * 
 
147
   * @newin{2,28}
 
148
   * @return A SocketConnectable describing the
 
149
   * expected server identity, or <tt>0</tt> if the expected identity is not
 
150
   * known.
 
151
   */
 
152
  Glib::RefPtr<const SocketConnectable> get_server_identity() const;
 
153
 
 
154
  
 
155
  /** Sets @a conn's validation flags, to override the default set of
 
156
   * checks performed when validating a server certificate. By default,
 
157
   * TLS_CERTIFICATE_VALIDATE_ALL is used.
 
158
   * 
 
159
   * @newin{2,28}
 
160
   * @param flags The TlsCertificateFlags to use.
 
161
   */
 
162
  void set_validation_flags(TlsCertificateFlags flags);
 
163
  
 
164
  /** Gets @a conn's validation flags
 
165
   * 
 
166
   * @newin{2,28}
 
167
   * @return The validation flags.
 
168
   */
 
169
  TlsCertificateFlags get_validation_flags() const;
 
170
 
 
171
  
 
172
  /** If @a use_ssl3 is <tt>true</tt>, this forces @a conn to use SSL 3.0 rather than
 
173
   * trying to properly negotiate the right version of TLS or SSL to use.
 
174
   * This can be used when talking to servers that do not implement the
 
175
   * fallbacks correctly and which will therefore fail to handshake with
 
176
   * a "modern" TLS handshake attempt.
 
177
   * 
 
178
   * @newin{2,28}
 
179
   * @param use_ssl3 Whether to use SSL 3.0.
 
180
   */
 
181
  void set_use_ssl3(bool use_ssl3);
 
182
  
 
183
  /** Gets whether @a conn will use SSL 3.0 rather than the
 
184
   * highest-supported version of TLS; see
 
185
   * g_tls_client_connection_set_use_ssl3().
 
186
   * 
 
187
   * @newin{2,28}
 
188
   * @return Whether @a conn will use SSL 3.0.
 
189
   */
 
190
  bool get_use_ssl3() const;
 
191
 
 
192
  //TODO: _WRAP_METHOD(GList* get_accepted_cas(), g_tls_client_connection_get_accepted_cas)
 
193
 
 
194
  //TODO: _WRAP_PROPERTY("accepted-cas", gpointer)
 
195
 
 
196
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
197
/** GSocketConnectable identifying the server.
 
198
   *
 
199
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
200
   * @return A PropertyProxy that allows you to get or set the value of the property,
 
201
   * or receive notification when the value of the property changes.
 
202
   */
 
203
  Glib::PropertyProxy< Glib::RefPtr<SocketConnectable> > property_server_identity() ;
 
204
#endif //#GLIBMM_PROPERTIES_ENABLED
 
205
 
 
206
#ifdef GLIBMM_PROPERTIES_ENABLED
 
207
/** GSocketConnectable identifying the server.
 
208
   *
 
209
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
210
   * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
 
211
   * or receive notification when the value of the property changes.
 
212
   */
 
213
  Glib::PropertyProxy_ReadOnly< Glib::RefPtr<SocketConnectable> > property_server_identity() const;
 
214
#endif //#GLIBMM_PROPERTIES_ENABLED
 
215
 
 
216
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
217
/** Use SSL 3.0 rather than trying to use TLS 1.x.
 
218
   *
 
219
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
220
   * @return A PropertyProxy that allows you to get or set the value of the property,
 
221
   * or receive notification when the value of the property changes.
 
222
   */
 
223
  Glib::PropertyProxy< bool > property_use_ssl3() ;
 
224
#endif //#GLIBMM_PROPERTIES_ENABLED
 
225
 
 
226
#ifdef GLIBMM_PROPERTIES_ENABLED
 
227
/** Use SSL 3.0 rather than trying to use TLS 1.x.
 
228
   *
 
229
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
230
   * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
 
231
   * or receive notification when the value of the property changes.
 
232
   */
 
233
  Glib::PropertyProxy_ReadOnly< bool > property_use_ssl3() const;
 
234
#endif //#GLIBMM_PROPERTIES_ENABLED
 
235
 
 
236
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
237
/** What certificate validation to perform.
 
238
   *
 
239
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
240
   * @return A PropertyProxy that allows you to get or set the value of the property,
 
241
   * or receive notification when the value of the property changes.
 
242
   */
 
243
  Glib::PropertyProxy< TlsCertificateFlags > property_validation_flags() ;
 
244
#endif //#GLIBMM_PROPERTIES_ENABLED
 
245
 
 
246
#ifdef GLIBMM_PROPERTIES_ENABLED
 
247
/** What certificate validation to perform.
 
248
   *
 
249
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
250
   * @return A PropertyProxy_ReadOnly that allows you to get the value of the property,
 
251
   * or receive notification when the value of the property changes.
 
252
   */
 
253
  Glib::PropertyProxy_ReadOnly< TlsCertificateFlags > property_validation_flags() const;
 
254
#endif //#GLIBMM_PROPERTIES_ENABLED
 
255
 
 
256
 
 
257
public:
 
258
 
 
259
public:
 
260
  //C++ methods used to invoke GTK+ virtual functions:
 
261
 
 
262
protected:
 
263
  //GTK+ Virtual Functions (override these to change behaviour):
 
264
 
 
265
  //Default Signal Handlers::
 
266
 
 
267
 
 
268
};
 
269
 
 
270
} // namespace Gio
 
271
 
 
272
 
 
273
namespace Glib
 
274
{
 
275
  /** A Glib::wrap() method for this object.
 
276
   * 
 
277
   * @param object The C instance.
 
278
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
 
279
   * @result A C++ instance that wraps this C instance.
 
280
   *
 
281
   * @relates Gio::TlsClientConnection
 
282
   */
 
283
  Glib::RefPtr<Gio::TlsClientConnection> wrap(GTlsClientConnection* object, bool take_copy = false);
 
284
 
 
285
} // namespace Glib
 
286
 
 
287
 
 
288
#endif /* _GIOMM_TLSCLIENTCONNECTION_H */
 
289