2 * templates.h - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2005 The Geany contributors
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 along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #ifndef GEANY_TEMPLATES_H
28 #define GEANY_TEMPLATES_H 1
31 #include "filetypes.h"
37 /** Template preferences. */
38 typedef struct GeanyTemplatePrefs
40 gchar
*developer
; /**< Name */
41 gchar
*company
; /**< Company */
42 gchar
*mail
; /**< Email */
43 gchar
*initials
; /**< Initials */
44 gchar
*version
; /**< Initial version */
47 gchar
*datetime_format
;
52 gchar
*templates_get_template_fileheader(gint filetype_idx
, const gchar
*fname
);
59 #define GEANY_TEMPLATES_INDENT 3
60 #define GEANY_TEMPLATES_FORMAT_YEAR C_("DefaultYear", "%Y")
61 #define GEANY_TEMPLATES_FORMAT_DATE C_("DefaultDate", "%Y-%m-%d")
62 #define GEANY_TEMPLATES_FORMAT_DATETIME C_("DefaultDateTime", "%d.%m.%Y %H:%M:%S %Z")
66 GEANY_TEMPLATE_GPL
= 0,
68 GEANY_TEMPLATE_FILEHEADER
,
69 GEANY_TEMPLATE_CHANGELOG
,
70 GEANY_TEMPLATE_FUNCTION
,
75 extern GeanyTemplatePrefs template_prefs
;
78 void templates_init(void);
80 gchar
*templates_get_template_changelog(GeanyDocument
*doc
);
82 gchar
*templates_get_template_function(GeanyDocument
*doc
, const gchar
*func_name
);
84 gchar
*templates_get_template_licence(GeanyDocument
*doc
, gint licence_type
);
86 void templates_replace_common(GString
*tmpl
, const gchar
*fname
,
87 GeanyFiletype
*ft
, const gchar
*func_name
);
89 void templates_replace_valist(GString
*text
,
90 const gchar
*first_wildcard
, ...) G_GNUC_NULL_TERMINATED
;
92 void templates_free_templates(void);
94 #endif /* GEANY_PRIVATE */
98 #endif /* GEANY_TEMPLATES_H */