2 * templates.h - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2005-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
5 * Copyright 2006-2012 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 along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #ifndef GEANY_TEMPLATES_H
29 #define GEANY_TEMPLATES_H 1
33 /* Forward-declared to avoid including their headers here */
37 #define GEANY_TEMPLATES_INDENT 3
38 #define GEANY_TEMPLATES_FORMAT_YEAR C_("DefaultYear", "%Y")
39 #define GEANY_TEMPLATES_FORMAT_DATE C_("DefaultDate", "%Y-%m-%d")
40 #define GEANY_TEMPLATES_FORMAT_DATETIME C_("DefaultDateTime", "%d.%m.%Y %H:%M:%S %Z")
44 GEANY_TEMPLATE_GPL
= 0,
46 GEANY_TEMPLATE_FILEHEADER
,
47 GEANY_TEMPLATE_CHANGELOG
,
48 GEANY_TEMPLATE_FUNCTION
,
53 /** Template preferences. */
54 typedef struct GeanyTemplatePrefs
56 gchar
*developer
; /**< Name */
57 gchar
*company
; /**< Company */
58 gchar
*mail
; /**< Email */
59 gchar
*initials
; /**< Initials */
60 gchar
*version
; /**< Initial version */
63 gchar
*datetime_format
;
67 extern GeanyTemplatePrefs template_prefs
;
72 void templates_init(void);
74 gchar
*templates_get_template_fileheader(gint filetype_idx
, const gchar
*fname
);
76 gchar
*templates_get_template_changelog(struct GeanyDocument
*doc
);
78 gchar
*templates_get_template_function(struct GeanyDocument
*doc
, const gchar
*func_name
);
80 gchar
*templates_get_template_licence(struct GeanyDocument
*doc
, gint licence_type
);
82 void templates_replace_common(GString
*tmpl
, const gchar
*fname
,
83 struct GeanyFiletype
*ft
, const gchar
*func_name
);
85 void templates_replace_valist(GString
*text
,
86 const gchar
*first_wildcard
, ...) G_GNUC_NULL_TERMINATED
;
88 void templates_free_templates(void);