1 /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
2 /* vim:set et sts=4: */
3 /* IBus - The Input Bus
4 * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
5 * Copyright (C) 2008-2010 Red Hat, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library 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 GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
24 #error "Only <ibus.h> can be included directly"
28 * SECTION: ibusproplist
29 * @Title: IBusPropList
30 * @Short_description: An #IBusProperty container.
33 * @See_also: #IBusProperty, #IBusEngine
36 #ifndef __IBUS_PROP_LIST_H_
37 #define __IBUS_PROP_LIST_H_
39 #include "ibusserializable.h"
40 #include "ibusproperty.h"
47 /* define IBusPropList macros */
48 #define IBUS_TYPE_PROP_LIST \
49 (ibus_prop_list_get_type ())
50 #define IBUS_PROP_LIST(obj) \
51 (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_PROP_LIST, IBusPropList))
52 #define IBUS_PROP_LIST_CLASS(klass) \
53 (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_PROP_LIST, IBusPropListClass))
54 #define IBUS_IS_PROP_LIST(obj) \
55 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_PROP_LIST))
56 #define IBUS_IS_PROP_LIST_CLASS(klass) \
57 (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_PROP_LIST))
58 #define IBUS_PROP_LIST_GET_CLASS(obj) \
59 (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_PROP_LIST, IBusPropListClass))
61 #ifndef __PROPLIST_DEFINED
62 #define __PROPLIST_DEFINED
63 typedef struct _IBusPropList IBusPropList;
64 typedef struct _IBusPropListClass IBusPropListClass;
69 * @properties: GArray that holds IBusProperties.
71 * An array of IBusProperties.
73 struct _IBusPropList {
74 IBusSerializable parent;
80 struct _IBusPropListClass {
81 IBusSerializableClass parent;
84 GType ibus_prop_list_get_type ();
88 * @returns: A newly allocated IBusPropList.
92 IBusPropList *ibus_prop_list_new ();
95 * ibus_prop_list_append:
96 * @prop_list: An IBusPropList.
97 * @prop: IBusProperty to be append to @prop_list.
99 * Append an IBusProperty to an IBusPropList, and increase reference.
101 void ibus_prop_list_append (IBusPropList *prop_list,
105 * ibus_prop_list_get:
106 * @prop_list: An IBusPropList.
107 * @index: Index of an IBusPropList.
108 * @returns: (transfer none): IBusProperty at given index, NULL if no such IBusProperty.
110 * Returns IBusProperty at given index. Borrowed reference.
112 IBusProperty *ibus_prop_list_get (IBusPropList *prop_list,
116 * ibus_prop_list_update_property:
117 * @prop_list: An IBusPropList.
118 * @prop: IBusProperty to be update.
119 * @returns: TRUE if succeeded, FALSE otherwise.
121 * Update an IBusProperty in IBusPropList.
123 gboolean ibus_prop_list_update_property
124 (IBusPropList *prop_list,