1 /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
2 /* vim:set et sts=4: */
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.
22 #ifndef __BUS_REGISTRY_H_
23 #define __BUS_REGISTRY_H_
26 #include "component.h"
32 /* define GOBJECT macros */
33 #define BUS_TYPE_REGISTRY \
34 (bus_registry_get_type ())
35 #define BUS_REGISTRY(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUS_TYPE_REGISTRY, BusRegistry))
37 #define BUS_REGISTRY_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_CAST ((klass), BUS_TYPE_REGISTRY, BusRegistryClass))
39 #define BUS_IS_REGISTRY(obj) \
40 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUS_TYPE_REGISTRY))
41 #define BUS_IS_REGISTRY_CLASS(klass) \
42 (G_TYPE_CHECK_CLASS_TYPE ((klass), BUS_TYPE_REGISTRY))
43 #define BUS_REGISTRY_GET_CLASS(obj) \
44 (G_TYPE_INSTANCE_GET_CLASS ((obj), BUS_TYPE_REGISTRY, BusRegistryClass))
48 typedef struct _BusRegistry BusRegistry;
49 typedef struct _BusRegistryClass BusRegistryClass;
51 GType bus_registry_get_type (void);
52 BusRegistry *bus_registry_new (void);
55 * bus_registry_get_components:
56 * @returns: a list of BusComponent objects. The caller has to call g_list_free for the returned list.
58 GList *bus_registry_get_components (BusRegistry *registry);
61 * bus_registry_get_engines:
62 * @returns: a list of all IBusEngineDesc objects available. The caller has to call g_list_free for the returned list.
64 GList *bus_registry_get_engines (BusRegistry *registry);
67 * bus_registry_get_engines_by_language:
68 * @language: a language name like 'ja'
69 * @returns: a list of IBusEngineDesc objects for the language. The caller has to call g_list_free for the returned list.
71 GList *bus_registry_get_engines_by_language
72 (BusRegistry *registry,
73 const gchar *language);
76 * bus_registry_stop_all_components:
78 * Terminate all component processes.
80 void bus_registry_stop_all_components
81 (BusRegistry *registry);
84 * bus_registry_lookup_component_by_name:
85 * @name: a component name such as 'org.freedesktop.IBus.Panel' and 'com.google.IBus.Mozc'
86 * @returns: a BusComponent object, or NULL if such component is not found.
88 BusComponent *bus_registry_lookup_component_by_name
89 (BusRegistry *registry,
93 * bus_registry_find_engine_by_name:
94 * @name: an engine name like 'pinyin'
95 * @returns: an IBusEngineDesc object, or NULL if not found.
97 IBusEngineDesc *bus_registry_find_engine_by_name
98 (BusRegistry *registry,
102 * bus_registry_name_owner_changed:
103 * @name: a unique or well-known name like ":1.1", "org.freedesktop.IBus.Config", "com.google.IBus.Mozc".
104 * @old_name: a unique name like ":1.1", or empty string "" when the client is started.
105 * @new_name: a unique name like ":1.1", or empty string "" when the client is stopped.
107 * Handle the "name-owner-changed" glib signal from dbusimpl. If a component is stopped, remove a BusFactoryProxy object from the
108 * bus for the component. If a component is started, create a new BusFactoryProxy object for the bus.
110 void bus_registry_name_owner_changed
111 (BusRegistry *registry,
113 const gchar *old_name,
114 const gchar *new_name);
116 void bus_registry_start_monitor_changes
117 (BusRegistry *registry);
118 gboolean bus_registry_is_changed (BusRegistry *registry);