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-2013 Peng Huang <shawn.p.huang@gmail.com> |
5 | * Copyright (C) 2008-2013 Red Hat, Inc. |
6 | * |
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.1 of the License, or (at your option) any later version. |
11 | * |
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. |
16 | * |
17 | * You should have received a copy of the GNU Lesser General Public |
18 | * License along with this library; if not, write to the Free Software |
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
20 | * USA |
21 | */ |
22 | |
23 | #if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION) |
24 | #error "Only <ibus.h> can be included directly" |
25 | #endif |
26 | |
27 | #ifndef __IBUS_ATTRIBUTE_LIST_H_ |
28 | #define __IBUS_ATTRIBUTE_LIST_H_ |
29 | |
30 | /** |
31 | * SECTION: ibusattrlist |
32 | * @Title: IBusAttrList |
33 | * @Short_description: AttrList of IBusText. |
34 | * @See_also: #IBusAttribute #IBusText |
35 | * @Stability: Stable |
36 | * |
37 | */ |
38 | |
39 | #include "ibusattribute.h" |
40 | |
41 | G_BEGIN_DECLS |
42 | |
43 | /* |
44 | * Type macros. |
45 | */ |
46 | /* define IBusAttrList macros */ |
47 | #define IBUS_TYPE_ATTR_LIST \ |
48 | (ibus_attr_list_get_type ()) |
49 | #define IBUS_ATTR_LIST(obj) \ |
50 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_ATTR_LIST, IBusAttrList)) |
51 | #define IBUS_ATTR_LIST_CLASS(klass) \ |
52 | (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_ATTR_LIST, IBusAttrListClass)) |
53 | #define IBUS_IS_ATTR_LIST(obj) \ |
54 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_ATTR_LIST)) |
55 | #define IBUS_IS_ATTR_LIST_CLASS(klass) \ |
56 | (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_ATTR_LIST)) |
57 | #define IBUS_ATTR_LIST_GET_CLASS(obj) \ |
58 | (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_ATTR_LIST, IBusAttrListClass)) |
59 | |
60 | |
61 | typedef struct _IBusAttrList IBusAttrList; |
62 | typedef struct _IBusAttrListClass IBusAttrListClass; |
63 | |
64 | /** |
65 | * IBusAttrList: |
66 | * @attributes: GArray that holds #IBusAttribute. |
67 | * |
68 | * Array of IBusAttribute. |
69 | */ |
70 | struct _IBusAttrList { |
71 | IBusSerializable parent; |
72 | |
73 | /*< public >*/ |
74 | GArray *attributes; |
75 | }; |
76 | |
77 | struct _IBusAttrListClass { |
78 | IBusSerializableClass parent; |
79 | }; |
80 | |
81 | /** |
82 | * ibus_attr_list_get_type: |
83 | * |
84 | * Returns GType of #IBusAttrList. |
85 | * |
86 | * Returns: GType of #IBusAttrList. |
87 | */ |
88 | GType ibus_attr_list_get_type (); |
89 | |
90 | /** |
91 | * ibus_attr_list_new: |
92 | * |
93 | * Creates an new #IBusAttrList. |
94 | * |
95 | * Returns: A newly allocated #IBusAttrList. |
96 | */ |
97 | IBusAttrList *ibus_attr_list_new (); |
98 | |
99 | /** |
100 | * ibus_attr_list_append: |
101 | * @attr_list: An IBusAttrList instance. |
102 | * @attr: The IBusAttribute instance to be appended. |
103 | * |
104 | * Append an IBusAttribute to IBusAttrList, and increase reference. |
105 | */ |
106 | void ibus_attr_list_append (IBusAttrList *attr_list, |
107 | IBusAttribute *attr); |
108 | /** |
109 | * ibus_attr_list_get: |
110 | * @attr_list: An IBusAttrList instance. |
111 | * @index: Index of the @attr_list. |
112 | * |
113 | * Returns #IBusAttribute at given index. Borrowed reference. |
114 | * |
115 | * Returns: (transfer none): #IBusAttribute at given index, %NULL if no such |
116 | * #IBusAttribute. |
117 | */ |
118 | IBusAttribute *ibus_attr_list_get (IBusAttrList *attr_list, |
119 | guint index); |
120 | |
121 | G_END_DECLS |
122 | #endif |
123 | |
124 | |