Blame src/ibusproplist.h

Packit 3ff832
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
Packit 3ff832
/* vim:set et sts=4: */
Packit 3ff832
/* IBus - The Input Bus
Packit 3ff832
 * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
Packit 3ff832
 * Copyright (C) 2008-2013 Red Hat, Inc.
Packit 3ff832
 *
Packit 3ff832
 * This library is free software; you can redistribute it and/or
Packit 3ff832
 * modify it under the terms of the GNU Lesser General Public
Packit 3ff832
 * License as published by the Free Software Foundation; either
Packit 3ff832
 * version 2.1 of the License, or (at your option) any later version.
Packit 3ff832
 *
Packit 3ff832
 * This library is distributed in the hope that it will be useful,
Packit 3ff832
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 3ff832
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 3ff832
 * Lesser General Public License for more details.
Packit 3ff832
 *
Packit 3ff832
 * You should have received a copy of the GNU Lesser General Public
Packit 3ff832
 * License along with this library; if not, write to the Free Software
Packit 3ff832
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
Packit 3ff832
 * USA
Packit 3ff832
 */
Packit 3ff832
Packit 3ff832
#if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
Packit 3ff832
#error "Only <ibus.h> can be included directly"
Packit 3ff832
#endif
Packit 3ff832
Packit 3ff832
#ifndef __IBUS_PROP_LIST_H_
Packit 3ff832
#define __IBUS_PROP_LIST_H_
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * SECTION: ibusproplist
Packit 3ff832
 * @Title: IBusPropList
Packit 3ff832
 * @Short_description: An #IBusProperty container.
Packit 3ff832
 * @Stability: Stable
Packit 3ff832
 *
Packit 3ff832
 * See_also: #IBusProperty, #IBusEngine
Packit 3ff832
 *
Packit 3ff832
 */
Packit 3ff832
Packit 3ff832
#include "ibusserializable.h"
Packit 3ff832
#include "ibusproperty.h"
Packit 3ff832
Packit 3ff832
G_BEGIN_DECLS
Packit 3ff832
Packit 3ff832
/*
Packit 3ff832
 * Type macros.
Packit 3ff832
 */
Packit 3ff832
/* define IBusPropList macros */
Packit 3ff832
#define IBUS_TYPE_PROP_LIST             \
Packit 3ff832
    (ibus_prop_list_get_type ())
Packit 3ff832
#define IBUS_PROP_LIST(obj)             \
Packit 3ff832
    (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_PROP_LIST, IBusPropList))
Packit 3ff832
#define IBUS_PROP_LIST_CLASS(klass)     \
Packit 3ff832
    (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_PROP_LIST, IBusPropListClass))
Packit 3ff832
#define IBUS_IS_PROP_LIST(obj)          \
Packit 3ff832
    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_PROP_LIST))
Packit 3ff832
#define IBUS_IS_PROP_LIST_CLASS(klass)  \
Packit 3ff832
    (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_PROP_LIST))
Packit 3ff832
#define IBUS_PROP_LIST_GET_CLASS(obj)   \
Packit 3ff832
    (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_PROP_LIST, IBusPropListClass))
Packit 3ff832
Packit 3ff832
/* FIXME: https://mail.gnome.org/archives/gtk-doc-list/2015-July/msg00004.html
Packit 3ff832
 * If ibusproperty.h and ibusproplist.h includes each other,
Packit 3ff832
 * gtk-doc build outputs several warnings:
Packit 3ff832
 *
Packit 3ff832
 * # cd html && gtkdoc-mkhtml ibus ../ibus-docs.sgml
Packit 3ff832
 * ../ibus-docs.sgml:4: element refentry: validity error : ID IBusPropList
Packit 3ff832
 * already defined
Packit 3ff832
 * ../ibus-docs.sgml:172: element refsect2: validity error : ID
Packit 3ff832
 * IBusPropListClass already defined
Packit 3ff832
 * Warning: multiple "IDs" for constraint linkend: IBusPropList.
Packit 3ff832
 * Warning: multiple "IDs" for constraint linkend: IBusPropList.
Packit 3ff832
 * Warning: multiple "IDs" for constraint linkend: IBusPropListClass.
Packit 3ff832
 */
Packit 3ff832
#ifndef __PROPLIST_DEFINED
Packit 3ff832
#define __PROPLIST_DEFINED
Packit 3ff832
typedef struct _IBusPropList IBusPropList;
Packit 3ff832
typedef struct _IBusPropListClass IBusPropListClass;
Packit 3ff832
#endif
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * IBusPropList:
Packit 3ff832
 * @properties: GArray that holds IBusProperties.
Packit 3ff832
 *
Packit 3ff832
 * An array of IBusProperties.
Packit 3ff832
 */
Packit 3ff832
struct _IBusPropList {
Packit 3ff832
    IBusSerializable parent;
Packit 3ff832
Packit 3ff832
    /*< public >*/
Packit 3ff832
    GArray *properties;
Packit 3ff832
};
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * IBusPropListClass:
Packit 3ff832
 * @parent: The parent class.
Packit 3ff832
 *
Packit 3ff832
 * Class structure for #IBusPropList.
Packit 3ff832
 */
Packit 3ff832
struct _IBusPropListClass {
Packit 3ff832
    IBusSerializableClass parent;
Packit 3ff832
};
Packit 3ff832
Packit 3ff832
GType            ibus_prop_list_get_type    ();
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_prop_list_new:
Packit 3ff832
 *
Packit 3ff832
 * Create a new #IBusPropList.
Packit 3ff832
 *
Packit 3ff832
 * Returns: A newly allocated #IBusPropList.
Packit 3ff832
 */
Packit 3ff832
IBusPropList    *ibus_prop_list_new         ();
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_prop_list_append:
Packit 3ff832
 * @prop_list: An IBusPropList.
Packit 3ff832
 * @prop: IBusProperty to be append to @prop_list.
Packit 3ff832
 *
Packit 3ff832
 * Append an IBusProperty to an IBusPropList, and increase reference.
Packit 3ff832
 */
Packit 3ff832
void             ibus_prop_list_append      (IBusPropList   *prop_list,
Packit 3ff832
                                             IBusProperty   *prop);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_prop_list_get:
Packit 3ff832
 * @prop_list: An IBusPropList.
Packit 3ff832
 * @index: Index of an IBusPropList.
Packit 3ff832
 *
Packit 3ff832
 * Gets #IBusProperty at given index. Borrowed reference.
Packit 3ff832
 *
Packit 3ff832
 * Returns: (transfer none): #IBusProperty at given index, %NULL if no such
Packit 3ff832
 *     #IBusProperty.
Packit 3ff832
 */
Packit 3ff832
IBusProperty    *ibus_prop_list_get         (IBusPropList   *prop_list,
Packit 3ff832
                                             guint           index);
Packit 3ff832
Packit 3ff832
/**
Packit 3ff832
 * ibus_prop_list_update_property:
Packit 3ff832
 * @prop_list: An IBusPropList.
Packit 3ff832
 * @prop: IBusProperty to be update.
Packit 3ff832
 *
Packit 3ff832
 * Update an IBusProperty in IBusPropList.
Packit 3ff832
 *
Packit 3ff832
 * Returns: %TRUE if succeeded, %FALSE otherwise.
Packit 3ff832
 */
Packit 3ff832
gboolean         ibus_prop_list_update_property
Packit 3ff832
                                            (IBusPropList   *prop_list,
Packit 3ff832
                                             IBusProperty   *prop);
Packit 3ff832
G_END_DECLS
Packit 3ff832
#endif