/*
 * Copyright (C) 2023-2025 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 program 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 program 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 program; 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_LOCALIZED_STRING_H
#define BIRB_LOCALIZED_STRING_H

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

#include "birbversion.h"

G_BEGIN_DECLS

#define BIRB_TYPE_LOCALIZED_STRING (birb_localized_string_get_type())

/**
 * BirbLocalizedString:
 *
 * A string object that contains an identifier and a translated label.
 *
 * It was created to be used in a [iface@Gio.ListModel].
 *
 * Since: 0.5
 */
BIRB_AVAILABLE_IN_0_5
G_DECLARE_FINAL_TYPE(BirbLocalizedString, birb_localized_string, BIRB, LOCALIZED_STRING,
                     GObject)

/**
 * birb_localized_string_equal:
 * @str1: (nullable): the first instance
 * @str2: (nullable): the second instance
 *
 * Checks if two string objects have the same id.
 *
 * Returns: true if the strings have the same id.
 *
 * Since: 0.5
 */
BIRB_AVAILABLE_IN_0_5
gboolean birb_localized_string_equal(BirbLocalizedString *str1, BirbLocalizedString *str2);

/**
 * birb_localized_string_get_id:
 *
 * Gets the id.
 *
 * Returns: (nullable): The id.
 *
 * Since: 0.5
 */
BIRB_AVAILABLE_IN_0_5
const char *birb_localized_string_get_id(BirbLocalizedString *str);

/**
 * birb_localized_string_get_label:
 *
 * Gets the label.
 *
 * Returns: (nullable): The label.
 *
 * Since: 0.5
 */
BIRB_AVAILABLE_IN_0_5
const char *birb_localized_string_get_label(BirbLocalizedString *str);

/**
 * birb_localized_string_new:
 * @id: (transfer none) (nullable): the identifier
 * @label: (transfer none) (nullable): the localized string
 *
 * Creates a new localized string.
 *
 * Returns: (transfer full): The new instance.
 *
 * Since: 0.5
 */
BIRB_AVAILABLE_IN_0_5
BirbLocalizedString *birb_localized_string_new(const char *id, const char *label);

G_END_DECLS

#endif /* BIRB_LOCALIZED_STRING_H */
