/*
 * 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_COUNT_H
#define BIRB_COUNT_H

#include <glib.h>

#include <gio/gio.h>

#include "birbversion.h"

G_BEGIN_DECLS

/**
 * birb_count_list_model_items_changed:
 * @model: a list model
 * @counter: the address of the counter
 *
 * Updates @counter every time the [signal@Gio.ListModel::items-changed] signal
 * is called for @model.
 *
 * This is useful for unit tests around [iface@Gio.ListModel] implementations.
 *
 * Since: 0.4
 */
BIRB_AVAILABLE_IN_0_4
void birb_count_list_model_items_changed(GListModel *model, guint *counter);

/**
 * birb_count_property_changed:
 * @obj: the object
 * @name: (nullable): the property name
 * @counter: the address of the counter
 *
 * Counts how many times [signal@GObject.Object::notify] has been called.
 *
 * If @name is not %NULL, the detailed notify signal will be used.
 *
 * This is useful for unit tests to verify that their property changes are
 * emitting the notify signal.
 *
 * Since: 0.4
 */
BIRB_AVAILABLE_IN_0_4
void birb_count_property_changed(GObject *obj, const char *name, guint *counter);

G_END_DECLS

#endif /* BIRB_COUNT_H */
