/* valaproperty.vala
 *
 * Copyright (C) 2006-2009  Jürg Billeter
 *
 * 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_VALAPROPERTY_H__
#define __VALA_VALAPROPERTY_H__

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <ccode/valaccodeconstant.h>
#include <vala/valamember.h>
#include <vala/valalockable.h>
#include <vala/valacodenode.h>

G_BEGIN_DECLS


#define VALA_TYPE_PROPERTY (vala_property_get_type ())
#define VALA_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_PROPERTY, ValaProperty))
#define VALA_PROPERTY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_PROPERTY, ValaPropertyClass))
#define VALA_IS_PROPERTY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_PROPERTY))
#define VALA_IS_PROPERTY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_PROPERTY))
#define VALA_PROPERTY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_PROPERTY, ValaPropertyClass))

typedef struct _ValaPropertyPrivate ValaPropertyPrivate;

/**
 * Represents a property declaration in the source code.
 */
struct _ValaProperty {
	ValaMember parent_instance;
	ValaPropertyPrivate * priv;
};

struct _ValaPropertyClass {
	ValaMemberClass parent_class;
};


ValaProperty* vala_property_construct (GType object_type, const char* name, ValaDataType* property_type, ValaPropertyAccessor* get_accessor, ValaPropertyAccessor* set_accessor, ValaSourceReference* source_reference);
ValaProperty* vala_property_new (const char* name, ValaDataType* property_type, ValaPropertyAccessor* get_accessor, ValaPropertyAccessor* set_accessor, ValaSourceReference* source_reference);
char* vala_property_get_upper_case_cname (ValaProperty* self);
ValaCCodeConstant* vala_property_get_canonical_cconstant (ValaProperty* self);
void vala_property_process_attributes (ValaProperty* self);
gboolean vala_property_equals (ValaProperty* self, ValaProperty* prop2);
ValaDataType* vala_property_get_property_type (ValaProperty* self);
void vala_property_set_property_type (ValaProperty* self, ValaDataType* value);
ValaPropertyAccessor* vala_property_get_get_accessor (ValaProperty* self);
void vala_property_set_get_accessor (ValaProperty* self, ValaPropertyAccessor* value);
ValaPropertyAccessor* vala_property_get_set_accessor (ValaProperty* self);
void vala_property_set_set_accessor (ValaProperty* self, ValaPropertyAccessor* value);
ValaFormalParameter* vala_property_get_this_parameter (ValaProperty* self);
void vala_property_set_this_parameter (ValaProperty* self, ValaFormalParameter* value);
gboolean vala_property_get_notify (ValaProperty* self);
void vala_property_set_notify (ValaProperty* self, gboolean value);
gboolean vala_property_get_no_accessor_method (ValaProperty* self);
void vala_property_set_no_accessor_method (ValaProperty* self, gboolean value);
gboolean vala_property_get_interface_only (ValaProperty* self);
void vala_property_set_interface_only (ValaProperty* self, gboolean value);
gboolean vala_property_get_is_abstract (ValaProperty* self);
void vala_property_set_is_abstract (ValaProperty* self, gboolean value);
gboolean vala_property_get_is_virtual (ValaProperty* self);
void vala_property_set_is_virtual (ValaProperty* self, gboolean value);
gboolean vala_property_get_overrides (ValaProperty* self);
void vala_property_set_overrides (ValaProperty* self, gboolean value);
ValaField* vala_property_get_field (ValaProperty* self);
void vala_property_set_field (ValaProperty* self, ValaField* value);
MemberBinding vala_property_get_binding (ValaProperty* self);
void vala_property_set_binding (ValaProperty* self, MemberBinding value);
ValaProperty* vala_property_get_base_property (ValaProperty* self);
ValaProperty* vala_property_get_base_interface_property (ValaProperty* self);
ValaExpression* vala_property_get_default_expression (ValaProperty* self);
void vala_property_set_default_expression (ValaProperty* self, ValaExpression* value);
const char* vala_property_get_nick (ValaProperty* self);
void vala_property_set_nick (ValaProperty* self, const char* value);
const char* vala_property_get_blurb (ValaProperty* self);
void vala_property_set_blurb (ValaProperty* self, const char* value);
GType vala_property_get_type (void);


G_END_DECLS

#endif
