/*
 * Copyright (C) Birb Developers
 *
 * Birb is the legal property of its developers, whose names are too numerous
 * to list here. Please refer to the AUTHORS 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 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 <https://www.gnu.org/licenses/>.
 */

#if !defined(BIRB_GLOBAL_HEADER_INSIDE) && !defined(BIRB_COMPILATION)
# error "only <birb.h> may be included directly"
#endif

#ifndef BIRB_STRING_LIST_H
#define BIRB_STRING_LIST_H

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

#include "birbversion.h"

G_BEGIN_DECLS

#define BIRB_TYPE_STRING_LIST (birb_string_list_get_type())

/**
 * BirbStringList:
 *
 * A [iface@Gio.ListModel] that contains [class@StringObject]s.
 *
 * Since: 0.8
 */
BIRB_AVAILABLE_IN_0_8
G_DECLARE_FINAL_TYPE(BirbStringList, birb_string_list, BIRB, STRING_LIST,
                     GObject)

/**
 * birb_string_list_append:
 * @str: (nullable): the string to add
 *
 * Adds the string to the list.
 *
 * Since: 0.8
 */
BIRB_AVAILABLE_IN_0_8
void birb_string_list_append(BirbStringList *list, const char *str);

/**
 * birb_string_list_equal:
 * @list1: (nullable): the first instance
 * @list2: (nullable): the second instance
 *
 * Checks if two string lists are equal.
 *
 * Returns: true if the string lists contain the same items in the same order.
 *
 * Since: 0.8
 */
BIRB_AVAILABLE_IN_0_8
gboolean birb_string_list_equal(BirbStringList *list1, BirbStringList *list2);

/**
 * birb_string_list_new:
 *
 * Creates a new string list.
 *
 * Returns: (transfer full): The new instance.
 *
 * Since: 0.8
 */
BIRB_AVAILABLE_IN_0_8
BirbStringList *birb_string_list_new(void);

/**
 * birb_string_list_remove:
 * @str: (nullable): the string to remove
 *
 * Attempts to remove the first instance of a string from the list.
 *
 * Returns: true if the string was found and removed.
 *
 * Since: 0.8
 */
BIRB_AVAILABLE_IN_0_8
gboolean birb_string_list_remove(BirbStringList *list, const char *str);

G_END_DECLS

#endif /* BIRB_STRING_LIST_H */
