/*
 * Purple - Internet Messaging Library
 * Copyright (C) Pidgin Developers <devel@pidgin.im>
 *
 * Purple is the legal property of its developers, whose names are too numerous
 * to list here. Please refer to the COPYRIGHT file distributed with this
 * source distribution.
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 2 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 General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this library; if not, see <https://www.gnu.org/licenses/>.
 */

#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
# error "only <purple.h> may be included directly"
#endif

#ifndef PURPLE_CONVERSATION_MANAGER_SEAGULL_BACKEND_H
#define PURPLE_CONVERSATION_MANAGER_SEAGULL_BACKEND_H

#include <glib.h>
#include <glib-object.h>

#include "purpleconversationmanagerbackend.h"
#include "purpleversion.h"

G_BEGIN_DECLS

#define PURPLE_TYPE_CONVERSATION_MANAGER_SEAGULL_BACKEND (purple_conversation_manager_seagull_backend_get_type())

/**
 * PurpleConversationManagerSeagullBackend:
 *
 * A Seagull back end for loading and storing conversations for
 * [class@ConversationManager] in a SQLite database.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
G_DECLARE_FINAL_TYPE(PurpleConversationManagerSeagullBackend,
                     purple_conversation_manager_seagull_backend,
                     PURPLE, CONVERSATION_MANAGER_SEAGULL_BACKEND,
                     PurpleConversationManagerBackend)

/**
 * purple_conversation_manager_seagull_backend_new:
 * @filename: (nullable): the filename to use
 * @error: (out) (nullable): a return address for a #GError
 *
 * Attempts to create a new Seagull backend.
 *
 * If @filename is %NULL, an in memory database will be used.
 *
 * Returns: (transfer full) (nullable) (type PurpleConversationManagerSeagullBackend):
 *          The new instance on success, otherwise %NULL with @error set.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
PurpleConversationManagerBackend *purple_conversation_manager_seagull_backend_new(const char *filename, GError **error);

/**
 * purple_conversation_manager_seagull_backend_get_filename:
 *
 * Gets the filename of the database being used.
 *
 * Returns: The filename.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
const char *purple_conversation_manager_seagull_backend_get_filename(PurpleConversationManagerSeagullBackend *backend);

G_END_DECLS

#endif /* PURPLE_CONVERSATION_MANAGER_SEAGULL_BACKEND_H */
