Added initial Spanish translation
[anjuta-git-plugin.git] / libanjuta / anjuta-ui.h
blobcd9ef4f2418b2316fc4c72bccd59495635993972
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 * anjuta-ui.h
4 * Copyright (C) Naba Kumar <naba@gnome.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (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
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #ifndef _ANJUTA_UI_H_
21 #define _ANJUTA_UI_H_
23 /* Usage Notes:
24 * 1) Any object which added any action or action group is responsible
25 * for removing them when done (for example, a plugin object).
27 * 2) Any object which merged a UI is responsible for unmerging it
28 * when done with it (for example, a plugin object).
30 * 3) Avoid using EggMenuMerge object gotten by anjuta_ui_get_menu_merge(),
31 * because AnjutaUI keeps track of all actions/action-groups added to or
32 * removed from it and accordingly updates the required UI interfaces.
33 * Use the EggMenuMerge object only to do things not doable by AnjutaUI.
35 #include <gtk/gtkaccelgroup.h>
36 #include <gtk/gtkuimanager.h>
38 G_BEGIN_DECLS
40 #define ANJUTA_TYPE_UI (anjuta_ui_get_type ())
41 #define ANJUTA_UI(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ANJUTA_TYPE_UI, AnjutaUI))
42 #define ANJUTA_UI_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), ANJUTA_TYPE_UI, AnjutaUIClass))
43 #define ANJUTA_IS_UI(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ANJUTA_TYPE_UI))
44 #define ANJUTA_IS_UI_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ANJUTA_TYPE_UI))
46 typedef struct _AnjutaUI AnjutaUI;
47 typedef struct _AnjutaUIClass AnjutaUIClass;
48 typedef struct _AnjutaUIPrivate AnjutaUIPrivate;
50 struct _AnjutaUI {
51 GtkUIManager parent;
53 AnjutaUIPrivate *priv;
56 struct _AnjutaUIClass {
57 GtkUIManagerClass parent;
60 GType anjuta_ui_get_type (void);
62 /* Creates a new AnjutaUI object */
63 AnjutaUI* anjuta_ui_new (void);
65 /* Adds a group of Action entries with the give group name.
66 * Caller does not get a reference to the returned ActionGroup. Use it
67 * as reference ID to remove the action-group later (after which the object
68 * will no longer be valid).
70 GtkActionGroup* anjuta_ui_add_action_group_entries (AnjutaUI *ui,
71 const gchar *action_group_name,
72 const gchar *action_group_label,
73 GtkActionEntry *entries,
74 gint num_entries,
75 const gchar *translation_domain,
76 gboolean can_customize,
77 gpointer user_data);
79 GtkActionGroup* anjuta_ui_add_toggle_action_group_entries (AnjutaUI *ui,
80 const gchar *action_group_name,
81 const gchar *action_group_label,
82 GtkToggleActionEntry *entries,
83 gint num_entries,
84 const gchar *translation_domain,
85 gboolean can_customize,
86 gpointer user_data);
88 void anjuta_ui_add_action_group (AnjutaUI *ui,
89 const gchar *action_group_name,
90 const gchar *action_group_label,
91 GtkActionGroup *action_group,
92 gboolean can_customize);
94 /* Removes the group of Actions */
95 void anjuta_ui_remove_action_group (AnjutaUI *ui, GtkActionGroup *action_group);
97 /* Get the action object from the given group with the given name */
98 GtkAction * anjuta_ui_get_action (AnjutaUI *ui,
99 const gchar *action_group_name,
100 const gchar *action_name);
102 /* Activates (calls the action callback) the action given by the action
103 * path. Path is given by "ActionGroupName/ActionName".
105 void anjuta_ui_activate_action_by_path (AnjutaUI *ui,
106 const gchar *action_path);
108 /* Activates the action in the given Action group object with the given
109 * action name.
111 void anjuta_ui_activate_action_by_group (AnjutaUI *ui,
112 GtkActionGroup *action_group,
113 const gchar *action_name);
115 /* Merges the given UI description file (written in xml)
116 Returns an id representing it */
117 gint anjuta_ui_merge (AnjutaUI *ui, const gchar *ui_filename);
119 /* Unmerges the give merge id */
120 void anjuta_ui_unmerge (AnjutaUI *ui, gint id);
122 /* Gets the icon factory */
123 GtkIconFactory* anjuta_ui_get_icon_factory (AnjutaUI* ui);
125 /* Get accel group associated with UI */
126 GtkAccelGroup* anjuta_ui_get_accel_group (AnjutaUI *ui);
128 GtkWidget* anjuta_ui_get_accel_editor (AnjutaUI *ui);
130 /* Dump the whole tree in STDOUT. Useful for debugging */
131 void anjuta_ui_dump_tree (AnjutaUI *ui);
133 G_END_DECLS
135 #endif