/* Generated file (by generator) */

/*
 * SPDX-FileCopyrightText: 2015 William Yu <williamyu@gnome.org>
 *
 * SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "i-cal-vcard-parameter.h"
#include "libical-glib-private.h"
#include "i-cal-vcard-derived-value.h"
#include "i-cal-vcard-derived-parameter.h"

G_DEFINE_TYPE (ICalVcardParameter, i_cal_vcard_parameter, I_CAL_TYPE_OBJECT)

static void i_cal_vcard_parameter_class_init (G_GNUC_UNUSED ICalVcardParameterClass *klass)
{
}

static void i_cal_vcard_parameter_init (G_GNUC_UNUSED ICalVcardParameter *self)
{
}

/**
 * i_cal_vcard_parameter_new_full: (skip)
 * @native: The native libical object.
 * @owner: The parent.
 *
 * Create a new libical-glib object from the native libical object and the owner.
 *
 * Returns: (transfer full): The newly create libical-glib object.
 *
 * Since: 1.0
 **/
ICalVcardParameter *
i_cal_vcard_parameter_new_full (vcardparameter *native, 
                                GObject *owner)
{
    ICalVcardParameter *object;
    if (native == NULL) {
        return NULL;
    }
    
    
    object = i_cal_object_construct (I_CAL_VCARD_TYPE_PARAMETER,
                            (gpointer) native,
                            (GDestroyNotify) vcardparameter_free,
                            FALSE,
                            owner);

    return object;
}


/**
 * i_cal_vcard_parameter_new:
 * @kind: The type of #ICalVcardParameter to be created
 *
 * Creates a new #ICalVcardParameter of the @kind type.
 *
 * Returns: (transfer full): The newly created #ICalVcardParameter.
 *
 * Since: 4.0
 *
 **/
ICalVcardParameter *
i_cal_vcard_parameter_new (ICalVcardParameterKind kind)
{
	return i_cal_vcard_parameter_new_full (vcardparameter_new ((vcardparameter_kind) (kind)), NULL);
}

/**
 * i_cal_vcard_parameter_clone:
 * @param: (in): The #ICalVcardParameter to be cloned
 *
 * Deep clones the @param.
 *
 * Returns: (transfer full): The newly created #ICalVcardParameter as a clone of the @param.
 *
 * Since: 4.0
 *
 **/
ICalVcardParameter *
i_cal_vcard_parameter_clone (const ICalVcardParameter *param)
{
    g_return_val_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param), NULL);

	return i_cal_vcard_parameter_new_full (vcardparameter_clone ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param))), NULL);
}

/**
 * i_cal_vcard_parameter_new_from_string:
 * @value: (in) (transfer none): The string from which the #ICalVcardParameter is created
 *
 * Creates an #ICalVcardParameter from a string of form "PARAMNAME=VALUE".
 *
 * Returns: (transfer full): The newly created #ICalVcardParameter with the properties specified in the @value.
 *
 * Since: 4.0
 *
 **/
ICalVcardParameter *
i_cal_vcard_parameter_new_from_string (const gchar *value)
{
    g_return_val_if_fail (value != NULL, NULL);

	return i_cal_vcard_parameter_new_full (vcardparameter_new_from_string (value), NULL);
}

/**
 * i_cal_vcard_parameter_new_from_value_string:
 * @kind: The kind of #ICalVcardParameter to be created
 * @value: The string value of the parameter
 *
 * Creates a new #ICalVcardParameter of @kind and @value
 *
 * Returns: (transfer full): The newly created #ICalVcardParameter
 *
 * Since: 4.0
 *
 **/
ICalVcardParameter *
i_cal_vcard_parameter_new_from_value_string (ICalVcardParameterKind kind, 
                                             const gchar *value)
{
    g_return_val_if_fail (value != NULL, NULL);

	return i_cal_vcard_parameter_new_full (vcardparameter_new_from_value_string ((vcardparameter_kind) (kind), value), NULL);
}

