Add Ctrl+space customization.
[platform/upstream/ibus.git] / src / ibusproplist.h
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.
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 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
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, 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 /**
28  * SECTION: ibusproplist
29  * @Title: IBusPropList
30  * @Short_description: An #IBusProperty container.
31  * @Stability: Stable
32  *
33  * @See_also: #IBusProperty, #IBusEngine
34  *
35  */
36 #ifndef __IBUS_PROP_LIST_H_
37 #define __IBUS_PROP_LIST_H_
38
39 #include "ibusserializable.h"
40 #include "ibusproperty.h"
41
42 G_BEGIN_DECLS
43
44 /*
45  * Type macros.
46  */
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))
60
61 #ifndef __PROPLIST_DEFINED
62 #define __PROPLIST_DEFINED
63 typedef struct _IBusPropList IBusPropList;
64 typedef struct _IBusPropListClass IBusPropListClass;
65 #endif
66
67 /**
68  * IBusPropList:
69  * @properties: GArray that holds IBusProperties.
70  *
71  * An array of IBusProperties.
72  */
73 struct _IBusPropList {
74     IBusSerializable parent;
75
76     /*< public >*/
77     GArray *properties;
78 };
79
80 struct _IBusPropListClass {
81     IBusSerializableClass parent;
82 };
83
84 GType            ibus_prop_list_get_type    ();
85
86 /**
87  * ibus_prop_list_new:
88  * @returns: A newly allocated IBusPropList.
89  *
90  * New a IBusPropList.
91  */
92 IBusPropList    *ibus_prop_list_new         ();
93
94 /**
95  * ibus_prop_list_append:
96  * @prop_list: An IBusPropList.
97  * @prop: IBusProperty to be append to @prop_list.
98  *
99  * Append an IBusProperty to an IBusPropList, and increase reference.
100  */
101 void             ibus_prop_list_append      (IBusPropList   *prop_list,
102                                              IBusProperty   *prop);
103
104 /**
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.
109  *
110  * Returns IBusProperty at given index. Borrowed reference.
111  */
112 IBusProperty    *ibus_prop_list_get         (IBusPropList   *prop_list,
113                                              guint           index);
114
115 /**
116  * ibus_prop_list_update_property:
117  * @prop_list: An IBusPropList.
118  * @prop: IBusProperty to be update.
119  * @returns: TRUE if succeeded, FALSE otherwise.
120  *
121  * Update an IBusProperty in IBusPropList.
122  */
123 gboolean         ibus_prop_list_update_property
124                                             (IBusPropList   *prop_list,
125                                              IBusProperty   *prop);
126 G_END_DECLS
127 #endif