/*
 * Ibis - IRCv3 Library
 * Copyright (C) 2022-2025 Ibis Developers
 *
 * Ibis 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(IBIS_GLOBAL_HEADER_INSIDE) && !defined(IBIS_COMPILATION)
# error "only <ibis.h> may be included directly"
#endif

#ifndef IBIS_MODE_CHANGE_H
#define IBIS_MODE_CHANGE_H

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

#include "ibisversion.h"

G_BEGIN_DECLS

#define IBIS_TYPE_MODE_CHANGE (ibis_mode_change_get_type());

IBIS_AVAILABLE_IN_0_12
GType ibis_mode_change_get_type(void) G_GNUC_CONST;

typedef struct _IbisModeChange IbisModeChange;

/**
 * IbisModeChange:
 * @mode: the mode character
 * @add: true if this mode is being added, false if being removed
 * @parameter: the parameter if the mode requires one
 *
 * A data structure describing a single mode change.
 *
 * Since: 0.12
 */
IBIS_AVAILABLE_TYPE_IN_0_12
struct _IbisModeChange {
	char mode;
	gboolean add;
	char *parameter;
};

/**
 * ibis_mode_change_copy:
 * @mode_change: the instance to copy
 *
 * Creates a copy of a mode change.
 *
 * Returns: (transfer full): The new copy.
 *
 * Since: 0.12
 */
IBIS_AVAILABLE_IN_0_12
IbisModeChange *ibis_mode_change_copy(IbisModeChange *mode_change);

/**
 * ibis_mode_change_free:
 *
 * Frees a mode change.
 *
 * Since: 0.12
 */
IBIS_AVAILABLE_IN_0_12
void ibis_mode_change_free(IbisModeChange *mode_change);

/**
 * ibis_mode_change_new:
 * @mode: the mode character
 * @add: true if this mode is being added; otherwise false
 * @parameter: (nullable): an optional parameter
 *
 * Creates a new mode.
 *
 * Returns: (transfer full): The new mode.
 *
 * Since: 0.12
 */
IBIS_AVAILABLE_IN_0_12
IbisModeChange *ibis_mode_change_new(const char mode, gboolean add, const char *parameter);

G_END_DECLS

#endif /* IBIS_MODE_CHANGE_H */
