/* 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, see <http://www.gnu.org/licenses/>.
 */

#include <giomm/tlsdatabase.h>
#include <glibmm/interface.h>

_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/interface_p.h)
_PINCLUDE(giomm/private/tlsdatabase_p.h)
_PINCLUDE(gio/gio.h)

#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GTlsFileDatabaseInterface GTlsFileDatabaseInterface;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

namespace Gio
{
// commit e28f5093dced2e8cafef5795c02657b7265b78ca
// Author: José Alburquerque <jaalburqu@svn.gnome.org>
// Date:   Tue Mar 26 10:48:59 2013 -0400
//    TlsFileDatabase: Remove the class until its usage is more clear.

// TODO: If this class is ever added to the build system, consider restructuring
// like TlsClientConnectionImpl and TlsServerConnectionImpl.
// class GIOMM_API TlsFileDatabase : public Glib::Interface
// class GIOMM_API TlsFileDatabaseImpl : public TlsFileDatabase, public TlsDatabase

// It's unusual that a subclass of Glib::Object is a base class of an interface.
// For a discussion, see https://bugzilla.gnome.org/show_bug.cgi?id=776537
// especially the last paragraph of comment 6.

/** TlsFileDatabase - TLS file based database type.
 * TlsFileDatabase is implemented by TlsDatabase objects which load their
 * certificate information from a file. It is an interface which TLS library
 * specific subtypes implement.
 *
 * @newin{2,36}
 */
class GIOMM_API TlsFileDatabase
: public Glib::Interface,
  public TlsDatabase
{
  _CLASS_INTERFACE(TlsFileDatabase, GTlsFileDatabase, G_TLS_FILE_DATABASE, GTlsFileDatabaseInterface, , , GIOMM_API)

public:
  // It's not possible to use _WRAP_CTOR/_WRAP_CREATE to wrap the new
  // function because this is an interface.
#m4 _CONVERSION(`GTlsDatabase*',`Glib::RefPtr<TlsFileDatabase>',`Glib::wrap(G_TLS_FILE_DATABASE($3))')
  _WRAP_METHOD(static Glib::RefPtr<TlsFileDatabase> create(const std::string& anchors), g_tls_file_database_new, errthrow)

  _WRAP_PROPERTY("anchors", std::string)
};

} // namespace Gio
