Blame src/ibusfactory.h

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_FACTORY_H_
Packit Service 1d8f1c
#define __IBUS_FACTORY_H_
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * SECTION: ibusfactory
Packit Service 1d8f1c
 * @short_description: Factory for creating engine instances.
Packit Service 1d8f1c
 * @title: IBusFactory
Packit Service 1d8f1c
 * @stability: Stable
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * An IBusFactory is an #IBusService that creates input method engine (IME) instance.
Packit Service 1d8f1c
 * It provides CreateEngine remote method, which creates an IME instance by name,
Packit Service 1d8f1c
 * and returns the D-Bus object path to IBus daemon.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * see_also: #IBusEngine
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
Packit Service 1d8f1c
#include "ibusservice.h"
Packit Service 1d8f1c
#include "ibusserializable.h"
Packit Service 1d8f1c
#include "ibusengine.h"
Packit Service 1d8f1c
Packit Service 1d8f1c
G_BEGIN_DECLS
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
/**
Packit Service 1d8f1c
 * IBUS_TYPE_FACTORY:
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Return GType of IBus factory.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
#define IBUS_TYPE_FACTORY               \
Packit Service 1d8f1c
    (ibus_factory_get_type ())
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * IBUS_FACTORY:
Packit Service 1d8f1c
 * @obj: An object which is subject to casting.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Casts an IBUS_FACTORY or derived pointer into a (IBusFactory*) pointer.
Packit Service 1d8f1c
 * Depending on the current debugging level, this function may invoke
Packit Service 1d8f1c
 * certain runtime checks to identify invalid casts.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
#define IBUS_FACTORY(obj)               \
Packit Service 1d8f1c
    (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_FACTORY, IBusFactory))
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * IBUS_FACTORY_CLASS:
Packit Service 1d8f1c
 * @klass: A class to be casted.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Casts a derived IBusFactoryClass structure into a IBusFactoryClass structure.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
#define IBUS_FACTORY_CLASS(klass)       \
Packit Service 1d8f1c
    (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_FACTORY, IBusFactoryClass))
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * IBUS_IS_FACTORY:
Packit Service 1d8f1c
 * @obj: Instance to check for being a IBUS_FACTORY.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Checks whether a valid GTypeInstance pointer is of type IBUS_FACTORY.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
#define IBUS_IS_FACTORY(obj)            \
Packit Service 1d8f1c
    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_FACTORY))
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * IBUS_IS_FACTORY_CLASS:
Packit Service 1d8f1c
 * @klass: A class to be checked.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Checks whether class "is a" valid IBusFactoryClass structure of type IBUS_FACTORY or derived.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
#define IBUS_IS_FACTORY_CLASS(klass)    \
Packit Service 1d8f1c
    (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_FACTORY))
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * IBUS_FACTORY_GET_CLASS:
Packit Service 1d8f1c
 * @obj: An object.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Get the class of a given object and cast the class to IBusFactoryClass.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
#define IBUS_FACTORY_GET_CLASS(obj)     \
Packit Service 1d8f1c
    (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_FACTORY, IBusFactoryClass))
Packit Service 1d8f1c
Packit Service 1d8f1c
typedef struct _IBusFactory IBusFactory;
Packit Service 1d8f1c
typedef struct _IBusFactoryClass IBusFactoryClass;
Packit Service 1d8f1c
typedef struct _IBusFactoryPrivate IBusFactoryPrivate;
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * IBusFactory:
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * An opaque data type representing an IBusFactory.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
struct _IBusFactory {
Packit Service 1d8f1c
    /*< private >*/
Packit Service 1d8f1c
    IBusService parent;
Packit Service 1d8f1c
    IBusFactoryPrivate *priv;
Packit Service 1d8f1c
Packit Service 1d8f1c
    /* instance members */
Packit Service 1d8f1c
};
Packit Service 1d8f1c
Packit Service 1d8f1c
struct _IBusFactoryClass {
Packit Service 1d8f1c
    /*< private >*/
Packit Service 1d8f1c
    IBusServiceClass parent;
Packit Service 1d8f1c
Packit Service 1d8f1c
    /*< public >*/
Packit Service 1d8f1c
    /* signals */
Packit Service 1d8f1c
    IBusEngine *
Packit Service 1d8f1c
                (* create_engine)
Packit Service 1d8f1c
                                    (IBusFactory    *factory,
Packit Service 1d8f1c
                                     const gchar    *engine_name);
Packit Service 1d8f1c
Packit Service 1d8f1c
    /*< private >*/
Packit Service 1d8f1c
    /* padding */
Packit Service 1d8f1c
    gpointer pdummy[7];
Packit Service 1d8f1c
};
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * ibus_factory_info_get_type:
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Gets GType of IBus factory information.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Returns: GType of IBus factory information.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
GType            ibus_factory_get_type          (void);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * ibus_factory_new:
Packit Service 1d8f1c
 * @connection: An GDBusConnection.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Creates a new #IBusFactory.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Returns: A newly allocated #IBusFactory.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
IBusFactory     *ibus_factory_new               (GDBusConnection *connection);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * ibus_factory_add_engine:
Packit Service 1d8f1c
 * @factory: An IBusFactory.
Packit Service 1d8f1c
 * @engine_name: Name of an engine.
Packit Service 1d8f1c
 * @engine_type: GType of an engine.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Add an engine to the factory.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
void             ibus_factory_add_engine        (IBusFactory    *factory,
Packit Service 1d8f1c
                                                 const gchar    *engine_name,
Packit Service 1d8f1c
                                                 GType           engine_type);
Packit Service 1d8f1c
Packit Service 1d8f1c
/**
Packit Service 1d8f1c
 * ibus_factory_create_engine:
Packit Service 1d8f1c
 * @factory: An #IBusFactory.
Packit Service 1d8f1c
 * @engine_name: Name of an engine.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Creates an #IBusEngine with @engine_name.
Packit Service 1d8f1c
 *
Packit Service 1d8f1c
 * Returns: (transfer full): #IBusEngine with @engine_name.
Packit Service 1d8f1c
 */
Packit Service 1d8f1c
IBusEngine      *ibus_factory_create_engine     (IBusFactory    *factory,
Packit Service 1d8f1c
                                                 const gchar    *engine_name);
Packit Service 1d8f1c
Packit Service 1d8f1c
G_END_DECLS
Packit Service 1d8f1c
#endif
Packit Service 1d8f1c