1 /* GepubWidget
2  *
3  * Copyright (C) 2016 Daniel Garcia <danigm@wadobo.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19 
20 #ifndef __GEPUB_WIDGET_H__
21 #define __GEPUB_WIDGET_H__
22 
23 #include <webkit2/webkit2.h>
24 #include <glib-object.h>
25 #include <glib.h>
26 
27 #include "gepub-doc.h"
28 
29 G_BEGIN_DECLS
30 
31 #define GEPUB_TYPE_WIDGET           (gepub_widget_get_type ())
32 #define GEPUB_WIDGET(obj)           (G_TYPE_CHECK_INSTANCE_CAST (obj, GEPUB_TYPE_WIDGET, GepubWidget))
33 #define GEPUB_WIDGET_CLASS(cls)     (G_TYPE_CHECK_CLASS_CAST (cls, GEPUB_TYPE_WIDGET, GepubWidgetClass))
34 #define GEPUB_IS_WIDGET(obj)        (G_TYPE_CHECK_INSTANCE_TYPE (obj, GEPUB_TYPE_WIDGET))
35 #define GEPUB_IS_WIDGET_CLASS(obj)  (G_TYPE_CHECK_CLASS_TYPE (obj, GEPUB_TYPE_WIDGET))
36 #define GEPUB_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEPUB_TYPE_WIDGET, GepubWidgetClass))
37 
38 typedef struct _GepubWidget      GepubWidget;
39 typedef struct _GepubWidgetClass GepubWidgetClass;
40 
41 GType             gepub_widget_get_type                        (void) G_GNUC_CONST;
42 
43 GtkWidget        *gepub_widget_new                             (void);
44 
45 GepubDoc         *gepub_widget_get_doc                         (GepubWidget *widget);
46 void              gepub_widget_set_doc                         (GepubWidget *widget,
47                                                                 GepubDoc    *doc);
48 
49 gboolean          gepub_widget_get_paginate                    (GepubWidget *widget);
50 void              gepub_widget_set_paginate                    (GepubWidget *widget, gboolean p);
51 
52 gint              gepub_widget_get_n_chapters                  (GepubWidget *widget);
53 gint              gepub_widget_get_chapter                     (GepubWidget *widget);
54 gint              gepub_widget_get_chapter_length              (GepubWidget *widget);
55 void              gepub_widget_set_chapter                     (GepubWidget *widget,
56                                                                 gint         index);
57 gboolean          gepub_widget_chapter_next                    (GepubWidget *widget);
58 gboolean          gepub_widget_chapter_prev                    (GepubWidget *widget);
59 
60 gfloat            gepub_widget_get_pos                         (GepubWidget *widget);
61 void              gepub_widget_set_pos                         (GepubWidget *widget,
62                                                                 gfloat       index);
63 gboolean          gepub_widget_page_next                       (GepubWidget *widget);
64 gboolean          gepub_widget_page_prev                       (GepubWidget *widget);
65 
66 gint              gepub_widget_get_margin                      (GepubWidget *widget);
67 void              gepub_widget_set_margin                      (GepubWidget *widget,
68                                                                 gint         margin);
69 
70 gint              gepub_widget_get_fontsize                    (GepubWidget *widget);
71 void              gepub_widget_set_fontsize                    (GepubWidget *widget,
72                                                                 gint         size);
73 
74 gchar            *gepub_widget_get_fontfamily                  (GepubWidget *widget);
75 void              gepub_widget_set_fontfamily                  (GepubWidget *widget,
76                                                                 gchar       *family);
77 
78 gfloat            gepub_widget_get_lineheight                  (GepubWidget *widget);
79 void              gepub_widget_set_lineheight                  (GepubWidget *widget,
80                                                                 gfloat       size);
81 
82 G_END_DECLS
83 
84 #endif /* __GEPUB_WIDGET_H__ */
85 
86