/*
 * 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_TIME_ZONE_H
#define BIRB_TIME_ZONE_H

#include <glib.h>

#include "birbversion.h"

G_BEGIN_DECLS

/**
 * birb_time_zone_clear:
 * @timezone_ptr: A pointer to a [type@GLib.TimeZone] reference.
 *
 * Clears a reference to a [type@GLib.TimeZone].
 *
 * If the reference is %NULL, this function does nothing. Otherwise, the
 * reference count of the [type@GLib.TimeZone] is decreased and the pointer is
 * set to %NULL.
 *
 * Since: 0.7
 */
BIRB_AVAILABLE_IN_0_7
void birb_time_zone_clear(GTimeZone **timezone_ptr);

/**
 * birb_time_zone_compare:
 * @tz1: (nullable) (transfer none): The pointer to the first
 *       [type@GLib.TimeZone] to compare.
 * @tz2: (nullable) (transfer none): The pointer to the second
 *       [type@GLib.TimeZone] to compare.
 *
 * Compare two [type@GLib.TimeZone] objects.
 *
 * Returns: -1, 0 or 1 if @tz1 is *less than*, *equal to* or
 *          *greater than* @tz2.
 *
 * Since: 0.7
 */
BIRB_AVAILABLE_IN_0_7
int birb_time_zone_compare(GTimeZone *tz1, GTimeZone *tz2);

/**
 * birb_time_zone_equal:
 * @tz1: (nullable) (transfer none): The pointer to the first
 *       [type@GLib.TimeZone] to compare.
 * @tz2: (nullable) (transfer none): The pointer to the second
 *       [type@GLib.TimeZone] to compare.
 *
 * Checks two [type@GLib.TimeZone] objects for equality.
 *
 * Returns: %TRUE if @tz1 and @tz2 are equal.
 *
 * Since: 0.7
 */
BIRB_AVAILABLE_IN_0_7
gboolean birb_time_zone_equal(GTimeZone *tz1, GTimeZone *tz2);

/**
 * birb_time_zone_set:
 * @timezone_ptr: (inout) (not optional) (nullable): A pointer to a
 *                [type@GLib.TimeZone] reference.
 * @new_timezone: (nullable) (transfer none): The new time zone to set.
 *
 * Updates @timezone_ptr to point to @new_timezone.
 *
 * If @timezone_ptr had a previous reference, it will be un-referenced.
 *
 * If @new_timezone is not %NULL, a new reference will be added when it is
 * assigned to @timezone_ptr.
 *
 * @timezone_ptr can not be %NULL but may point to a %NULL value.
 *
 * Returns: %TRUE if the value of @timezone_ptr changed, otherwise %FALSE.
 *
 * Since: 0.7
 */
BIRB_AVAILABLE_IN_0_7
gboolean birb_time_zone_set(GTimeZone **timezone_ptr, GTimeZone *new_timezone);

G_END_DECLS

#endif /* BIRB_TIME_ZONE_H */
