docs: Document Open dialog options (#2355)
[geany-mirror.git] / src / templates.h
blob6ee7d51508ceb1c3fa03294128691b3e53d7aaec
1 /*
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.
21 /**
22 * @file templates.h
23 * Templates (prefs).
24 **/
27 #ifndef GEANY_TEMPLATES_H
28 #define GEANY_TEMPLATES_H 1
30 #include "document.h"
31 #include "filetypes.h"
33 #include <glib.h>
35 G_BEGIN_DECLS
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 */
45 gchar *year_format;
46 gchar *date_format;
47 gchar *datetime_format;
49 GeanyTemplatePrefs;
52 gchar *templates_get_template_fileheader(gint filetype_idx, const gchar *fname);
55 #ifdef GEANY_PRIVATE
57 struct filetype;
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")
64 enum
66 GEANY_TEMPLATE_GPL = 0,
67 GEANY_TEMPLATE_BSD,
68 GEANY_TEMPLATE_FILEHEADER,
69 GEANY_TEMPLATE_CHANGELOG,
70 GEANY_TEMPLATE_FUNCTION,
71 GEANY_MAX_TEMPLATES
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 */
96 G_END_DECLS
98 #endif /* GEANY_TEMPLATES_H */