project.h 4.53 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/* project.h
 *
 * Copyright (C) 2010  Sébastien Granjoux
 *
 * This program 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 program 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 program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#ifndef _PROJECT_H_
#define _PROJECT_H_

#include <glib.h>
#include <glib-object.h>
#include <libanjuta/anjuta-plugin.h>
#include <libanjuta/anjuta-project.h>
29
#include <libanjuta/anjuta-plugin-handle.h>
30 31
#include <libanjuta/interfaces/ianjuta-project.h>

32 33
#include "project-model.h"
#include "tree-data.h"
34

35 36
G_BEGIN_DECLS

37 38 39 40 41 42
#define ANJUTA_TYPE_PM_PROJECT             (anjuta_pm_project_get_type ())
#define ANJUTA_PM_PROJECT(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_PM_PROJECT, AnjutaPmProject))
#define ANJUTA_PM_PROJECT_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), ANJUTA_TYPE_PM_PROJECT, AnjutaPmProjectClass))
#define ANJUTA_IS_PM_PROJECT(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_PM_PROJECT))
#define ANJUTA_IS_PM_PROJECT_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_PM_PROJECT))
#define ANJUTA_PM_PROJECT_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), ANJUTA_TYPE_PM_PROJECT, AnjutaPmProjectClass))
43

44 45
typedef struct _AnjutaPmProjectClass AnjutaPmProjectClass;
//typedef struct _AnjutaPmProject AnjutaPmProject;
46

47 48 49
struct _AnjutaPmProjectClass
{
	GObjectClass parent_class;
50

51
	void (*loaded) (AnjutaPmProject* project, AnjutaProjectNode *node, gboolean complete, GError *error);
52
};
53

54 55 56
struct _AnjutaPmProject
{
	GObject parent_instance;
57

58
	AnjutaPlugin *plugin;
59

60
	IAnjutaProject *project;
61
	AnjutaPluginHandle *backend;
62

63
	AnjutaProjectNode *root;
64

65
	guint incomplete_node;
66 67

	gboolean loaded;
68 69

	gint node_capabilities;
70

71 72
	/* project properties dialog */
	GtkWidget *properties_dialog;
73
};
74

75
GType anjuta_pm_project_get_type (void) G_GNUC_CONST;
76

77 78
AnjutaPmProject* anjuta_pm_project_new (AnjutaPlugin *plugin);
void anjuta_pm_project_free (AnjutaPmProject* project);
79

80
gboolean anjuta_pm_project_load (AnjutaPmProject *project, GFile *file, GError **error);
81
gboolean anjuta_pm_project_load_with_backend (AnjutaPmProject *project, GFile *file, AnjutaPluginHandle *backend, GError **error);
82 83 84
gboolean anjuta_pm_project_unload (AnjutaPmProject *project, GError **error);
gboolean anjuta_pm_project_refresh (AnjutaPmProject *project, GError **error);

85
gint anjuta_pm_project_get_capabilities (AnjutaPmProject *project);
86
const GList *anjuta_pm_project_get_node_info (AnjutaPmProject *project);
87 88 89

GList *anjuta_pm_project_get_packages (AnjutaPmProject *project);

90 91 92
AnjutaProjectNode *anjuta_pm_project_add_group (AnjutaPmProject *project, AnjutaProjectNode *parent, AnjutaProjectNode *sibling, const gchar *name, GError **error);
AnjutaProjectNode *anjuta_pm_project_add_target (AnjutaPmProject *project, AnjutaProjectNode *parent, AnjutaProjectNode *sibling, const gchar *name, AnjutaProjectNodeType type, GError **error);
AnjutaProjectNode *anjuta_pm_project_add_source (AnjutaPmProject *project, AnjutaProjectNode *parent, AnjutaProjectNode *sibling, const gchar *name, GError **error);
93 94 95 96
AnjutaProjectNode *anjuta_pm_project_get_root (AnjutaPmProject *project);
gboolean anjuta_pm_project_remove (AnjutaPmProject *project, AnjutaProjectNode *node, GError **error);
gboolean anjuta_pm_project_remove_data (AnjutaPmProject *project, GbfTreeData *data, GError **error);

97

98
gboolean anjuta_pm_project_is_open (AnjutaPmProject *project);
99
AnjutaPluginHandle *anjuta_pm_project_get_backend (AnjutaPmProject *project);
100 101 102 103

IAnjutaProject *anjuta_pm_project_get_project (AnjutaPmProject *project);
GbfProjectModel *anjuta_pm_project_get_model (AnjutaPmProject *project);

104
AnjutaProjectNode *anjuta_pm_project_get_node_from_file (AnjutaPmProject *project, AnjutaProjectNodeType type, GFile *file);
105
AnjutaProjectNode *anjuta_pm_project_get_node_from_iter (AnjutaPmProject *project, GtkTreeIter *iter);
106
AnjutaProjectNode *anjuta_pm_project_get_module (AnjutaPmProject *project, const gchar *name);
107 108 109 110

G_END_DECLS

#endif /* _PROJECT_H_ */