1 /* This file is part of Maliit framework 2 * 3 * Copyright (C) 2012 One Laptop per Child Association 4 * 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; either 9 * version 2.1 of the licence, or (at your option) any later version. 10 * 11 * This library 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 GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; if not, write to the 18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 * Boston, MA 02111-1307, USA. 20 */ 21 22 #ifndef MALIIT_GLIB_ATTRIBUTE_EXTENSION_H 23 #define MALIIT_GLIB_ATTRIBUTE_EXTENSION_H 24 25 #include <glib.h> 26 #include <glib-object.h> 27 28 G_BEGIN_DECLS 29 30 #define MALIIT_ATTRIBUTE_EXTENSION_DATA "maliit-attribute-extension" 31 32 #define MALIIT_ATTRIBUTE_EXTENSION_DATA_QUARK (g_quark_from_string (MALIIT_ATTRIBUTE_EXTENSION_DATA)) 33 34 #define MALIIT_TYPE_ATTRIBUTE_EXTENSION (maliit_attribute_extension_get_type()) 35 #define MALIIT_ATTRIBUTE_EXTENSION(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, MALIIT_TYPE_ATTRIBUTE_EXTENSION, MaliitAttributeExtension)) 36 #define MALIIT_ATTRIBUTE_EXTENSION_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST(cls, MALIIT_TYPE_ATTRIBUTE_EXTENSION, MaliitAttributeExtensionClass)) 37 #define MALIIT_IS_ATTRIBUTE_EXTENSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, MALIIT_TYPE_ATTRIBUTE_EXTENSION)) 38 #define MALIIT_IS_ATTRIBUTE_EXTENSION_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE(obj, MALIIT_TYPE_ATTRIBUTE_EXTENSION)) 39 #define MALIIT_ATTRIBUTE_EXTENSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MALIIT_TYPE_ATTRIBUTE_EXTENSION, MaliitAttributeExtensionClass)) 40 41 typedef struct _MaliitAttributeExtension MaliitAttributeExtension; 42 typedef struct _MaliitAttributeExtensionClass MaliitAttributeExtensionClass; 43 typedef struct _MaliitAttributeExtensionPrivate MaliitAttributeExtensionPrivate; 44 45 struct _MaliitAttributeExtension 46 { 47 GObject parent; 48 49 /*< private >*/ 50 MaliitAttributeExtensionPrivate *priv; 51 }; 52 53 /** 54 * MaliitAttributeExtensionClass: 55 * @parent_class: The parent class. 56 */ 57 struct _MaliitAttributeExtensionClass 58 { 59 GObjectClass parent_class; 60 }; 61 62 GType 63 maliit_attribute_extension_get_type (void) G_GNUC_CONST; 64 65 MaliitAttributeExtension * 66 maliit_attribute_extension_new (void); 67 68 MaliitAttributeExtension * 69 maliit_attribute_extension_new_with_filename (const gchar* filename); 70 71 GHashTable * 72 maliit_attribute_extension_get_attributes (MaliitAttributeExtension *extension); 73 74 const gchar * 75 maliit_attribute_extension_get_filename (MaliitAttributeExtension *extension); 76 77 int 78 maliit_attribute_extension_get_id (MaliitAttributeExtension *extension); 79 80 void 81 maliit_attribute_extension_update_attribute (MaliitAttributeExtension *extension, 82 const gchar *key, 83 GVariant *value); 84 85 void 86 maliit_attribute_extension_set_attribute (MaliitAttributeExtension *extension, 87 const gchar *key, 88 GVariant *value); 89 90 void 91 maliit_attribute_extension_attach_to_object (MaliitAttributeExtension *extension, 92 GObject *object); 93 94 G_END_DECLS 95 96 #endif /* MALIIT_GLIB_ATTRIBUTE_EXTENSION_H */ 97