1 /*
2  * config.h - Part of the Geany Markdown plugin
3  *
4  * Copyright 2012 Matthew Brush <mbrush@codebrainz.ca>
5  *
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.
10  *
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.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  * MA 02110-1301, USA.
20  *
21  *
22  */
23 
24 #ifndef MARKDOWN_CONF_H
25 #define MARKDOWN_CONF_H 1
26 
27 #include <gtk/gtk.h>
28 #include <glib-object.h>
29 
30 G_BEGIN_DECLS
31 
32 #define MARKDOWN_TYPE_CONFIG             (markdown_config_get_type ())
33 #define MARKDOWN_CONFIG(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), MARKDOWN_TYPE_CONFIG, MarkdownConfig))
34 #define MARKDOWN_CONFIG_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), MARKDOWN_TYPE_CONFIG, MarkdownConfigClass))
35 #define MARKDOWN_IS_CONFIG(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MARKDOWN_TYPE_CONFIG))
36 #define MARKDOWN_IS_CONFIG_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), MARKDOWN_TYPE_CONFIG))
37 #define MARKDOWN_CONFIG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), MARKDOWN_TYPE_CONFIG, MarkdownConfigClass))
38 
39 typedef struct _MarkdownConfig         MarkdownConfig;
40 typedef struct _MarkdownConfigClass    MarkdownConfigClass;
41 typedef struct _MarkdownConfigPrivate  MarkdownConfigPrivate;
42 
43 typedef enum {
44   MARKDOWN_CONFIG_VIEW_POS_SIDEBAR=0,
45   MARKDOWN_CONFIG_VIEW_POS_MSGWIN=1,
46   MARKDOWN_CONFIG_VIEW_POS_MAX
47 } MarkdownConfigViewPos;
48 
49 struct _MarkdownConfig
50 {
51   GObject parent;
52   MarkdownConfigPrivate *priv;
53 };
54 
55 struct _MarkdownConfigClass
56 {
57   GObjectClass parent_class;
58 };
59 
60 GType markdown_config_get_type(void);
61 MarkdownConfig *markdown_config_new(const gchar *filename);
62 gboolean markdown_config_save(MarkdownConfig *conf);
63 GtkWidget *markdown_config_gui(MarkdownConfig *conf, GtkDialog *dialog);
64 
65 const gchar *markdown_config_get_template_text(MarkdownConfig *conf);
66 gchar *markdown_config_get_dirname(MarkdownConfig *conf);
67 
68 /* Property accessors */
69 MarkdownConfigViewPos markdown_config_get_view_pos(MarkdownConfig *conf);
70 void markdown_config_set_view_pos(MarkdownConfig *conf, MarkdownConfigViewPos view_pos);
71 
72 G_END_DECLS
73 
74 #endif /* MARKDOWN_CONF_H */
75