The update text is markdown formatted, so add a simple markdown parser
[colorhug:deejay1s-colorhug-client.git] / src / ch-markdown.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2  *
3  * Copyright (C) 2008-2011 Richard Hughes <richard@hughsie.com>
4  *
5  * Licensed under the GNU General Public License Version 2
6  *
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.
11  *
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.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #ifndef __CH_MARKDOWN_H
23 #define __CH_MARKDOWN_H
24
25 #include <glib-object.h>
26
27 G_BEGIN_DECLS
28
29 #define CH_TYPE_MARKDOWN                (ch_markdown_get_type ())
30 #define CH_MARKDOWN(o)                  (G_TYPE_CHECK_INSTANCE_CAST ((o), CH_TYPE_MARKDOWN, ChMarkdown))
31 #define CH_MARKDOWN_CLASS(k)            (G_TYPE_CHECK_CLASS_CAST((k), CH_TYPE_MARKDOWN, ChMarkdownClass))
32 #define CH_IS_MARKDOWN(o)               (G_TYPE_CHECK_INSTANCE_TYPE ((o), CH_TYPE_MARKDOWN))
33 #define CH_IS_MARKDOWN_CLASS(k)         (G_TYPE_CHECK_CLASS_TYPE ((k), CH_TYPE_MARKDOWN))
34 #define CH_MARKDOWN_GET_CLASS(o)        (G_TYPE_INSTANCE_GET_CLASS ((o), CH_TYPE_MARKDOWN, ChMarkdownClass))
35 #define CH_MARKDOWN_ERROR               (ch_markdown_error_quark ())
36 #define CH_MARKDOWN_TYPE_ERROR          (ch_markdown_error_get_type ())
37
38 typedef struct ChMarkdownPrivate ChMarkdownPrivate;
39
40 typedef struct
41 {
42          GObject                 parent;
43          ChMarkdownPrivate      *priv;
44 } ChMarkdown;
45
46 typedef struct
47 {
48         GObjectClass    parent_class;
49 } ChMarkdownClass;
50
51 GType            ch_markdown_get_type                   (void);
52 ChMarkdown      *ch_markdown_new                        (void);
53 gchar           *ch_markdown_parse                      (ChMarkdown             *self,
54                                                          const gchar            *text);
55
56 G_END_DECLS
57
58 #endif /* __CH_MARKDOWN_H */
59