1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
4 Copyright (C) Dragos Dena 2010
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,
19 Boston, MA 02110-1301 USA
22 #ifndef __ANJUTA_SNIPPET_H__
23 #define __ANJUTA_SNIPPET_H__
26 #include <glib-object.h>
31 typedef struct _AnjutaSnippet AnjutaSnippet
;
32 typedef struct _AnjutaSnippetPrivate AnjutaSnippetPrivate
;
33 typedef struct _AnjutaSnippetClass AnjutaSnippetClass
;
35 #define ANJUTA_TYPE_SNIPPET (snippet_get_type ())
36 #define ANJUTA_SNIPPET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_SNIPPET, AnjutaSnippet))
37 #define ANJUTA_SNIPPET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ANJUTA_TYPE_SNIPPET, AnjutaSnippetClass))
38 #define ANJUTA_IS_SNIPPET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_SNIPPET))
39 #define ANJUTA_IS_SNIPPET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_SNIPPET))
43 GObject parent_instance
;
45 /* A pointer to an AnjutaSnippetsGroup object. */
46 GObject
*parent_snippets_group
;
49 AnjutaSnippetPrivate
*priv
;
52 struct _AnjutaSnippetClass
54 GObjectClass parent_class
;
58 GType
snippet_get_type (void) G_GNUC_CONST
;
59 AnjutaSnippet
* snippet_new (const gchar
*trigger_key
,
60 GList
*snippet_language
,
61 const gchar
*snippet_name
,
62 const gchar
*snippet_content
,
63 GList
*variable_names
,
64 GList
*variable_default_values
,
65 GList
*variable_globals
,
67 AnjutaSnippet
* snippet_copy (AnjutaSnippet
*snippet
);
68 const gchar
* snippet_get_trigger_key (AnjutaSnippet
*snippet
);
69 void snippet_set_trigger_key (AnjutaSnippet
*snippet
,
70 const gchar
*new_trigger_key
);
71 const GList
* snippet_get_languages (AnjutaSnippet
*snippet
);
72 gchar
* snippet_get_languages_string (AnjutaSnippet
*snippet
);
73 const gchar
* snippet_get_any_language (AnjutaSnippet
*snippet
);
74 gboolean
snippet_has_language (AnjutaSnippet
*snippet
,
75 const gchar
*language
);
76 void snippet_add_language (AnjutaSnippet
*snippet
,
77 const gchar
*language
);
78 void snippet_remove_language (AnjutaSnippet
*snippet
,
79 const gchar
*language
);
80 const gchar
* snippet_get_name (AnjutaSnippet
*snippet
);
81 void snippet_set_name (AnjutaSnippet
*snippet
,
82 const gchar
*new_name
);
83 GList
* snippet_get_keywords_list (AnjutaSnippet
*snippet
);
84 void snippet_set_keywords_list (AnjutaSnippet
*snippet
,
85 const GList
*keywords_list
);
86 GList
* snippet_get_variable_names_list (AnjutaSnippet
*snippet
);
87 GList
* snippet_get_variable_defaults_list (AnjutaSnippet
*snippet
);
88 GList
* snippet_get_variable_globals_list (AnjutaSnippet
*snippet
);
89 gboolean
snippet_has_variable (AnjutaSnippet
*snippet
,
90 const gchar
*variable_name
);
91 void snippet_add_variable (AnjutaSnippet
*snippet
,
92 const gchar
*variable_name
,
93 const gchar
*default_value
,
95 void snippet_remove_variable (AnjutaSnippet
*snippet
,
96 const gchar
*variable_name
);
97 void snippet_set_variable_name (AnjutaSnippet
*snippet
,
98 const gchar
*variable_name
,
99 const gchar
*new_variable_name
);
100 const gchar
* snippet_get_variable_default_value (AnjutaSnippet
*snippet
,
101 const gchar
*variable_name
);
102 void snippet_set_variable_default_value (AnjutaSnippet
*snippet
,
103 const gchar
*variable_name
,
104 const gchar
*default_value
);
105 gboolean
snippet_get_variable_global (AnjutaSnippet
*snippet
,
106 const gchar
*variable_name
);
107 void snippet_set_variable_global (AnjutaSnippet
*snippet
,
108 const gchar
*variable_name
,
110 const gchar
* snippet_get_content (AnjutaSnippet
*snippet
);
111 void snippet_set_content (AnjutaSnippet
*snippet
,
112 const gchar
*new_content
);
113 gchar
* snippet_get_default_content (AnjutaSnippet
*snippet
,
114 GObject
*snippets_db_obj
,
115 const gchar
*indent
);
116 GList
* snippet_get_variable_relative_positions (AnjutaSnippet
*snippet
);
117 GList
* snippet_get_variable_cur_values_len (AnjutaSnippet
*snippet
);
118 gint
snippet_get_cur_value_end_position (AnjutaSnippet
*snippet
);
119 gboolean
snippet_is_equal (AnjutaSnippet
*snippet
,
120 AnjutaSnippet
*snippet2
);
124 #endif /* __ANJUTA_SNIPPET_H__ */