/*  libhrel - Holyrel library

    Copyright (C) 2005 Chong Kai Xiong <descender@phreaker.net>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library 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
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA  02111-1307  USA.
*/

#ifndef H_RELATION_PROJECT_H
#define H_RELATION_PROJECT_H

#include <glib.h>
#include <libhrel/relation.h>
#include <libhrel/hash_index.h>

G_BEGIN_DECLS

#define H_TYPE_RELATION_PROJECT            (h_relation_project_get_type ())
#define H_RELATION_PROJECT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), H_TYPE_RELATION_PROJECT, HRelationProject))
#define H_RELATION_PROJECT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST    ((klass), H_TYPE_RELATION_PROJECT, HRelationProjectClass))
#define H_IS_RELATION_PROJECT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), H_TYPE_RELATION_PROJECT))
#define H_IS_RELATION_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE    ((klass), H_TYPE_RELATION_PROJECT))
#define H_RELATION_PROJECT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS  ((obj), H_TYPE_RELATION_PROJECT, HRelationProjectClass))

typedef struct _HRelationProject      HRelationProject;
typedef struct _HRelationProjectClass HRelationProjectClass;

struct _HRelationProject
{
  HRelation   relation;

  HRelation  *to_project;
  HAttrMap   *attrs;
  HHashIndex *index;
};

struct _HRelationProjectClass
{
  HRelationClass relation_class;
};

GType      h_relation_project_get_type (void);
HRelation *h_relation_project          (HRelation *relation,
                                        ...);
HRelation *h_relation_project_l        (HRelation *relation,
                                        GSList    *list);

G_END_DECLS

#endif /* #ifndef H_RELATION_PROJECT_H */
