/*
 * Purple - Internet Messaging Library
 * Copyright (C) Pidgin Developers <devel@pidgin.im>
 *
 * Purple 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(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
# error "only <purple.h> may be included directly"
#endif

#ifndef PURPLE_ACCOUNT_SETTING_H
#define PURPLE_ACCOUNT_SETTING_H

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

#include "purpleversion.h"

G_BEGIN_DECLS

/**
 * PurpleAccountSetting:
 *
 * A setting for an account.
 *
 * Since: 3.0
 */

#define PURPLE_TYPE_ACCOUNT_SETTING (purple_account_setting_get_type())

PURPLE_AVAILABLE_IN_3_0
G_DECLARE_DERIVABLE_TYPE(PurpleAccountSetting, purple_account_setting, PURPLE,
                         ACCOUNT_SETTING, GObject)

struct _PurpleAccountSettingClass {
	/*< private >*/
	GObjectClass parent;

	/*< private >*/
	gpointer reserved[4];
};

/**
 * purple_account_setting_changed:
 *
 * Emits the changed signal.
 *
 * This should be called by sub-classes when the value of their setting has
 * changed.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
void purple_account_setting_changed(PurpleAccountSetting *setting);

/**
 * purple_account_setting_get_advanced:
 *
 * Gets whether or not the setting is an "advanced" setting.
 *
 * Returns: true if the setting is an advanced setting.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
gboolean purple_account_setting_get_advanced(PurpleAccountSetting *setting);

/**
 * purple_account_setting_get_developer_mode:
 *
 * Gets whether or not the setting should be shown only in developer mode.
 *
 * Returns: true if the the setting should only be shown in developer mode.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
gboolean purple_account_setting_get_developer_mode(PurpleAccountSetting *setting);

/**
 * purple_account_setting_get_hint:
 *
 * Gets the hint for the setting.
 *
 * Returns: (nullable): The hint.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
const char *purple_account_setting_get_hint(PurpleAccountSetting *setting);

/**
 * purple_account_setting_get_id:
 *
 * Gets the id of the setting.
 *
 * Returns: The id.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
const char *purple_account_setting_get_id(PurpleAccountSetting *setting);

/**
 * purple_account_setting_get_label:
 *
 * Gets the label that should be displayed to the user.
 *
 * Returns: The label.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
const char *purple_account_setting_get_label(PurpleAccountSetting *setting);

/**
 * purple_account_setting_get_weight:
 *
 * Gets the weight of the setting.
 *
 * Returns: The weight.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
int purple_account_setting_get_weight(PurpleAccountSetting *setting);

/**
 * purple_account_setting_set_advanced:
 * @advanced: the new advanced value
 *
 * Sets whether or not the setting is an "advanced" setting.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
void purple_account_setting_set_advanced(PurpleAccountSetting *setting, gboolean advanced);

/**
 * purple_account_setting_set_developer_mode:
 * @developer_mode: the new developer mode value
 *
 * Sets whether or not the setting should only be shown in developer mode.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
void purple_account_setting_set_developer_mode(PurpleAccountSetting *setting, gboolean developer_mode);

/**
 * purple_account_setting_set_hint:
 * @hint: (nullable): the new hint
 *
 * Sets the hint for the setting.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
void purple_account_setting_set_hint(PurpleAccountSetting *setting, const char *hint);

/**
 * purple_account_setting_set_weight:
 * @weight: the new weight
 *
 * Sets the weight for the setting.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
void purple_account_setting_set_weight(PurpleAccountSetting *setting, int weight);

G_END_DECLS

#endif /* PURPLE_ACCOUNT_SETTING_H */