/**
 * i_cal_vcard_parameter_set_value_from_string:
 * @param: An #ICalVcardParameter
 * @value: The string value to set
 *
 * Sets a @param value from string @value.
 *
 * Since: 4.0
 *
 **/
void
i_cal_vcard_parameter_set_value_from_string (ICalVcardParameter *param, 
                                             const gchar *value)
{
    g_return_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param));
    g_return_if_fail (value != NULL);

	vcardparameter_set_value_from_string ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param)), value);
}

/**
 * i_cal_vcard_parameter_add_value_from_string:
 * @param: An #ICalVcardParameter
 * @value: The string value to add
 *
 * Adds a @param value from string @value. This can be used for parameters which can hold multiple values.
 *
 * Since: 4.0
 *
 **/
void
i_cal_vcard_parameter_add_value_from_string (ICalVcardParameter *param, 
                                             const gchar *value)
{
    g_return_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param));
    g_return_if_fail (value != NULL);

	vcardparameter_add_value_from_string ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param)), value);
}

/**
 * i_cal_vcard_parameter_free: (skip)
 * @parameter: (in): The #ICalVcardParameter to be freed
 *
 * Frees the native part of the #ICalVcardParameter.
 *
 * Since: 4.0
 *
 **/
void
i_cal_vcard_parameter_free (ICalVcardParameter *parameter)
{
    g_return_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)parameter));

	vcardparameter_free ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)parameter)));
}

/**
 * i_cal_vcard_parameter_as_vcard_string:
 * @parameter: (in): The #ICalVcardParameter to be converted
 *
 * Converts an #ICalVcardParameter to the string representation.
 *
 * Returns: (transfer full): The string representation of the @parameter.
 *
 * Since: 4.0
 *
 **/
gchar *
i_cal_vcard_parameter_as_vcard_string (ICalVcardParameter *parameter)
{
    g_return_val_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)parameter), NULL);

	return i_cal_memory_str_to_glib (vcardparameter_as_vcard_string_r ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)parameter))));
}

/**
 * i_cal_vcard_parameter_isa:
 * @parameter: The #ICalVcardParameter to be determined for the kind
 *
 * Returns the kind of an #ICalVcardParameter.
 *
 * Returns: The kind of the @parameter.
 *
 * Since: 4.0
 *
 **/
ICalVcardParameterKind
i_cal_vcard_parameter_isa (ICalVcardParameter *parameter)
{
    g_return_val_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)parameter), I_CAL_VCARD_NO_PARAMETER);

	return (ICalVcardParameterKind) (vcardparameter_isa ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)parameter))));
}

/**
 * i_cal_vcard_parameter_isa_parameter:
 * @param: (in): The #ICalVcardParameter to be checked
 *
 * Checks whether the native part of the #ICalVcardParameter is of type #ICalVcardParameter.
 *
 * Returns: true if the native part is of type #ICalVcardParameter, false if not.
 *
 * Since: 4.0
 *
 **/
gboolean
i_cal_vcard_parameter_isa_parameter (ICalVcardParameter *param)
{
    g_return_val_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param), FALSE);

	return vcardparameter_isa_parameter ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param)));
}

/**
 * i_cal_vcard_parameter_set_xname:
 * @param: The #ICalVcardParameter of which the xname to be set
 * @v: The name to be set into the @param
 *
 * Sets the xname property of the native part of the #ICalVcardParameter.
 *
 * Since: 4.0
 *
 **/
void
i_cal_vcard_parameter_set_xname (ICalVcardParameter *param, 
                                 const gchar *v)
{
    g_return_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param));
    g_return_if_fail (v != NULL);

	vcardparameter_set_xname ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param)), v);
}

/**
 * i_cal_vcard_parameter_get_xname:
 * @param: The #ICalVcardParameter to be queried
 *
 * Gets the xname property of the native part of the #ICalVcardParameter.
 *
 * Returns: (nullable): The property of the @value
 *
 * Since: 4.0
 *
 **/
