/* valaformalparameter.vala
 *
 * Copyright (C) 2006-2009  Jürg Billeter
 * Copyright (C) 2006-2008  Raffaele Sandrini
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 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
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Jürg Billeter <j@bitron.ch>
 *	Raffaele Sandrini <raffaele@sandrini.ch>
 */

#ifndef __VALA_VALAFORMALPARAMETER_H__
#define __VALA_VALAFORMALPARAMETER_H__

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <vala/valasymbol.h>
#include <vala/valacodenode.h>

G_BEGIN_DECLS


#define VALA_TYPE_FORMAL_PARAMETER (vala_formal_parameter_get_type ())
#define VALA_FORMAL_PARAMETER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_FORMAL_PARAMETER, ValaFormalParameter))
#define VALA_FORMAL_PARAMETER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_FORMAL_PARAMETER, ValaFormalParameterClass))
#define VALA_IS_FORMAL_PARAMETER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_FORMAL_PARAMETER))
#define VALA_IS_FORMAL_PARAMETER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_FORMAL_PARAMETER))
#define VALA_FORMAL_PARAMETER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_FORMAL_PARAMETER, ValaFormalParameterClass))

typedef struct _ValaFormalParameterPrivate ValaFormalParameterPrivate;

#define VALA_TYPE_PARAMETER_DIRECTION (vala_parameter_direction_get_type ())

/**
 * Represents a formal parameter in method and callback signatures.
 */
struct _ValaFormalParameter {
	ValaSymbol parent_instance;
	ValaFormalParameterPrivate * priv;
};

struct _ValaFormalParameterClass {
	ValaSymbolClass parent_class;
};

typedef enum  {
	VALA_PARAMETER_DIRECTION_IN,
	VALA_PARAMETER_DIRECTION_OUT,
	VALA_PARAMETER_DIRECTION_REF
} ValaParameterDirection;


ValaFormalParameter* vala_formal_parameter_construct (GType object_type, const char* name, ValaDataType* parameter_type, ValaSourceReference* source_reference);
ValaFormalParameter* vala_formal_parameter_new (const char* name, ValaDataType* parameter_type, ValaSourceReference* source_reference);
ValaFormalParameter* vala_formal_parameter_construct_with_ellipsis (GType object_type, ValaSourceReference* source_reference);
ValaFormalParameter* vala_formal_parameter_new_with_ellipsis (ValaSourceReference* source_reference);
void vala_formal_parameter_process_attributes (ValaFormalParameter* self);
ValaFormalParameter* vala_formal_parameter_copy (ValaFormalParameter* self);
ValaDataType* vala_formal_parameter_get_parameter_type (ValaFormalParameter* self);
void vala_formal_parameter_set_parameter_type (ValaFormalParameter* self, ValaDataType* value);
ValaParameterDirection vala_formal_parameter_get_direction (ValaFormalParameter* self);
void vala_formal_parameter_set_direction (ValaFormalParameter* self, ValaParameterDirection value);
gboolean vala_formal_parameter_get_ellipsis (ValaFormalParameter* self);
void vala_formal_parameter_set_ellipsis (ValaFormalParameter* self, gboolean value);
gboolean vala_formal_parameter_get_params_array (ValaFormalParameter* self);
void vala_formal_parameter_set_params_array (ValaFormalParameter* self, gboolean value);
ValaExpression* vala_formal_parameter_get_default_expression (ValaFormalParameter* self);
void vala_formal_parameter_set_default_expression (ValaFormalParameter* self, ValaExpression* value);
gboolean vala_formal_parameter_get_no_array_length (ValaFormalParameter* self);
void vala_formal_parameter_set_no_array_length (ValaFormalParameter* self, gboolean value);
gboolean vala_formal_parameter_get_array_null_terminated (ValaFormalParameter* self);
void vala_formal_parameter_set_array_null_terminated (ValaFormalParameter* self, gboolean value);
double vala_formal_parameter_get_cparameter_position (ValaFormalParameter* self);
void vala_formal_parameter_set_cparameter_position (ValaFormalParameter* self, double value);
double vala_formal_parameter_get_carray_length_parameter_position (ValaFormalParameter* self);
void vala_formal_parameter_set_carray_length_parameter_position (ValaFormalParameter* self, double value);
double vala_formal_parameter_get_cdelegate_target_parameter_position (ValaFormalParameter* self);
void vala_formal_parameter_set_cdelegate_target_parameter_position (ValaFormalParameter* self, double value);
gboolean vala_formal_parameter_get_async_only (ValaFormalParameter* self);
void vala_formal_parameter_set_async_only (ValaFormalParameter* self, gboolean value);
const char* vala_formal_parameter_get_ctype (ValaFormalParameter* self);
void vala_formal_parameter_set_ctype (ValaFormalParameter* self, const char* value);
GType vala_formal_parameter_get_type (void);
GType vala_parameter_direction_get_type (void);


G_END_DECLS

#endif
