Merge pull request #1133 from techee/readme_rst
[geany-mirror.git] / src / templates.h
blob7e61283c23bd8ae49387eac408325f4b2adb098c
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 #include "document.h"
32 #include "filetypes.h"
34 #include <glib.h>
36 G_BEGIN_DECLS
38 /** Template preferences. */
39 typedef struct GeanyTemplatePrefs
41 gchar *developer; /**< Name */
42 gchar *company; /**< Company */
43 gchar *mail; /**< Email */
44 gchar *initials; /**< Initials */
45 gchar *version; /**< Initial version */
46 gchar *year_format;
47 gchar *date_format;
48 gchar *datetime_format;
50 GeanyTemplatePrefs;
53 gchar *templates_get_template_fileheader(gint filetype_idx, const gchar *fname);
56 #ifdef GEANY_PRIVATE
58 struct filetype;
60 #define GEANY_TEMPLATES_INDENT 3
61 #define GEANY_TEMPLATES_FORMAT_YEAR C_("DefaultYear", "%Y")
62 #define GEANY_TEMPLATES_FORMAT_DATE C_("DefaultDate", "%Y-%m-%d")
63 #define GEANY_TEMPLATES_FORMAT_DATETIME C_("DefaultDateTime", "%d.%m.%Y %H:%M:%S %Z")
65 enum
67 GEANY_TEMPLATE_GPL = 0,
68 GEANY_TEMPLATE_BSD,
69 GEANY_TEMPLATE_FILEHEADER,
70 GEANY_TEMPLATE_CHANGELOG,
71 GEANY_TEMPLATE_FUNCTION,
72 GEANY_MAX_TEMPLATES
76 extern GeanyTemplatePrefs template_prefs;
79 void templates_init(void);
81 gchar *templates_get_template_changelog(GeanyDocument *doc);
83 gchar *templates_get_template_function(GeanyDocument *doc, const gchar *func_name);
85 gchar *templates_get_template_licence(GeanyDocument *doc, gint licence_type);
87 void templates_replace_common(GString *tmpl, const gchar *fname,
88 GeanyFiletype *ft, const gchar *func_name);
90 void templates_replace_valist(GString *text,
91 const gchar *first_wildcard, ...) G_GNUC_NULL_TERMINATED;
93 void templates_free_templates(void);
95 #endif /* GEANY_PRIVATE */
97 G_END_DECLS
99 #endif /* GEANY_TEMPLATES_H */