2 * templates.h - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2005-2010 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
5 * Copyright 2006-2010 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30 #ifndef GEANY_TEMPLATES_H
31 #define GEANY_TEMPLATES_H 1
35 GEANY_TEMPLATE_GPL
= 0,
37 GEANY_TEMPLATE_FILEHEADER
,
38 GEANY_TEMPLATE_CHANGELOG
,
39 GEANY_TEMPLATE_FUNCTION
,
44 /** Template preferences. */
45 typedef struct GeanyTemplatePrefs
47 gchar
*developer
; /**< Name */
48 gchar
*company
; /**< Company */
49 gchar
*mail
; /**< Email */
50 gchar
*initials
; /**< Initials */
51 gchar
*version
; /**< Initial version */
54 gchar
*datetime_format
;
58 extern GeanyTemplatePrefs template_prefs
;
63 void templates_init(void);
65 gchar
*templates_get_template_fileheader(gint filetype_idx
, const gchar
*fname
);
67 gchar
*templates_get_template_new_file(GeanyFiletype
*ft
);
69 gchar
*templates_get_template_changelog(GeanyDocument
*doc
);
71 gchar
*templates_get_template_function(GeanyDocument
*doc
, const gchar
*func_name
);
73 gchar
*templates_get_template_licence(GeanyDocument
*doc
, gint licence_type
);
75 void templates_replace_default_dates(GString
*text
);
77 void templates_replace_valist(GString
*text
, const gchar
*first_wildcard
, ...) G_GNUC_NULL_TERMINATED
;
79 void templates_replace_command(GString
*text
, const gchar
*file_name
,
80 const gchar
*file_type
, const gchar
*func_name
);
82 void templates_free_templates(void);