const gchar *
i_cal_vcard_parameter_get_xname (ICalVcardParameter *param)
{
    g_return_val_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param), NULL);

	return vcardparameter_get_xname ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param)));
}

/**
 * i_cal_vcard_parameter_set_xvalue:
 * @param: The #ICalVcardParameter of which the xvalue to be set
 * @v: The value to be set into the @param
 *
 * Sets the xvalue property of the native part of the #ICalVcardParameter.
 *
 * Since: 4.0
 *
 **/
void
i_cal_vcard_parameter_set_xvalue (ICalVcardParameter *param, 
                                  const gchar *v)
{
    g_return_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param));
    g_return_if_fail (v != NULL);

	vcardparameter_set_xvalue ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param)), v);
}

/**
 * i_cal_vcard_parameter_get_xvalue:
 * @param: The #ICalVcardParameter to be queried
 *
 * Gets the xvalue property of the native part of the #ICalVcardParameter.
 *
 * Returns: (nullable): The property of the @value
 *
 * Since: 4.0
 *
 **/
const gchar *
i_cal_vcard_parameter_get_xvalue (ICalVcardParameter *param)
{
    g_return_val_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param), NULL);

	return vcardparameter_get_xvalue ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param)));
}

/**
 * i_cal_vcard_parameter_set_iana_name:
 * @param: The #ICalVcardParameter of which the iana_name to be set
 * @v: The name to be set into the @param
 *
 * Sets the iana_name property of the native part of the #ICalVcardParameter.
 *
 * Since: 4.0
 *
 **/
void
i_cal_vcard_parameter_set_iana_name (ICalVcardParameter *param, 
                                     const gchar *v)
{
    g_return_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param));
    g_return_if_fail (v != NULL);

	vcardparameter_set_iana_name ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param)), v);
}

/**
 * i_cal_vcard_parameter_get_iana_name:
 * @param: The #ICalVcardParameter to be queried
 *
 * Gets the iana_name property of the native part of the #ICalVcardParameter.
 *
 * Returns: (nullable): The property of the @value
 *
 * Since: 4.0
 *
 **/
const gchar *
i_cal_vcard_parameter_get_iana_name (ICalVcardParameter *param)
{
    g_return_val_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param), NULL);

	return vcardparameter_get_iana_name ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param)));
}

/**
 * i_cal_vcard_parameter_set_iana_value:
 * @param: The #ICalVcardParameter of which the iana_value to be set
 * @v: The value to be set into the @param
 *
 * Sets the iana_value property of the native part of the #ICalVcardParameter.
 *
 * Since: 4.0
 *
 **/
void
i_cal_vcard_parameter_set_iana_value (ICalVcardParameter *param, 
                                      const gchar *v)
{
    g_return_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param));
    g_return_if_fail (v != NULL);

	vcardparameter_set_iana_value ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param)), v);
}

/**
 * i_cal_vcard_parameter_get_iana_value:
 * @param: The #ICalVcardParameter to be queried
 *
 * Gets the iana_value property of the native part of the #ICalVcardParameter.
 *
 * Returns: (nullable): The property of the @value
 *
 * Since: 4.0
 *
 **/
const gchar *
i_cal_vcard_parameter_get_iana_value (ICalVcardParameter *param)
{
    g_return_val_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param), NULL);

	return vcardparameter_get_iana_value ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param)));
}

/**
 * i_cal_vcard_parameter_has_same_name:
 * @param1: The #ICalVcardParameter to be checked
 * @param2: The #ICalVcardParameter to be checked
 *
 * Checks whether native parts of two #ICalVcardParameters have the same name.
 *
 * Returns: true if the parameters have the same name, false or not.
 *
 * Since: 4.0
 *
 **/
