// Generated by gtkmmproc -- DO NOT MODIFY!


#include <glibmm.h>

#include <giomm/tlsdatabase.h>
#include <giomm/private/tlsdatabase_p.h>


/* Copyright (C) 2013 The giomm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gio/gio.h>
#include <giomm/cancellable.h>
#include <giomm/socketconnectable.h>
#include <giomm/tlscertificate.h>
#include <giomm/tlsinteraction.h>
#include "slot_async.h"

namespace Gio
{

} // namespace Gio

namespace
{
} // anonymous namespace

// static
GType Glib::Value<Gio::TlsDatabaseVerifyFlags>::value_type()
{
  return g_tls_database_verify_flags_get_type();
}

// static
GType Glib::Value<Gio::TlsDatabaseLookupFlags>::value_type()
{
  return g_tls_database_lookup_flags_get_type();
}


namespace Glib
{

Glib::RefPtr<Gio::TlsDatabase> wrap(GTlsDatabase* object, bool take_copy)
{
  return Glib::RefPtr<Gio::TlsDatabase>( dynamic_cast<Gio::TlsDatabase*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} /* namespace Glib */


namespace Gio
{


/* The *_Class implementation: */

const Glib::Class& TlsDatabase_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &TlsDatabase_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(g_tls_database_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:
  TlsFileDatabase::add_interface(get_type());

  }

  return *this;
}


void TlsDatabase_Class::class_init_function(void* g_class, void* class_data)
{
  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);


}


Glib::ObjectBase* TlsDatabase_Class::wrap_new(GObject* object)
{
  return new TlsDatabase((GTlsDatabase*)object);
}


/* The implementation: */

GTlsDatabase* TlsDatabase::gobj_copy()
{
  reference();
  return gobj();
}

TlsDatabase::TlsDatabase(const Glib::ConstructParams& construct_params)
:
  Glib::Object(construct_params)
{

}

TlsDatabase::TlsDatabase(GTlsDatabase* castitem)
:
  Glib::Object((GObject*)(castitem))
{}


TlsDatabase::~TlsDatabase()
{}


TlsDatabase::CppClassType TlsDatabase::tlsdatabase_class_; // initialize static member

GType TlsDatabase::get_type()
{
  return tlsdatabase_class_.init().get_type();
}


GType TlsDatabase::get_base_type()
{
  return g_tls_database_get_type();
}


TlsDatabase::TlsDatabase()
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(0),
  Glib::Object(Glib::ConstructParams(tlsdatabase_class_.init()))
{
  

}

