/*
 * 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_STRING_H
#define PURPLE_ACCOUNT_SETTING_STRING_H

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

#include "purpleaccountsetting.h"
#include "purpleversion.h"

G_BEGIN_DECLS

/**
 * PurpleAccountSettingString:
 *
 * A string setting for an account.
 *
 * Since: 3.0
 */

#define PURPLE_TYPE_ACCOUNT_SETTING_STRING (purple_account_setting_string_get_type())

PURPLE_AVAILABLE_IN_3_0
G_DECLARE_FINAL_TYPE(PurpleAccountSettingString, purple_account_setting_string,
                     PURPLE, ACCOUNT_SETTING_STRING, PurpleAccountSetting)

/**
 * purple_account_setting_string_get_value:
 *
 * Gets the value of the setting.
 *
 * Returns: (nullable): The value.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
const char *purple_account_setting_string_get_value(PurpleAccountSettingString *setting);

/**
 * purple_account_setting_string_new:
 * @id: the id
 * @label: (nullable): the label
 * @default_value: the default value
 *
 * Creates a new string account setting.
 *
 * Returns: (type PurpleAccountSettingString): The new setting.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
PurpleAccountSetting *purple_account_setting_string_new(const char *id, const char *label, const char *default_value);

/**
 * purple_account_setting_string_set_value:
 * @value: (transfer none) (nullable): the new value
 *
 * Sets the value of the setting.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
void purple_account_setting_string_set_value(PurpleAccountSettingString *setting, const char *value);

G_END_DECLS

#endif /* PURPLE_ACCOUNT_SETTING_STRING_H */