gboolean
i_cal_vcard_parameter_has_same_name (ICalVcardParameter *param1, 
                                     ICalVcardParameter *param2)
{
    g_return_val_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param1), FALSE);
    g_return_val_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param2), FALSE);

	return vcardparameter_has_same_name ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param1)), (vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param2)));
}

/**
 * i_cal_vcard_parameter_kind_to_string:
 * @kind: The #ICalVcardParameterKind to be converted
 *
 * Converts the @kind to the string representation.
 *
 * Returns: The string representation of @kind.
 *
 * Since: 4.0
 *
 **/
const gchar *
i_cal_vcard_parameter_kind_to_string (ICalVcardParameterKind kind)
{
	return vcardparameter_kind_to_string ((vcardparameter_kind) (kind));
}

/**
 * i_cal_vcard_parameter_string_to_kind:
 * @string: The string representation of the #ICalVcardParameterKind
 *
 * Converts a string to the #ICalVcardParameterKind.
 *
 * Returns: The #ICalVcardParameterKind converted from @string
 *
 * Since: 4.0
 *
 **/
ICalVcardParameterKind
i_cal_vcard_parameter_string_to_kind (const gchar *string)
{
    g_return_val_if_fail (string != NULL, I_CAL_VCARD_NO_PARAMETER);

	return (ICalVcardParameterKind) (vcardparameter_string_to_kind (string));
}

/**
 * i_cal_vcard_parameter_kind_is_valid:
 * @kind: The #ICalVcardPropertyKind
 *
 * Checks whether #ICalVcardParameterKind is valid.
 *
 * Returns: true if valid, false if not.
 *
 * Since: 4.0
 *
 **/
gboolean
i_cal_vcard_parameter_kind_is_valid (const ICalVcardParameterKind kind)
{
	return vcardparameter_kind_is_valid ((vcardparameter_kind) (kind));
}

/**
 * i_cal_vcard_parameter_kind_value_kind:
 * @kind: The #ICalVcardPropertyKind
 * @out_is_multivalued: (out): an out argument to store whether the @kind is multivalued
 *
 * Returns corresponding #ICalVcardValueKind for the given @kind and sets whether the @kind is a multivalued
 * parameter.
 *
 * Returns: an #ICalVcardValueKind for the parameter @kind
 *
 * Since: 4.0
 *
 **/
ICalVcardValueKind
i_cal_vcard_parameter_kind_value_kind (ICalVcardParameterKind kind, 
                                       gboolean *out_is_multivalued)
{
    g_return_val_if_fail (out_is_multivalued != NULL, I_CAL_VCARD_NO_VALUE);

	return (ICalVcardValueKind) (vcardparameter_kind_value_kind ((vcardparameter_kind) (kind), out_is_multivalued));
}

/**
 * i_cal_vcard_parameter_is_multivalued:
 * @param: An #ICalVcardParameter
 *
 * Returns whether @param is a multivalued parameter. Multivalued parameters can hold more than one value.
 *
 * Returns: true if the @param is a multivalued parameter.
 *
 * Since: 4.0
 *
 **/
gboolean
i_cal_vcard_parameter_is_multivalued (const ICalVcardParameter *param)
{
    g_return_val_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param), FALSE);

	return vcardparameter_is_multivalued ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param)));
}

/**
 * i_cal_vcard_parameter_is_structured:
 * @param: An #ICalVcardParameter
 *
 * Returns whether @param is a structured parameter. Structured parameters have their value encoded in a
 * specific format.
 *
 * Returns: true if the @param is a structured parameter.
 *
 * Since: 4.0
 *
 **/
gboolean
i_cal_vcard_parameter_is_structured (const ICalVcardParameter *param)
{
    g_return_val_if_fail (I_CAL_VCARD_IS_PARAMETER ((ICalVcardParameter*)param), FALSE);

	return vcardparameter_is_structured ((vcardparameter *)i_cal_object_get_native (I_CAL_OBJECT ((ICalObject *)param)));
}
