|
Packit Service |
1d8f1c |
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
|
|
Packit Service |
1d8f1c |
/* vim:set et sts=4: */
|
|
Packit Service |
1d8f1c |
/* ibus - The Input Bus
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
|
|
Packit Service |
1d8f1c |
* Copyright (C) 2008-2013 Red Hat, Inc.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* This library is free software; you can redistribute it and/or
|
|
Packit Service |
1d8f1c |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
* License as published by the Free Software Foundation; either
|
|
Packit Service |
1d8f1c |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* This library is distributed in the hope that it will be useful,
|
|
Packit Service |
1d8f1c |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
1d8f1c |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
1d8f1c |
* Lesser General Public License for more details.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
1d8f1c |
* License along with this library; if not, write to the Free Software
|
|
Packit Service |
1d8f1c |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
|
Packit Service |
1d8f1c |
* USA
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
|
|
Packit Service |
1d8f1c |
#error "Only <ibus.h> can be included directly"
|
|
Packit Service |
1d8f1c |
#endif
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#ifndef __IBUS_CONFIG_SERVICE_H_
|
|
Packit Service |
1d8f1c |
#define __IBUS_CONFIG_SERVICE_H_
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* SECTION: ibusconfigservice
|
|
Packit Service |
1d8f1c |
* @short_description: Configuration service back-end.
|
|
Packit Service |
1d8f1c |
* @stability: Stable
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* An IBusConfigService is a base class for other configuration services such as GConf.
|
|
Packit Service |
1d8f1c |
* Currently, directly known sub class is IBusConfigGConf.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* IBusConfigServiceClass has following member functions:
|
|
Packit Service |
1d8f1c |
* <itemizedlist>
|
|
Packit Service |
1d8f1c |
* <listitem>
|
|
Packit Service |
1d8f1c |
* <para>gboolean set_value(IBusConfigService *config, const gchar *section, const gchar *name,
|
|
Packit Service |
1d8f1c |
* const GValue *value, IBusError **error)
|
|
Packit Service |
1d8f1c |
* </para>
|
|
Packit Service |
1d8f1c |
* <variablelist>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>config:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>A configure service</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>section:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>Section name of the configuration option.</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>name:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>Name of the configuration option.</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>value:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>GValue that holds the value.</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>error:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>Error outputs here.</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>Returns:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>TRUE if succeed; FALSE otherwise.</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* </variablelist>
|
|
Packit Service |
1d8f1c |
* <para>Set a value to a configuration option.
|
|
Packit Service |
1d8f1c |
* </para>
|
|
Packit Service |
1d8f1c |
* </listitem>
|
|
Packit Service |
1d8f1c |
* <listitem>
|
|
Packit Service |
1d8f1c |
* <para>gboolean get_value(IBusConfigService *config, const gchar *section, const gchar *name,
|
|
Packit Service |
1d8f1c |
* GValue *value, IBusError **error)
|
|
Packit Service |
1d8f1c |
* </para>
|
|
Packit Service |
1d8f1c |
* <variablelist>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>config:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>A configure service</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>section:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>Section name of the configuration option.</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>name:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>Name of the configuration option.</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>value:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>GValue that holds the value.</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>error:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>Error outputs here.</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>Returns:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>TRUE if succeed; FALSE otherwise.</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* </variablelist>
|
|
Packit Service |
1d8f1c |
* <para>Get value of a configuration option.
|
|
Packit Service |
1d8f1c |
* </para>
|
|
Packit Service |
1d8f1c |
* </listitem>
|
|
Packit Service |
1d8f1c |
* <listitem>
|
|
Packit Service |
1d8f1c |
* <para>gboolean unset(IBusConfigService *config, const gchar *section, const gchar *name,
|
|
Packit Service |
1d8f1c |
* IBusError **error)
|
|
Packit Service |
1d8f1c |
* </para>
|
|
Packit Service |
1d8f1c |
* <variablelist>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>config:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>A configure service</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>section:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>Section name of the configuration option.</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>name:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>Name of the configuration option.</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>error:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>Error outputs here.</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* <varlistentry>
|
|
Packit Service |
1d8f1c |
* <term>Returns:</term>
|
|
Packit Service |
1d8f1c |
* <listitem>TRUE if succeed; FALSE otherwise.</listitem>
|
|
Packit Service |
1d8f1c |
* </varlistentry>
|
|
Packit Service |
1d8f1c |
* </variablelist>
|
|
Packit Service |
1d8f1c |
* <para>Remove an entry to a configuration option.
|
|
Packit Service |
1d8f1c |
* </para>
|
|
Packit Service |
1d8f1c |
* </listitem>
|
|
Packit Service |
1d8f1c |
* </itemizedlist>
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
#include "ibusservice.h"
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/*
|
|
Packit Service |
1d8f1c |
* Type macros.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* define GOBJECT macros */
|
|
Packit Service |
1d8f1c |
#define IBUS_TYPE_CONFIG_SERVICE \
|
|
Packit Service |
1d8f1c |
(ibus_config_service_get_type ())
|
|
Packit Service |
1d8f1c |
#define IBUS_CONFIG_SERVICE(obj) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_CONFIG_SERVICE, IBusConfigService))
|
|
Packit Service |
1d8f1c |
#define IBUS_CONFIG_SERVICE_CLASS(klass) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_CONFIG_SERVICE, IBusConfigServiceClass))
|
|
Packit Service |
1d8f1c |
#define IBUS_IS_CONFIG_SERVICE(obj) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_CONFIG_SERVICE))
|
|
Packit Service |
1d8f1c |
#define IBUS_IS_CONFIG_SERVICE_CLASS(klass) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_CONFIG_SERVICE))
|
|
Packit Service |
1d8f1c |
#define IBUS_CONFIG_SERVICE_GET_CLASS(obj) \
|
|
Packit Service |
1d8f1c |
(G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_CONFIG_SERVICE, IBusConfigServiceClass))
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_BEGIN_DECLS
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
typedef struct _IBusConfigService IBusConfigService;
|
|
Packit Service |
1d8f1c |
typedef struct _IBusConfigServiceClass IBusConfigServiceClass;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* IBusConfigService:
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* An opaque data type representing a configure service.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
struct _IBusConfigService {
|
|
Packit Service |
1d8f1c |
/*< private >*/
|
|
Packit Service |
1d8f1c |
IBusService parent;
|
|
Packit Service |
1d8f1c |
/* IBusConfigServicePriv *priv */
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/* instance members */
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
struct _IBusConfigServiceClass {
|
|
Packit Service |
1d8f1c |
/*< private >*/
|
|
Packit Service |
1d8f1c |
IBusServiceClass parent;
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/*< public >*/
|
|
Packit Service |
1d8f1c |
/* class members */
|
|
Packit Service |
1d8f1c |
gboolean (* set_value) (IBusConfigService *config,
|
|
Packit Service |
1d8f1c |
const gchar *section,
|
|
Packit Service |
1d8f1c |
const gchar *name,
|
|
Packit Service |
1d8f1c |
GVariant *value,
|
|
Packit Service |
1d8f1c |
GError **error);
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* get_value:
|
|
Packit Service |
1d8f1c |
* @config: An #IBusConfig.
|
|
Packit Service |
1d8f1c |
* @section: section name
|
|
Packit Service |
1d8f1c |
* @name: value name
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: (transfer full): The value in config associated with section
|
|
Packit Service |
1d8f1c |
* and name.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
GVariant * (* get_value) (IBusConfigService *config,
|
|
Packit Service |
1d8f1c |
const gchar *section,
|
|
Packit Service |
1d8f1c |
const gchar *name,
|
|
Packit Service |
1d8f1c |
GError **error);
|
|
Packit Service |
1d8f1c |
gboolean (* unset_value) (IBusConfigService *config,
|
|
Packit Service |
1d8f1c |
const gchar *section,
|
|
Packit Service |
1d8f1c |
const gchar *name,
|
|
Packit Service |
1d8f1c |
GError **error);
|
|
Packit Service |
1d8f1c |
GVariant * (* get_values) (IBusConfigService *config,
|
|
Packit Service |
1d8f1c |
const gchar *section,
|
|
Packit Service |
1d8f1c |
GError **error);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/*< private >*/
|
|
Packit Service |
1d8f1c |
/* padding */
|
|
Packit Service |
1d8f1c |
gpointer pdummy[12];
|
|
Packit Service |
1d8f1c |
};
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
GType ibus_config_service_get_type (void);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_config_service_new:
|
|
Packit Service |
1d8f1c |
* @connection: An #GDBusConnection.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Creates an new #IBusConfigService from an #GDBusConnection.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Returns: A newly allocated #IBusConfigServices.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
IBusConfigService *ibus_config_service_new (GDBusConnection *connection);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
/**
|
|
Packit Service |
1d8f1c |
* ibus_config_service_value_changed:
|
|
Packit Service |
1d8f1c |
* @config: An IBusConfigService.
|
|
Packit Service |
1d8f1c |
* @section: Section name of the configuration option.
|
|
Packit Service |
1d8f1c |
* @name: Name of the configure option.
|
|
Packit Service |
1d8f1c |
* @value: GVariant that holds the value.
|
|
Packit Service |
1d8f1c |
*
|
|
Packit Service |
1d8f1c |
* Change a value of a configuration option
|
|
Packit Service |
1d8f1c |
* by sending a "ValueChanged" message to IBus service.
|
|
Packit Service |
1d8f1c |
*/
|
|
Packit Service |
1d8f1c |
void ibus_config_service_value_changed
|
|
Packit Service |
1d8f1c |
(IBusConfigService *config,
|
|
Packit Service |
1d8f1c |
const gchar *section,
|
|
Packit Service |
1d8f1c |
const gchar *name,
|
|
Packit Service |
1d8f1c |
GVariant *value);
|
|
Packit Service |
1d8f1c |
|
|
Packit Service |
1d8f1c |
G_END_DECLS
|
|
Packit Service |
1d8f1c |
#endif
|
|
Packit Service |
1d8f1c |
|