1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 * Copyright (C) 2010 Sébastien Granjoux
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
26 #include <glib-object.h>
27 #include <libanjuta/anjuta-plugin.h>
28 #include <libanjuta/anjuta-project.h>
29 #include <libanjuta/anjuta-plugin-handle.h>
30 #include <libanjuta/interfaces/ianjuta-project.h>
32 #include "project-model.h"
33 #include "tree-data.h"
37 #define ANJUTA_TYPE_PM_PROJECT (anjuta_pm_project_get_type ())
38 #define ANJUTA_PM_PROJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_PM_PROJECT, AnjutaPmProject))
39 #define ANJUTA_PM_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ANJUTA_TYPE_PM_PROJECT, AnjutaPmProjectClass))
40 #define ANJUTA_IS_PM_PROJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_PM_PROJECT))
41 #define ANJUTA_IS_PM_PROJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_PM_PROJECT))
42 #define ANJUTA_PM_PROJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ANJUTA_TYPE_PM_PROJECT, AnjutaPmProjectClass))
44 typedef struct _AnjutaPmProjectClass AnjutaPmProjectClass
;
45 //typedef struct _AnjutaPmProject AnjutaPmProject;
47 struct _AnjutaPmProjectClass
49 GObjectClass parent_class
;
51 void (*loaded
) (AnjutaPmProject
* project
, AnjutaProjectNode
*node
, gboolean complete
, GError
*error
);
54 struct _AnjutaPmProject
56 GObject parent_instance
;
60 IAnjutaProject
*project
;
61 AnjutaPluginHandle
*backend
;
63 AnjutaProjectNode
*root
;
65 guint incomplete_node
;
69 gint node_capabilities
;
71 /* project properties dialog */
72 GtkWidget
*properties_dialog
;
75 GType
anjuta_pm_project_get_type (void) G_GNUC_CONST
;
77 AnjutaPmProject
* anjuta_pm_project_new (AnjutaPlugin
*plugin
);
78 void anjuta_pm_project_free (AnjutaPmProject
* project
);
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 gboolean
anjuta_pm_project_unload (AnjutaPmProject
*project
, GError
**error
);
83 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
);
88 GList
*anjuta_pm_project_get_packages (AnjutaPmProject
*project
);
90 AnjutaProjectNode
*anjuta_pm_project_add_group (AnjutaPmProject
*project
, AnjutaProjectNode
*parent
, AnjutaProjectNode
*sibling
, const gchar
*name
, GError
**error
);
91 AnjutaProjectNode
*anjuta_pm_project_add_target (AnjutaPmProject
*project
, AnjutaProjectNode
*parent
, AnjutaProjectNode
*sibling
, const gchar
*name
, AnjutaProjectNodeType type
, GError
**error
);
92 AnjutaProjectNode
*anjuta_pm_project_add_source (AnjutaPmProject
*project
, AnjutaProjectNode
*parent
, AnjutaProjectNode
*sibling
, const gchar
*name
, GError
**error
);
93 AnjutaProjectNode
*anjuta_pm_project_get_root (AnjutaPmProject
*project
);
94 gboolean
anjuta_pm_project_remove (AnjutaPmProject
*project
, AnjutaProjectNode
*node
, GError
**error
);
95 gboolean
anjuta_pm_project_remove_data (AnjutaPmProject
*project
, GbfTreeData
*data
, GError
**error
);
98 gboolean
anjuta_pm_project_is_open (AnjutaPmProject
*project
);
99 AnjutaPluginHandle
*anjuta_pm_project_get_backend (AnjutaPmProject
*project
);
101 IAnjutaProject
*anjuta_pm_project_get_project (AnjutaPmProject
*project
);
102 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
);
110 #endif /* _PROJECT_H_ */