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: ibusattrlist
29 * @Title: IBusAttrList
30 * @Short_description: AttrList of IBusText.
31 * @See_also: #IBusAttribute #IBusText
35 #ifndef __IBUS_ATTRIBUTE_LIST_H_
36 #define __IBUS_ATTRIBUTE_LIST_H_
38 #include "ibusattribute.h"
45 /* define IBusAttrList macros */
46 #define IBUS_TYPE_ATTR_LIST \
47 (ibus_attr_list_get_type ())
48 #define IBUS_ATTR_LIST(obj) \
49 (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_ATTR_LIST, IBusAttrList))
50 #define IBUS_ATTR_LIST_CLASS(klass) \
51 (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_ATTR_LIST, IBusAttrListClass))
52 #define IBUS_IS_ATTR_LIST(obj) \
53 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_ATTR_LIST))
54 #define IBUS_IS_ATTR_LIST_CLASS(klass) \
55 (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_ATTR_LIST))
56 #define IBUS_ATTR_LIST_GET_CLASS(obj) \
57 (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_ATTR_LIST, IBusAttrListClass))
60 typedef struct _IBusAttrList IBusAttrList;
61 typedef struct _IBusAttrListClass IBusAttrListClass;
65 * @attributes: GArray that holds #IBusAttribute.
67 * Array of IBusAttribute.
69 struct _IBusAttrList {
70 IBusSerializable parent;
76 struct _IBusAttrListClass {
77 IBusSerializableClass parent;
81 * ibus_attr_list_get_type:
82 * @returns: GType of IBusAttrList.
84 * Returns GType of IBusAttrList.
86 GType ibus_attr_list_get_type ();
90 * @returns: A newly allocated IBusAttrList.
92 * New an IBusAttrList.
94 IBusAttrList *ibus_attr_list_new ();
97 * ibus_attr_list_append:
98 * @attr_list: An IBusAttrList instance.
99 * @attr: The IBusAttribute instance to be appended.
101 * Append an IBusAttribute to IBusAttrList, and increase reference.
103 void ibus_attr_list_append (IBusAttrList *attr_list,
104 IBusAttribute *attr);
106 * ibus_attr_list_get:
107 * @attr_list: An IBusAttrList instance.
108 * @index: Index of the @attr_list.
109 * @returns: (transfer none): IBusAttribute at given index, NULL if no such IBusAttribute.
111 * Returns IBusAttribute at given index. Borrowed reference.
113 IBusAttribute *ibus_attr_list_get (IBusAttrList *attr_list,