1 // Generated by gmmproc 2.64.2 -- DO NOT MODIFY!
2
3
4 #include <glibmm.h>
5
6 #include <giomm/tlsclientconnection.h>
7 #include <giomm/private/tlsclientconnection_p.h>
8
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, see <http://www.gnu.org/licenses/>.
24 */
25
26 #include <gio/gio.h>
27 #include <giomm/socketconnectable.h>
28
29 namespace Gio
30 {
31
TlsClientConnection(GTlsClientConnection * castitem)32 TlsClientConnection::TlsClientConnection(GTlsClientConnection* castitem)
33 : TlsConnection(G_TLS_CONNECTION(castitem))
34 {
35 }
36
37 } // namespace Gio
38
39 namespace
40 {
41 } // anonymous namespace
42
43
44 namespace Glib
45 {
46
wrap(GTlsClientConnection * object,bool take_copy)47 Glib::RefPtr<Gio::TlsClientConnection> wrap(GTlsClientConnection* object, bool take_copy)
48 {
49 return Glib::RefPtr<Gio::TlsClientConnection>( dynamic_cast<Gio::TlsClientConnection*> (Glib::wrap_auto_interface<Gio::TlsClientConnection> ((GObject*)(object), take_copy)) );
50 //We use dynamic_cast<> in case of multiple inheritance.
51 }
52
53 } // namespace Glib
54
55
56 namespace Gio
57 {
58
59
60 /* The *_Class implementation: */
61
init()62 const Glib::Interface_Class& TlsClientConnection_Class::init()
63 {
64 if(!gtype_) // create the GType if necessary
65 {
66 // Glib::Interface_Class has to know the interface init function
67 // in order to add interfaces to implementing types.
68 class_init_func_ = &TlsClientConnection_Class::iface_init_function;
69
70 // We can not derive from another interface, and it is not necessary anyway.
71 gtype_ = g_tls_client_connection_get_type();
72 }
73
74 return *this;
75 }
76
iface_init_function(void * g_iface,void *)77 void TlsClientConnection_Class::iface_init_function(void* g_iface, void*)
78 {
79 const auto klass = static_cast<BaseClassType*>(g_iface);
80
81 //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
82 //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
83 g_assert(klass != nullptr);
84
85
86 }
87
88
wrap_new(GObject * object)89 Glib::ObjectBase* TlsClientConnection_Class::wrap_new(GObject* object)
90 {
91 return new TlsClientConnection((GTlsClientConnection*)(object));
92 }
93
94
95 /* The implementation: */
96
TlsClientConnection()97 TlsClientConnection::TlsClientConnection()
98 :
99 Glib::Interface(tlsclientconnection_class_.init())
100 {}
101
102
TlsClientConnection(const Glib::Interface_Class & interface_class)103 TlsClientConnection::TlsClientConnection(const Glib::Interface_Class& interface_class)
104 : Glib::Interface(interface_class)
105 {
106 }
107
TlsClientConnection(TlsClientConnection && src)108 TlsClientConnection::TlsClientConnection(TlsClientConnection&& src) noexcept
109 : Glib::Interface(std::move(src))
110 {}
111
operator =(TlsClientConnection && src)112 TlsClientConnection& TlsClientConnection::operator=(TlsClientConnection&& src) noexcept
113 {
114 Glib::Interface::operator=(std::move(src));
115 return *this;
116 }
117
~TlsClientConnection()118 TlsClientConnection::~TlsClientConnection() noexcept
119 {}
120
121 // static
add_interface(GType gtype_implementer)122 void TlsClientConnection::add_interface(GType gtype_implementer)
123 {
124 tlsclientconnection_class_.init().add_interface(gtype_implementer);
125 }
126
127 TlsClientConnection::CppClassType TlsClientConnection::tlsclientconnection_class_; // initialize static member
128
get_type()129 GType TlsClientConnection::get_type()
130 {
131 return tlsclientconnection_class_.init().get_type();
132 }
133
134
get_base_type()135 GType TlsClientConnection::get_base_type()
136 {
137 return g_tls_client_connection_get_type();
138 }
139
140
create(const Glib::RefPtr<IOStream> & base_io_stream,const Glib::RefPtr<const SocketConnectable> & server_identity)141 Glib::RefPtr<TlsClientConnection> TlsClientConnection::create(const Glib::RefPtr<IOStream>& base_io_stream, const Glib::RefPtr<const SocketConnectable>& server_identity)
142 {
143 GError* gerror = nullptr;
144 Glib::RefPtr<TlsClientConnection> retvalue = Glib::wrap(G_TLS_CLIENT_CONNECTION(g_tls_client_connection_new(Glib::unwrap(base_io_stream), const_cast<GSocketConnectable*>(Glib::unwrap(server_identity)), &(gerror))));
145 if(gerror)
146 ::Glib::Error::throw_exception(gerror);
147 return retvalue;
148 }
149
create(const Glib::RefPtr<IOStream> & base_io_stream)150 Glib::RefPtr<TlsClientConnection> TlsClientConnection::create(const Glib::RefPtr<IOStream>& base_io_stream)
151 {
152 GError* gerror = nullptr;
153 Glib::RefPtr<TlsClientConnection> retvalue = Glib::wrap(G_TLS_CLIENT_CONNECTION(g_tls_client_connection_new(Glib::unwrap(base_io_stream), nullptr, &(gerror))));
154 if(gerror)
155 ::Glib::Error::throw_exception(gerror);
156 return retvalue;
157 }
158
set_server_identity(const Glib::RefPtr<SocketConnectable> & identity)159 void TlsClientConnection::set_server_identity(const Glib::RefPtr<SocketConnectable>& identity)
160 {
161 g_tls_client_connection_set_server_identity(gobj(), const_cast<GSocketConnectable*>(Glib::unwrap(identity)));
162 }
163
get_server_identity()164 Glib::RefPtr<SocketConnectable> TlsClientConnection::get_server_identity()
165 {
166 Glib::RefPtr<SocketConnectable> retvalue = Glib::wrap(g_tls_client_connection_get_server_identity(gobj()));
167 if(retvalue)
168 retvalue->reference(); //The function does not do a ref for us.
169 return retvalue;
170 }
171
get_server_identity() const172 Glib::RefPtr<const SocketConnectable> TlsClientConnection::get_server_identity() const
173 {
174 return const_cast<TlsClientConnection*>(this)->get_server_identity();
175 }
176
set_validation_flags(TlsCertificateFlags flags)177 void TlsClientConnection::set_validation_flags(TlsCertificateFlags flags)
178 {
179 g_tls_client_connection_set_validation_flags(gobj(), ((GTlsCertificateFlags)(flags)));
180 }
181
get_validation_flags() const182 TlsCertificateFlags TlsClientConnection::get_validation_flags() const
183 {
184 return ((TlsCertificateFlags)(g_tls_client_connection_get_validation_flags(const_cast<GTlsClientConnection*>(gobj()))));
185 }
186
187 #ifndef GIOMM_DISABLE_DEPRECATED
188 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
set_use_ssl3(bool use_ssl3)189 void TlsClientConnection::set_use_ssl3(bool use_ssl3)
190 {
191 g_tls_client_connection_set_use_ssl3(gobj(), static_cast<int>(use_ssl3));
192 }
193 G_GNUC_END_IGNORE_DEPRECATIONS
194 #endif // GIOMM_DISABLE_DEPRECATED
195
196 #ifndef GIOMM_DISABLE_DEPRECATED
197 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
get_use_ssl3() const198 bool TlsClientConnection::get_use_ssl3() const
199 {
200 return g_tls_client_connection_get_use_ssl3(const_cast<GTlsClientConnection*>(gobj()));
201 }
202 G_GNUC_END_IGNORE_DEPRECATIONS
203 #endif // GIOMM_DISABLE_DEPRECATED
204
get_accepted_cas()205 std::vector< Glib::RefPtr<Glib::ByteArray> > TlsClientConnection::get_accepted_cas()
206 {
207 return Glib::ListHandler< Glib::RefPtr<Glib::ByteArray> >::list_to_vector(g_tls_client_connection_get_accepted_cas(gobj()), Glib::OWNERSHIP_DEEP);
208 }
209
get_accepted_cas() const210 std::vector< Glib::RefPtr<const Glib::ByteArray> > TlsClientConnection::get_accepted_cas() const
211 {
212 return Glib::ListHandler< Glib::RefPtr<const Glib::ByteArray> >::list_to_vector(g_tls_client_connection_get_accepted_cas(const_cast<GTlsClientConnection*>(gobj())), Glib::OWNERSHIP_DEEP);
213 }
214
copy_session_state(const Glib::RefPtr<TlsClientConnection> & source)215 void TlsClientConnection::copy_session_state(const Glib::RefPtr<TlsClientConnection>& source)
216 {
217 g_tls_client_connection_copy_session_state(gobj(), Glib::unwrap(source));
218 }
219
220
221 #ifndef GIOMM_DISABLE_DEPRECATED
222
property_accepted_cas() const223 Glib::PropertyProxy_ReadOnly< std::vector< Glib::RefPtr<Glib::ByteArray> > > TlsClientConnection::property_accepted_cas() const
224 {
225 return Glib::PropertyProxy_ReadOnly< std::vector< Glib::RefPtr<Glib::ByteArray> > >(this, "accepted-cas");
226 }
227 #endif // GIOMM_DISABLE_DEPRECATED
228
229
property_server_identity()230 Glib::PropertyProxy< Glib::RefPtr<SocketConnectable> > TlsClientConnection::property_server_identity()
231 {
232 return Glib::PropertyProxy< Glib::RefPtr<SocketConnectable> >(this, "server-identity");
233 }
234
property_server_identity() const235 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<SocketConnectable> > TlsClientConnection::property_server_identity() const
236 {
237 return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<SocketConnectable> >(this, "server-identity");
238 }
239
240 #ifndef GIOMM_DISABLE_DEPRECATED
241
property_use_ssl3()242 Glib::PropertyProxy< bool > TlsClientConnection::property_use_ssl3()
243 {
244 return Glib::PropertyProxy< bool >(this, "use-ssl3");
245 }
246 #endif // GIOMM_DISABLE_DEPRECATED
247
248
249 #ifndef GIOMM_DISABLE_DEPRECATED
250
property_use_ssl3() const251 Glib::PropertyProxy_ReadOnly< bool > TlsClientConnection::property_use_ssl3() const
252 {
253 return Glib::PropertyProxy_ReadOnly< bool >(this, "use-ssl3");
254 }
255 #endif // GIOMM_DISABLE_DEPRECATED
256
257
property_validation_flags()258 Glib::PropertyProxy< TlsCertificateFlags > TlsClientConnection::property_validation_flags()
259 {
260 return Glib::PropertyProxy< TlsCertificateFlags >(this, "validation-flags");
261 }
262
property_validation_flags() const263 Glib::PropertyProxy_ReadOnly< TlsCertificateFlags > TlsClientConnection::property_validation_flags() const
264 {
265 return Glib::PropertyProxy_ReadOnly< TlsCertificateFlags >(this, "validation-flags");
266 }
267
268
269 } // namespace Gio
270
271
272