Move typedefs out of geany.h and into their own headers
[geany-mirror.git] / src / templates.h
blob9da49959aeb4ac505d98df4ea3416129cd8f01b8
1 /*
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.
22 /**
23 * @file templates.h
24 * Templates (prefs).
25 **/
28 #ifndef GEANY_TEMPLATES_H
29 #define GEANY_TEMPLATES_H 1
31 G_BEGIN_DECLS
33 /* Forward-declared to avoid including their headers here */
34 struct GeanyDocument;
35 struct GeanyFiletype;
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")
42 enum
44 GEANY_TEMPLATE_GPL = 0,
45 GEANY_TEMPLATE_BSD,
46 GEANY_TEMPLATE_FILEHEADER,
47 GEANY_TEMPLATE_CHANGELOG,
48 GEANY_TEMPLATE_FUNCTION,
49 GEANY_MAX_TEMPLATES
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 */
61 gchar *year_format;
62 gchar *date_format;
63 gchar *datetime_format;
65 GeanyTemplatePrefs;
67 extern GeanyTemplatePrefs template_prefs;
70 struct filetype;
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);
90 G_END_DECLS
92 #endif