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
32 #include "filetypes.h"
40 #define GEANY_TEMPLATES_INDENT 3
41 #define GEANY_TEMPLATES_FORMAT_YEAR C_("DefaultYear", "%Y")
42 #define GEANY_TEMPLATES_FORMAT_DATE C_("DefaultDate", "%Y-%m-%d")
43 #define GEANY_TEMPLATES_FORMAT_DATETIME C_("DefaultDateTime", "%d.%m.%Y %H:%M:%S %Z")
47 GEANY_TEMPLATE_GPL
= 0,
49 GEANY_TEMPLATE_FILEHEADER
,
50 GEANY_TEMPLATE_CHANGELOG
,
51 GEANY_TEMPLATE_FUNCTION
,
56 /** Template preferences. */
57 typedef struct GeanyTemplatePrefs
59 gchar
*developer
; /**< Name */
60 gchar
*company
; /**< Company */
61 gchar
*mail
; /**< Email */
62 gchar
*initials
; /**< Initials */
63 gchar
*version
; /**< Initial version */
66 gchar
*datetime_format
;
70 extern GeanyTemplatePrefs template_prefs
;
73 void templates_init(void);
75 gchar
*templates_get_template_fileheader(gint filetype_idx
, const gchar
*fname
);
77 gchar
*templates_get_template_changelog(GeanyDocument
*doc
);
79 gchar
*templates_get_template_function(GeanyDocument
*doc
, const gchar
*func_name
);
81 gchar
*templates_get_template_licence(GeanyDocument
*doc
, gint licence_type
);
83 void templates_replace_common(GString
*tmpl
, const gchar
*fname
,
84 GeanyFiletype
*ft
, const gchar
*func_name
);
86 void templates_replace_valist(GString
*text
,
87 const gchar
*first_wildcard
, ...) G_GNUC_NULL_TERMINATED
;
89 void templates_free_templates(void);
93 #endif /* GEANY_TEMPLATES_H */