Initial German translation of the build tutorial
[anjuta.git] / plugins / tools / tool.h
blobea3de186b18ff7e0f0759921e793967c481a6850
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 tool.h
4 Copyright (C) 2005 Sebastien Granjoux
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef __TOOL_H__
22 #define __TOOL_H__
24 #include "plugin.h"
26 #include <gtk/gtk.h>
28 #include <glib.h>
30 /* Defines how output (stdout and stderr) should be handled */
31 typedef enum _ATPOutputType
33 ATP_TOUT_UNKNOWN = -1,
34 ATP_TOUT_SAME = 0,
35 ATP_TOUT_COMMON_PANE,
36 ATP_TOUT_NEW_PANE,
37 ATP_TOUT_NEW_BUFFER,
38 ATP_TOUT_REPLACE_BUFFER,
39 ATP_TOUT_INSERT_BUFFER,
40 ATP_TOUT_APPEND_BUFFER,
41 ATP_TOUT_REPLACE_SELECTION,
42 ATP_TOUT_POPUP_DIALOG,
43 ATP_TOUT_NULL,
44 ATP_OUTPUT_TYPE_COUNT
45 } ATPOutputType;
47 /* Defines how input should be handled */
48 typedef enum _ATPInputType
50 ATP_TIN_UNKNOWN = -1,
51 ATP_TIN_NONE = 0,
52 ATP_TIN_BUFFER,
53 ATP_TIN_SELECTION,
54 ATP_TIN_STRING,
55 ATP_TIN_FILE,
56 ATP_INPUT_TYPE_COUNT
57 } ATPInputType;
59 /* Simple type to associate an identifier and a string */
60 typedef struct _ATPEnumType
62 gint id;
63 const gchar* name;
64 } ATPEnumType;
66 /* Defines how and where tool information will be stored. */
67 typedef enum _ATPToolStore
69 ATP_TSTORE_GLOBAL = 0,
70 ATP_TSTORE_LOCAL,
71 ATP_TSTORE_PROJECT,
72 ATP_LAST_TSTORE
73 } ATPToolStore;
75 /* Additional tool information */
76 typedef enum _ATPToolFlag
78 /* Select the operation needed on the flag */
79 ATP_CLEAR = 0,
80 ATP_SET = 1,
81 ATP_TOGGLE = 2,
82 ATP_OPERATION = 3,
83 /* Tool flags */
84 ATP_TOOL_ENABLE = 1 << 2,
85 ATP_TOOL_AUTOSAVE = 1 << 3,
86 ATP_TOOL_TERMINAL = 1 << 4
87 } ATPToolFlag;
89 typedef struct _ATPUserTool ATPUserTool;
90 typedef struct _ATPToolList ATPToolList;
92 struct _ATPToolList
94 GHashTable* hash;
95 GStringChunk* string_pool ;
96 AnjutaUI* ui;
97 ATPUserTool* list;
98 ATPPlugin* plugin;
101 /*---------------------------------------------------------------------------*/
103 const ATPEnumType* atp_get_output_type_list (void);
104 const ATPEnumType* atp_get_error_type_list (void);
105 const ATPEnumType* atp_get_input_type_list (void);
107 /*---------------------------------------------------------------------------*/
109 gchar* atp_remove_mnemonic (const gchar* label);
111 /*---------------------------------------------------------------------------*/
113 ATPUserTool* atp_user_tool_new (ATPToolList *list, const gchar* name, ATPToolStore storage);
114 void atp_user_tool_free(ATPUserTool *tool);
116 ATPUserTool *atp_user_tool_append_new (ATPUserTool* this, const gchar *name, ATPToolStore storage);
117 ATPUserTool *atp_user_tool_clone_new (ATPUserTool* this, ATPToolStore storage);
119 gboolean atp_user_tool_activate (ATPUserTool* this, GtkActionGroup *action_group, AnjutaUI *ui);
120 void atp_user_tool_deactivate (ATPUserTool* this, AnjutaUI *ui);
122 gboolean atp_user_tool_move_after (ATPUserTool* this, ATPUserTool* position);
124 gboolean atp_user_tool_set_name (ATPUserTool *this, const gchar *value);
125 const gchar* atp_user_tool_get_name (const ATPUserTool* this);
127 void atp_user_tool_set_command (ATPUserTool* this, const gchar* value);
128 const gchar* atp_user_tool_get_command (const ATPUserTool* this);
130 void atp_user_tool_set_param (ATPUserTool* this, const gchar* value);
131 const gchar* atp_user_tool_get_param (const ATPUserTool* this);
133 void atp_user_tool_set_working_dir (ATPUserTool* this, const gchar* value);
134 const gchar* atp_user_tool_get_working_dir (const ATPUserTool* this);
136 void atp_user_tool_set_flag (ATPUserTool *this, ATPToolFlag flag);
137 gboolean atp_user_tool_get_flag (const ATPUserTool *this, ATPToolFlag flag);
139 void atp_user_tool_set_output (ATPUserTool *this, ATPOutputType type);
140 ATPOutputType atp_user_tool_get_output (const ATPUserTool *this);
142 void atp_user_tool_set_error (ATPUserTool *this, ATPOutputType type);
143 ATPOutputType atp_user_tool_get_error (const ATPUserTool *this);
145 void atp_user_tool_set_input (ATPUserTool *this, ATPInputType type, const gchar* value);
146 ATPInputType atp_user_tool_get_input (const ATPUserTool *this);
147 const gchar* atp_user_tool_get_input_string (const ATPUserTool *this);
149 void atp_user_tool_set_accelerator (ATPUserTool *this, guint key, GdkModifierType mods);
150 gboolean atp_user_tool_get_accelerator (const ATPUserTool *this, guint *key, GdkModifierType *mods);
152 void atp_user_tool_set_icon (ATPUserTool *this, const gchar* value);
153 const gchar* atp_user_tool_get_icon (const ATPUserTool *this);
155 ATPToolStore atp_user_tool_get_storage (const ATPUserTool *this);
157 ATPPlugin* atp_user_tool_get_plugin (ATPUserTool* this);
159 gboolean atp_user_tool_is_valid (const ATPUserTool* this);
161 ATPUserTool *atp_user_tool_next (ATPUserTool* this);
162 ATPUserTool *atp_user_tool_next_in_same_storage (ATPUserTool* this);
163 ATPUserTool *atp_user_tool_previous (ATPUserTool* this);
164 ATPUserTool *atp_user_tool_override (const ATPUserTool* this);
166 /*---------------------------------------------------------------------------*/
168 ATPToolList *atp_tool_list_construct (ATPToolList *this, ATPPlugin* plugin);
169 void atp_tool_list_destroy (ATPToolList *this);
171 ATPUserTool* atp_tool_list_first (ATPToolList *this);
172 ATPUserTool* atp_tool_list_first_in_storage (ATPToolList *this, ATPToolStore storage);
173 ATPUserTool* atp_tool_list_last (ATPToolList *this);
175 gboolean atp_tool_list_activate (ATPToolList *this);
176 gboolean atp_tool_list_deactivate (ATPToolList *this);
177 ATPUserTool *atp_tool_list_append_new (ATPToolList* this, const gchar *name, ATPToolStore storage);
180 #endif