1 /* GepubTextChunk 2 * 3 * Copyright (C) 2011 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_TEXT_CHUNK_H__ 21 #define __GEPUB_TEXT_CHUNK_H__ 22 23 #include <glib-object.h> 24 #include <glib.h> 25 26 G_BEGIN_DECLS 27 28 #define GEPUB_TYPE_TEXT_CHUNK (gepub_text_chunk_get_type ()) 29 #define GEPUB_TEXT_CHUNK(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, GEPUB_TYPE_TEXT_CHUNK, GepubTextChunk)) 30 #define GEPUB_TEXT_CHUNK_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST (cls, GEPUB_TYPE_TEXT_CHUNK, GepubTextChunkClass)) 31 #define GEPUB_IS_TEXT_CHUNK(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GEPUB_TYPE_TEXT_CHUNK)) 32 #define GEPUB_IS_TEXT_CHUNK_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE (obj, GEPUB_TYPE_TEXT_CHUNK)) 33 #define GEPUB_TEXT_CHUNK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEPUB_TYPE_TEXT_CHUNK, GepubTextChunkClass)) 34 35 typedef enum { 36 GEPUBTextHeader, 37 GEPUBTextBold, 38 GEPUBTextItalic, 39 GEPUBTextNormal 40 } GepubTextChunkType; 41 42 struct _GepubTextChunk { 43 GObject parent; 44 45 GepubTextChunkType type; 46 gchar *text; 47 }; 48 49 struct _GepubTextChunkClass { 50 GObjectClass parent_class; 51 }; 52 53 typedef struct _GepubTextChunk GepubTextChunk; 54 typedef struct _GepubTextChunkClass GepubTextChunkClass; 55 56 GType gepub_text_chunk_get_type (void) G_GNUC_CONST; 57 GepubTextChunk *gepub_text_chunk_new (GepubTextChunkType type, const gchar *text); 58 const char *gepub_text_chunk_type_str (GepubTextChunk *chunk); 59 const char *gepub_text_chunk_text (GepubTextChunk *chunk); 60 GepubTextChunkType gepub_text_chunk_type (GepubTextChunk *chunk); 61 62 G_END_DECLS 63 64 #endif /* __GEPUB_TEXT_CHUNK_H__ */ 65