IBus.Serializable

g GObject.InitiallyUnowned GObject.InitiallyUnowned IBus.Object IBus.Object GObject.InitiallyUnowned->IBus.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned IBus.Serializable IBus.Serializable IBus.Object->IBus.Serializable

Subclasses:

IBus.AttrList, IBus.Attribute, IBus.Component, IBus.EmojiData, IBus.EngineDesc, IBus.ExtensionEvent, IBus.HotkeyProfile, IBus.LookupTable, IBus.ObservedPath, IBus.PropList, IBus.Property, IBus.Registry, IBus.Text, IBus.UnicodeBlock, IBus.UnicodeData, IBus.XEvent

Methods

Inherited:

IBus.Object (2), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

deserialize_object (variant)

class

new ()

copy ()

get_qattachment (key)

remove_qattachment (key)

serialize_object ()

set_qattachment (key, value)

Virtual Methods

Inherited:

IBus.Object (1), GObject.Object (7)

do_copy (src)

do_deserialize (variant)

do_serialize (builder)

Properties

None

Signals

Inherited:

IBus.Object (1), GObject.Object (1)

Fields

Inherited:

IBus.Object (1), GObject.Object (1)

Name

Type

Access

Description

parent

IBus.Object

r

Class Details

class IBus.Serializable(**kwargs)
Bases:

IBus.Object

Abstract:

No

Structure:

IBus.SerializableClass

An IBus.Serializable is an IBus object which can be serialized, that is, to be to and from a GLib.Variant.

This class is to be extended by other class that requires serialization. An extended class should overrides following methods:

  • serialize(object,iter): for serialize.

  • deserialize(object,iter): for deserialize.

  • copy(desc,src): for copy between IBus.Serializable.

See IBus.SerializableSerializeFunc(), IBus.SerializableDeserializeFunc(), IBus.SerializableCopyFunc() for function prototype.

classmethod deserialize_object(variant)
Parameters:

variant (GLib.Variant) – A GLib.Variant.

Returns:

The deserialized IBus.Serializable.

See also: IBus.SerializableCopyFunc().

Return type:

IBus.Serializable

Deserialize a GLib.Variant to an IBus.Serializable/ The deserialize method should be implemented in extended class.

classmethod new()
Returns:

a new instance of IBus.Serializable.

Return type:

IBus.Serializable

Creates a new instance of an IBus.Serializable.

copy()
Returns:

A newly allocated clone object; or None if object is not serializable.

See also: IBus.SerializableCopyFunc().

Return type:

IBus.Serializable

Clone an IBus.Serializable. The copy method should be implemented in extended class.

get_qattachment(key)
Parameters:

key (int) – String formatted key for indexing value.

Returns:

The attached value; or None if fail to retrieve the value.

See also: ibus_serializable_set_attachment().

Return type:

GLib.Variant

Gets a value from attachment of an IBus.Serializable.

remove_qattachment(key)
Parameters:

key (int) – String formatted key for indexing value.

Remove a value from attachment of an IBus.Serializable. See also: ibus_serializable_remove_attachment().

serialize_object()
Returns:

A GLib.Variant.

See also: IBus.SerializableCopyFunc().

Return type:

GLib.Variant

Serialize an IBus.Serializable to a GLib.Variant. The serialize method should be implemented in extended class.

set_qattachment(key, value)
Parameters:
  • key (int) – String formatted key for indexing value.

  • value (GLib.Variant) – Value to be attached or None to remove any prevoius value.

Attach a value to an IBus.Serializable. If the value is floating, the serializable will take the ownership.

See also: ibus_serializable_set_attachment().

do_copy(src) virtual
Parameters:

src (IBus.Serializable) –

Return type:

bool

do_deserialize(variant) virtual
Parameters:

variant (GLib.Variant) –

Return type:

int

do_serialize(builder) virtual
Parameters:

builder (GLib.VariantBuilder) –

Return type:

bool