ibusproperty.h | ibusproperty.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
* You should have received a copy of the GNU Lesser General Public | * You should have received a copy of the GNU Lesser General Public | |||
* License along with this library; if not, write to the | * License along with this library; if not, write to the | |||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330, | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |||
* Boston, MA 02111-1307, USA. | * Boston, MA 02111-1307, USA. | |||
*/ | */ | |||
#if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION) | #if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION) | |||
#error "Only <ibus.h> can be included directly" | #error "Only <ibus.h> can be included directly" | |||
#endif | #endif | |||
#ifndef __IBUS_PROPERTY_H_ | ||||
#define __IBUS_PROPERTY_H_ | ||||
#include "ibusserializable.h" | ||||
#include "ibustext.h" | ||||
/** | /** | |||
* SECTION: ibusproperty | * SECTION: ibusproperty | |||
* @short_description: UI component for input method engine property. | * @short_description: UI component for input method engine property. | |||
* @title: IBusProperty | * @title: IBusProperty | |||
* @stability: Stable | * @stability: Stable | |||
* | * | |||
* An IBusProperty is an UI component like a button or a menu item | * An IBusProperty is an UI component like a button or a menu item | |||
* which shows the status of corresponding input method engine property. | * which shows the status of corresponding input method engine property. | |||
* End user can operate and see the current status of IME through these com ponents. | * End user can operate and see the current status of IME through these com ponents. | |||
* For example, ibus-chewing users change the English/Chinese input mode by | * For example, ibus-chewing users change the English/Chinese input mode by | |||
* pressing ctrl-space or click on the Eng/Chi switch button. | * pressing ctrl-space or click on the Eng/Chi switch button. | |||
* And the IBusProperty shows the change correspondingly. | * And the IBusProperty shows the change correspondingly. | |||
* | * | |||
* @see_also: #IBusPropList, #IBusEngine | * see_also: #IBusPropList, #IBusEngine | |||
*/ | */ | |||
#ifndef __IBUS_PROPERTY_H_ | ||||
#define __IBUS_PROPERTY_H_ | ||||
#include "ibusserializable.h" | ||||
#include "ibustext.h" | ||||
G_BEGIN_DECLS | G_BEGIN_DECLS | |||
/* | /* | |||
* Type macros. | * Type macros. | |||
*/ | */ | |||
/* define IBusProperty macros */ | /* define IBusProperty macros */ | |||
#define IBUS_TYPE_PROPERTY \ | #define IBUS_TYPE_PROPERTY \ | |||
(ibus_property_get_type ()) | (ibus_property_get_type ()) | |||
#define IBUS_PROPERTY(obj) \ | #define IBUS_PROPERTY(obj) \ | |||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_PROPERTY, IBusProperty)) | (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_PROPERTY, IBusProperty)) | |||
skipping to change at line 93 | skipping to change at line 93 | |||
PROP_TYPE_SEPARATOR = 4, | PROP_TYPE_SEPARATOR = 4, | |||
} IBusPropType; | } IBusPropType; | |||
/** | /** | |||
* IBusPropState: | * IBusPropState: | |||
* @PROP_STATE_UNCHECKED: Property option is unchecked. | * @PROP_STATE_UNCHECKED: Property option is unchecked. | |||
* @PROP_STATE_CHECKED: Property option is checked. | * @PROP_STATE_CHECKED: Property option is checked. | |||
* @PROP_STATE_INCONSISTENT: The state is inconsistent with the associated IME | * @PROP_STATE_INCONSISTENT: The state is inconsistent with the associated IME | |||
* property. | * property. | |||
* | * | |||
* State of IBusProperty. The actual effect depends on #IBusPropType of the | * State of #IBusProperty. The actual effect depends on #IBusPropType of th e | |||
* IBusProperty. | * IBusProperty. | |||
* | * | |||
* <variablelist> | * <variablelist> | |||
* <varlistentry> | * <varlistentry> | |||
* <term>PROP_TYPE_TOGGLE</term> | * <term>PROP_TYPE_TOGGLE</term> | |||
* <listitem><para>Emphasized if PROP_STATE_CHECKED, normal otherwi se.</para></listitem> | * <listitem><para>Emphasized if PROP_STATE_CHECKED, normal otherwi se.</para></listitem> | |||
* </varlistentry> | * </varlistentry> | |||
* <varlistentry> | * <varlistentry> | |||
* <term>PROP_TYPE_RADIO</term> | * <term>PROP_TYPE_RADIO</term> | |||
* <listitem><para>Option checked if PROP_STATE_CHECKED, unchecked otherwise.</para></listitem> | * <listitem><para>Option checked if PROP_STATE_CHECKED, unchecked otherwise.</para></listitem> | |||
skipping to change at line 129 | skipping to change at line 129 | |||
#define __PROPLIST_DEFINED | #define __PROPLIST_DEFINED | |||
typedef struct _IBusPropList IBusPropList; | typedef struct _IBusPropList IBusPropList; | |||
typedef struct _IBusPropListClass IBusPropListClass; | typedef struct _IBusPropListClass IBusPropListClass; | |||
#endif | #endif | |||
/** | /** | |||
* IBusProperty: | * IBusProperty: | |||
* @key: Unique Identity for the IBusProperty. | * @key: Unique Identity for the IBusProperty. | |||
* @icon: Icon file for the IBusProperty. | * @icon: Icon file for the IBusProperty. | |||
* @label: Text shown in UI. | * @label: Text shown in UI. | |||
* @symbol: A symbol char showned on a button or status icon for IBusProper ty. | ||||
* @tooltip: Message shown if mouse hovered the IBusProperty. | * @tooltip: Message shown if mouse hovered the IBusProperty. | |||
* @sensitive: Whether the IBusProperty is sensitive to keyboard and mouse event. | * @sensitive: Whether the IBusProperty is sensitive to keyboard and mouse event. | |||
* @visible: Whether the IBusProperty is visible. | * @visible: Whether the IBusProperty is visible. | |||
* @type: IBusPropType of IBusProperty. | * @type: IBusPropType of IBusProperty. | |||
* @state: IBusPropState of IBusProperty. | * @state: IBusPropState of IBusProperty. | |||
* @sub_props: IBusPropList that contains sub IBusProperties. These IBusPro perties are usually | * @sub_props: IBusPropList that contains sub IBusProperties. These IBusPro perties are usually | |||
* shown as sub menu item. | * shown as sub menu item. | |||
* | * | |||
* UI component for input method engine property. | * UI component for input method engine property. | |||
*/ | */ | |||
skipping to change at line 155 | skipping to change at line 156 | |||
}; | }; | |||
struct _IBusPropertyClass { | struct _IBusPropertyClass { | |||
IBusSerializableClass parent; | IBusSerializableClass parent; | |||
}; | }; | |||
GType ibus_property_get_type (); | GType ibus_property_get_type (); | |||
/** | /** | |||
* ibus_property_new: | * ibus_property_new: | |||
* @key: Unique Identity for the IBusProperty. | * @key: Unique Identity for the #IBusProperty. | |||
* @type: IBusPropType of IBusProperty. | * @type: #IBusPropType of #IBusProperty. | |||
* @label: Text shown in UI. | * @label: Text shown in UI. | |||
* @icon: (allow-none): Icon file for the IBusProperty. | * @icon: (allow-none): Icon file for the #IBusProperty. | |||
* @tooltip: Message shown if mouse hovered the IBusProperty. | * @tooltip: Message shown if mouse hovered the #IBusProperty. | |||
* @sensitive: Whether the IBusProperty is sensitive to keyboard and mouse | * @sensitive: Whether the #IBusProperty is sensitive to keyboard and mouse | |||
event. | event. | |||
* @visible: Whether the IBusProperty is visible. | * @visible: Whether the #IBusProperty is visible. | |||
* @state: IBusPropState of IBusProperty. | * @state: IBusPropState of #IBusProperty. | |||
* @prop_list: (allow-none): IBusPropList that contains sub IBusProperties. | * @prop_list: (allow-none): #IBusPropList that contains sub IBusProperties | |||
* @returns: A newly allocated IBusProperty. | . | |||
* @returns: A newly allocated #IBusProperty. | ||||
* | * | |||
* New a IBusProperty. | * New a #IBusProperty. | |||
*/ | */ | |||
IBusProperty *ibus_property_new (const gchar *key, | IBusProperty *ibus_property_new (const gchar *key, | |||
IBusPropType type, | IBusPropType type, | |||
IBusText *label, | IBusText *label, | |||
const gchar *icon, | const gchar *icon, | |||
IBusText *tooltip, | IBusText *tooltip, | |||
gboolean sensitive, | gboolean sensitive, | |||
gboolean visible, | gboolean visible, | |||
IBusPropState state, | IBusPropState state, | |||
IBusPropList *prop_list); | IBusPropList *prop_list); | |||
/** | /** | |||
* ibus_property_new_varargs: | ||||
* @first_property_name: Name of the first property. | ||||
* @Varargs: the NULL-terminated arguments of the properties and values. | ||||
* | ||||
* New a #IBusProperty. | ||||
* ibus_property_new_varargs() supports the va_list format. | ||||
* name property is required. e.g. | ||||
* ibus_property_new_varargs("key", "TypingMode", "type", PROP_TYPE_MENU, N | ||||
ULL) | ||||
*/ | ||||
IBusProperty *ibus_property_new_varargs (const gchar *first_property | ||||
_name, | ||||
...); | ||||
/** | ||||
* ibus_property_get_key: | * ibus_property_get_key: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @returns: the key of IBusProperty. Should not be freed. | * @returns: the key of #IBusProperty. Should not be freed. | |||
* | * | |||
* Get the key of IBusProperty. | * Get the key of #IBusProperty. | |||
*/ | */ | |||
const gchar * ibus_property_get_key (IBusProperty *prop); | const gchar * ibus_property_get_key (IBusProperty *prop); | |||
/** | /** | |||
* ibus_property_get_label: | * ibus_property_get_label: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @returns: (transfer none): the label of IBusProperty. Should not be free | * @returns: (transfer none): the label of #IBusProperty. Should not be fre | |||
d. | ed. | |||
* | * | |||
* Get the label of IBusProperty. | * Get the label of #IBusProperty. | |||
*/ | */ | |||
IBusText * ibus_property_get_label (IBusProperty *prop); | IBusText * ibus_property_get_label (IBusProperty *prop); | |||
/** | /** | |||
* ibus_property_set_label: | * ibus_property_set_label: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @label: Text shown in UI. | * @label: Text shown in UI. | |||
* | * | |||
* Set the label of IBusProperty. | * Set the label of #IBusProperty. | |||
*/ | */ | |||
void ibus_property_set_label (IBusProperty *prop, | void ibus_property_set_label (IBusProperty *prop, | |||
IBusText *label); | IBusText *label); | |||
/** | /** | |||
* ibus_property_get_symbol: | ||||
* @prop: An #IBusProperty. | ||||
* @returns: (transfer none): the symbol of #IBusProperty. Should not be fr | ||||
eed. | ||||
* | ||||
* Get the symbol of #IBusProperty. | ||||
*/ | ||||
IBusText * ibus_property_get_symbol (IBusProperty *prop); | ||||
/** | ||||
* ibus_property_set_symbol: | ||||
* @prop: An #IBusProperty. | ||||
* @symbol: Text shown in UI. | ||||
* | ||||
* Set the symbol of #IBusProperty. | ||||
*/ | ||||
void ibus_property_set_symbol (IBusProperty *prop, | ||||
IBusText *symbol); | ||||
/** | ||||
* ibus_property_get_icon: | * ibus_property_get_icon: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @returns: the icon of IBusProperty. Should not be freed. | * @returns: the icon of #IBusProperty. Should not be freed. | |||
* | * | |||
* Get the icon of IBusProperty. | * Get the icon of #IBusProperty. | |||
*/ | */ | |||
const gchar * ibus_property_get_icon (IBusProperty *prop); | const gchar * ibus_property_get_icon (IBusProperty *prop); | |||
/** | /** | |||
* ibus_property_set_icon: | * ibus_property_set_icon: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @icon: Icon shown in UI. It could be a full path of an icon file or an i con name. | * @icon: Icon shown in UI. It could be a full path of an icon file or an i con name. | |||
* | * | |||
* Set the icon of IBusProperty. | * Set the icon of #IBusProperty. | |||
*/ | */ | |||
void ibus_property_set_icon (IBusProperty *prop, | void ibus_property_set_icon (IBusProperty *prop, | |||
const gchar *icon); | const gchar *icon); | |||
/** | /** | |||
* ibus_property_get_tooltip: | * ibus_property_get_tooltip: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @returns: (transfer none): the tooltip of IBusProperty. Should not be fr | * @returns: (transfer none): the tooltip of #IBusProperty. Should not be f | |||
eed. | reed. | |||
* | * | |||
* Get the tooltip of IBusProperty. | * Get the tooltip of #IBusProperty. | |||
*/ | */ | |||
IBusText * ibus_property_get_tooltip (IBusProperty *prop); | IBusText * ibus_property_get_tooltip (IBusProperty *prop); | |||
/** | /** | |||
* ibus_property_set_tooltip: | * ibus_property_set_tooltip: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @tooltip: Text of the tooltip. | * @tooltip: Text of the tooltip. | |||
* | * | |||
* Set the tooltip of IBusProperty. | * Set the tooltip of #IBusProperty. | |||
*/ | */ | |||
void ibus_property_set_tooltip (IBusProperty *prop, | void ibus_property_set_tooltip (IBusProperty *prop, | |||
IBusText *tooltip); | IBusText *tooltip); | |||
/** | /** | |||
* ibus_property_get_sensitive: | * ibus_property_get_sensitive: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @returns: the sensitive of IBusProperty. | * @returns: the sensitive of #IBusProperty. | |||
* | * | |||
* Get the sensitive of IBusProperty. | * Get the sensitive of #IBusProperty. | |||
*/ | */ | |||
gboolean ibus_property_get_sensitive(IBusProperty *prop); | gboolean ibus_property_get_sensitive(IBusProperty *prop); | |||
/** | /** | |||
* ibus_property_set_sensitive: | * ibus_property_set_sensitive: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @sensitive: Whether the IBusProperty is sensitive. | * @sensitive: Whether the #IBusProperty is sensitive. | |||
* | * | |||
* Set whether the IBusProperty is sensitive. | * Set whether the #IBusProperty is sensitive. | |||
*/ | */ | |||
void ibus_property_set_sensitive(IBusProperty *prop, | void ibus_property_set_sensitive(IBusProperty *prop, | |||
gboolean sensitive); | gboolean sensitive); | |||
/** | /** | |||
* ibus_property_get_visible: | * ibus_property_get_visible: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @returns: the visible of IBusProperty. | * @returns: the visible of #IBusProperty. | |||
* | * | |||
* Get the visible of IBusProperty. | * Get the visible of #IBusProperty. | |||
*/ | */ | |||
gboolean ibus_property_get_visible (IBusProperty *prop); | gboolean ibus_property_get_visible (IBusProperty *prop); | |||
/** | /** | |||
* ibus_property_set_visible: | * ibus_property_set_visible: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @visible: Whether the IBusProperty is visible. | * @visible: Whether the #IBusProperty is visible. | |||
* | * | |||
* Set whether the IBusProperty is visible. | * Set whether the #IBusProperty is visible. | |||
*/ | */ | |||
void ibus_property_set_visible (IBusProperty *prop, | void ibus_property_set_visible (IBusProperty *prop, | |||
gboolean visible); | gboolean visible); | |||
/** | /** | |||
* ibus_property_get_property_type: | * ibus_property_get_property_type: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @returns: the type of IBusProperty. | * @returns: the type of #IBusProperty. | |||
* | * | |||
* Get the type of IBusProperty. | * Get the type of #IBusProperty. | |||
*/ | */ | |||
IBusPropType ibus_property_get_prop_type(IBusProperty *prop); | IBusPropType ibus_property_get_prop_type(IBusProperty *prop); | |||
/** | /** | |||
* ibus_property_get_state: | * ibus_property_get_state: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @returns: the state of IBusProperty. | * @returns: the state of #IBusProperty. | |||
* | * | |||
* Get the state of IBusProperty. | * Get the state of #IBusProperty. | |||
*/ | */ | |||
IBusPropState ibus_property_get_state (IBusProperty *prop); | IBusPropState ibus_property_get_state (IBusProperty *prop); | |||
/** | /** | |||
* ibus_property_set_state: | * ibus_property_set_state: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @state: The state of the IBusProperty. | * @state: The state of the #IBusProperty. | |||
* | * | |||
* Set the state of the IBusProperty. | * Set the state of the #IBusProperty. | |||
*/ | */ | |||
void ibus_property_set_state (IBusProperty *prop, | void ibus_property_set_state (IBusProperty *prop, | |||
IBusPropState state); | IBusPropState state); | |||
/** | /** | |||
* ibus_property_get_sub_props: | * ibus_property_get_sub_props: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @returns: (transfer none): the IBusPropList of IBusProperty. | * @returns: (transfer none): the IBusPropList of #IBusProperty. | |||
* Should not be freed. | * Should not be freed. | |||
* | * | |||
* Get the IBusPropList of IBusProperty. | * Get the IBusPropList of #IBusProperty. | |||
*/ | */ | |||
IBusPropList * ibus_property_get_sub_props(IBusProperty *prop); | IBusPropList * ibus_property_get_sub_props(IBusProperty *prop); | |||
/** | /** | |||
* ibus_property_set_sub_props: | * ibus_property_set_sub_props: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @prop_list: IBusPropList that contains sub IBusProperties. | * @prop_list: #IBusPropList that contains sub IBusProperties. | |||
* | * | |||
* Set the sub IBusProperties. | * Set the sub IBusProperties. | |||
*/ | */ | |||
void ibus_property_set_sub_props(IBusProperty *prop, | void ibus_property_set_sub_props(IBusProperty *prop, | |||
IBusPropList *prop_list); | IBusPropList *prop_list); | |||
/** | /** | |||
* ibus_property_update: | * ibus_property_update: | |||
* @prop: An IBusProperty. | * @prop: An #IBusProperty. | |||
* @prop_update: IBusPropList that contains sub IBusProperties. | * @prop_update: #IBusPropList that contains sub IBusProperties. | |||
* @returns: TRUE for update suceeded; FALSE otherwise. | * @returns: TRUE for update suceeded; FALSE otherwise. | |||
* | * | |||
* Update the content of an IBusProperty. | * Update the content of an #IBusProperty. | |||
* IBusProperty @prop_update can either be sub-property of @prop, | * #IBusProperty @prop_update can either be sub-property of @prop, | |||
* or holds new values for @prop. | * or holds new values for @prop. | |||
*/ | */ | |||
gboolean ibus_property_update (IBusProperty *prop, | gboolean ibus_property_update (IBusProperty *prop, | |||
IBusProperty *prop_update); | IBusProperty *prop_update); | |||
G_END_DECLS | G_END_DECLS | |||
#endif | #endif | |||
End of changes. 45 change blocks. | ||||
71 lines changed or deleted | 108 lines changed or added | |||