TlsCertificateFlags TlsDatabase::verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable, TlsDatabaseVerifyFlags flags)
{
  GError* gerror = 0;
  TlsCertificateFlags retvalue = ((TlsCertificateFlags)(g_tls_database_verify_chain(gobj(), Glib::unwrap(chain), purpose.c_str(), const_cast<GSocketConnectable*>(Glib::unwrap(identity)), Glib::unwrap(interaction), ((GTlsDatabaseVerifyFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

TlsCertificateFlags TlsDatabase::verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity, const Glib::RefPtr<TlsInteraction>& interaction, TlsDatabaseVerifyFlags flags)
{
  GError* gerror = 0;
  TlsCertificateFlags retvalue = ((TlsCertificateFlags)(g_tls_database_verify_chain(gobj(), Glib::unwrap(chain), purpose.c_str(), const_cast<GSocketConnectable*>(Glib::unwrap(identity)), Glib::unwrap(interaction), ((GTlsDatabaseVerifyFlags)(flags)), 0, &(gerror))));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

TlsCertificateFlags TlsDatabase::verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity, const Glib::RefPtr<Cancellable>& cancellable, TlsDatabaseVerifyFlags flags)
{
  GError* gerror = 0;
  TlsCertificateFlags retvalue = ((TlsCertificateFlags)(g_tls_database_verify_chain(gobj(), Glib::unwrap(chain), purpose.c_str(), const_cast<GSocketConnectable*>(Glib::unwrap(identity)), 0, ((GTlsDatabaseVerifyFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

TlsCertificateFlags TlsDatabase::verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity, TlsDatabaseVerifyFlags flags)
{
  GError* gerror = 0;
  TlsCertificateFlags retvalue = ((TlsCertificateFlags)(g_tls_database_verify_chain(gobj(), Glib::unwrap(chain), purpose.c_str(), const_cast<GSocketConnectable*>(Glib::unwrap(identity)), 0, ((GTlsDatabaseVerifyFlags)(flags)), 0, &(gerror))));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

TlsCertificateFlags TlsDatabase::verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable, TlsDatabaseVerifyFlags flags)
{
  GError* gerror = 0;
  TlsCertificateFlags retvalue = ((TlsCertificateFlags)(g_tls_database_verify_chain(gobj(), Glib::unwrap(chain), purpose.c_str(), 0, Glib::unwrap(interaction), ((GTlsDatabaseVerifyFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

TlsCertificateFlags TlsDatabase::verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<TlsInteraction>& interaction, TlsDatabaseVerifyFlags flags)
{
  GError* gerror = 0;
  TlsCertificateFlags retvalue = ((TlsCertificateFlags)(g_tls_database_verify_chain(gobj(), Glib::unwrap(chain), purpose.c_str(), 0, Glib::unwrap(interaction), ((GTlsDatabaseVerifyFlags)(flags)), 0, &(gerror))));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

TlsCertificateFlags TlsDatabase::verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<Cancellable>& cancellable, TlsDatabaseVerifyFlags flags)
{
  GError* gerror = 0;
  TlsCertificateFlags retvalue = ((TlsCertificateFlags)(g_tls_database_verify_chain(gobj(), Glib::unwrap(chain), purpose.c_str(), 0, 0, ((GTlsDatabaseVerifyFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror))));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

TlsCertificateFlags TlsDatabase::verify_chain(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, TlsDatabaseVerifyFlags flags)
{
  GError* gerror = 0;
  TlsCertificateFlags retvalue = ((TlsCertificateFlags)(g_tls_database_verify_chain(gobj(), Glib::unwrap(chain), purpose.c_str(), 0, 0, ((GTlsDatabaseVerifyFlags)(flags)), 0, &(gerror))));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

void TlsDatabase::verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, TlsDatabaseVerifyFlags flags)
{
  // Create a copy of the slot.
  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); 

  g_tls_database_verify_chain_async(gobj(), Glib::unwrap(chain), purpose.c_str(), const_cast<GSocketConnectable*>(Glib::unwrap(identity)), Glib::unwrap(interaction), ((GTlsDatabaseVerifyFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &SignalProxy_async_callback, slot_copy);
}

void TlsDatabase::verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot, TlsDatabaseVerifyFlags flags)
{
  // Create a copy of the slot.
  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); 

  g_tls_database_verify_chain_async(gobj(), Glib::unwrap(chain), purpose.c_str(), const_cast<GSocketConnectable*>(Glib::unwrap(identity)), Glib::unwrap(interaction), ((GTlsDatabaseVerifyFlags)(flags)), 0, &SignalProxy_async_callback, slot_copy);
}

void TlsDatabase::verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, TlsDatabaseVerifyFlags flags)
{
  // Create a copy of the slot.
  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); 

  g_tls_database_verify_chain_async(gobj(), Glib::unwrap(chain), purpose.c_str(), const_cast<GSocketConnectable*>(Glib::unwrap(identity)), 0, ((GTlsDatabaseVerifyFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &SignalProxy_async_callback, slot_copy);
}

void TlsDatabase::verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<const SocketConnectable>& identity, const SlotAsyncReady& slot, TlsDatabaseVerifyFlags flags)
{
  // Create a copy of the slot.
  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); 

  g_tls_database_verify_chain_async(gobj(), Glib::unwrap(chain), purpose.c_str(), const_cast<GSocketConnectable*>(Glib::unwrap(identity)), 0, ((GTlsDatabaseVerifyFlags)(flags)), 0, &SignalProxy_async_callback, slot_copy);
}

void TlsDatabase::verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, TlsDatabaseVerifyFlags flags)
{
  // Create a copy of the slot.
  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); 

  g_tls_database_verify_chain_async(gobj(), Glib::unwrap(chain), purpose.c_str(), 0, Glib::unwrap(interaction), ((GTlsDatabaseVerifyFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &SignalProxy_async_callback, slot_copy);
}

void TlsDatabase::verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot, TlsDatabaseVerifyFlags flags)
{
  // Create a copy of the slot.
  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); 

  g_tls_database_verify_chain_async(gobj(), Glib::unwrap(chain), purpose.c_str(), 0, Glib::unwrap(interaction), ((GTlsDatabaseVerifyFlags)(flags)), 0, &SignalProxy_async_callback, slot_copy);
}

void TlsDatabase::verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, TlsDatabaseVerifyFlags flags)
{
  // Create a copy of the slot.
  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); 

  g_tls_database_verify_chain_async(gobj(), Glib::unwrap(chain), purpose.c_str(), 0, 0, ((GTlsDatabaseVerifyFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &SignalProxy_async_callback, slot_copy);
}

void TlsDatabase::verify_chain_async(const Glib::RefPtr<TlsCertificate>& chain, const Glib::ustring& purpose, const SlotAsyncReady& slot, TlsDatabaseVerifyFlags flags)
{
  // Create a copy of the slot.
  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); 

  g_tls_database_verify_chain_async(gobj(), Glib::unwrap(chain), purpose.c_str(), 0, 0, ((GTlsDatabaseVerifyFlags)(flags)), 0, &SignalProxy_async_callback, slot_copy);
}

TlsCertificateFlags TlsDatabase::verify_chain_finish(const Glib::RefPtr<AsyncResult>& result)
{
  GError* gerror = 0;
  TlsCertificateFlags retvalue = ((TlsCertificateFlags)(g_tls_database_verify_chain_finish(gobj(), Glib::unwrap(result), &(gerror))));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

Glib::RefPtr<TlsCertificate> TlsDatabase::lookup_certificate_issuer(const Glib::RefPtr<const TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable, TlsDatabaseLookupFlags flags)
{
  GError* gerror = 0;
  Glib::RefPtr<TlsCertificate> retvalue = Glib::wrap(g_tls_database_lookup_certificate_issuer(gobj(), const_cast<GTlsCertificate*>(Glib::unwrap(certificate)), Glib::unwrap(interaction), ((GTlsDatabaseLookupFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

Glib::RefPtr<TlsCertificate> TlsDatabase::lookup_certificate_issuer(const Glib::RefPtr<const TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, TlsDatabaseLookupFlags flags)
{
  GError* gerror = 0;
  Glib::RefPtr<TlsCertificate> retvalue = Glib::wrap(g_tls_database_lookup_certificate_issuer(gobj(), const_cast<GTlsCertificate*>(Glib::unwrap(certificate)), Glib::unwrap(interaction), ((GTlsDatabaseLookupFlags)(flags)), 0, &(gerror)));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

Glib::RefPtr<const TlsCertificate> TlsDatabase::lookup_certificate_issuer(const Glib::RefPtr<const TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable, TlsDatabaseLookupFlags flags) const
{
  return const_cast<TlsDatabase*>(this)->lookup_certificate_issuer(certificate, interaction, cancellable, flags);
}

Glib::RefPtr<const TlsCertificate> TlsDatabase::lookup_certificate_issuer(const Glib::RefPtr<const TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, TlsDatabaseLookupFlags flags) const
{
  return const_cast<TlsDatabase*>(this)->lookup_certificate_issuer(certificate, interaction, flags);
}

void TlsDatabase::lookup_certificate_issuer_async(const Glib::RefPtr<const TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, TlsDatabaseLookupFlags flags)
{
  // Create a copy of the slot.
  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); 

  g_tls_database_lookup_certificate_issuer_async(gobj(), const_cast<GTlsCertificate*>(Glib::unwrap(certificate)), Glib::unwrap(interaction), ((GTlsDatabaseLookupFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &SignalProxy_async_callback, slot_copy);
}

void TlsDatabase::lookup_certificate_issuer_async(const Glib::RefPtr<const TlsCertificate>& certificate, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot, TlsDatabaseLookupFlags flags)
{
  // Create a copy of the slot.
  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); 

  g_tls_database_lookup_certificate_issuer_async(gobj(), const_cast<GTlsCertificate*>(Glib::unwrap(certificate)), Glib::unwrap(interaction), ((GTlsDatabaseLookupFlags)(flags)), 0, &SignalProxy_async_callback, slot_copy);
}

Glib::RefPtr<TlsCertificate> TlsDatabase::lookup_certificate_issuer_finish(const Glib::RefPtr<AsyncResult>& result)
{
  GError* gerror = 0;
  Glib::RefPtr<TlsCertificate> retvalue = Glib::wrap(g_tls_database_lookup_certificate_issuer_finish(gobj(), Glib::unwrap(result), &(gerror)));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

Glib::ustring TlsDatabase::create_certificate_handle(const Glib::RefPtr<const TlsCertificate>& certificate) const
{
  return Glib::convert_return_gchar_ptr_to_ustring(g_tls_database_create_certificate_handle(const_cast<GTlsDatabase*>(gobj()), const_cast<GTlsCertificate*>(Glib::unwrap(certificate))));
}

Glib::RefPtr<TlsCertificate> TlsDatabase::lookup_certificate_for_handle(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable, TlsDatabaseLookupFlags flags)
{
  GError* gerror = 0;
  Glib::RefPtr<TlsCertificate> retvalue = Glib::wrap(g_tls_database_lookup_certificate_for_handle(gobj(), handle.c_str(), Glib::unwrap(interaction), ((GTlsDatabaseLookupFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

Glib::RefPtr<TlsCertificate> TlsDatabase::lookup_certificate_for_handle(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction, TlsDatabaseLookupFlags flags)
{
  GError* gerror = 0;
  Glib::RefPtr<TlsCertificate> retvalue = Glib::wrap(g_tls_database_lookup_certificate_for_handle(gobj(), handle.c_str(), Glib::unwrap(interaction), ((GTlsDatabaseLookupFlags)(flags)), 0, &(gerror)));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}

Glib::RefPtr<const TlsCertificate> TlsDatabase::lookup_certificate_for_handle(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction, const Glib::RefPtr<Cancellable>& cancellable, TlsDatabaseLookupFlags flags) const
{
  return const_cast<TlsDatabase*>(this)->lookup_certificate_for_handle(handle, interaction, cancellable, flags);
}

Glib::RefPtr<const TlsCertificate> TlsDatabase::lookup_certificate_for_handle(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction, TlsDatabaseLookupFlags flags) const
{
  return const_cast<TlsDatabase*>(this)->lookup_certificate_for_handle(handle, interaction, flags);
}

void TlsDatabase::lookup_certificate_for_handle_async(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, TlsDatabaseLookupFlags flags)
{
  // Create a copy of the slot.
  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); 

  g_tls_database_lookup_certificate_for_handle_async(gobj(), handle.c_str(), Glib::unwrap(interaction), ((GTlsDatabaseLookupFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &SignalProxy_async_callback, slot_copy);
}

void TlsDatabase::lookup_certificate_for_handle_async(const Glib::ustring& handle, const Glib::RefPtr<TlsInteraction>& interaction, const SlotAsyncReady& slot, TlsDatabaseLookupFlags flags)
{
  // Create a copy of the slot.
  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot); 

  g_tls_database_lookup_certificate_for_handle_async(gobj(), handle.c_str(), Glib::unwrap(interaction), ((GTlsDatabaseLookupFlags)(flags)), 0, &SignalProxy_async_callback, slot_copy);
}

Glib::RefPtr<TlsCertificate> TlsDatabase::lookup_certificate_for_handle_finish(const Glib::RefPtr<AsyncResult>& result)
{
  GError* gerror = 0;
  Glib::RefPtr<TlsCertificate> retvalue = Glib::wrap(g_tls_database_lookup_certificate_for_handle_finish(gobj(), Glib::unwrap(result), &(gerror)));
  if(gerror)
    ::Glib::Error::throw_exception(gerror);
  return retvalue;
}


} // namespace Gio


