gi-ibus-1.5.3: IBus bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.IBus.Objects.Serializable

Description

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

This class is to be extended by other class that requires serialization. An extended class should overrides following methods: <itemizedlist> <listitem> <para><function>serialize(object,iter)</function>: for serialize.</para> </listitem> <listitem> <para><function>deserialize(object,iter)</function>: for deserialize.</para> </listitem> <listitem> <para><function>copy(desc,src)</function>: for copy between IBusSerializable.</para> </listitem> </itemizedlist> See IBusSerializableSerializeFunc(), IBusSerializableDeserializeFunc(), IBusSerializableCopyFunc() for function prototype.

Synopsis

Exported types

newtype Serializable Source #

Memory-managed wrapper type.

Constructors

Serializable (ManagedPtr Serializable) 

Instances

Instances details
Eq Serializable Source # 
Instance details

Defined in GI.IBus.Objects.Serializable

GObject Serializable Source # 
Instance details

Defined in GI.IBus.Objects.Serializable

ManagedPtrNewtype Serializable Source # 
Instance details

Defined in GI.IBus.Objects.Serializable

Methods

toManagedPtr :: Serializable -> ManagedPtr Serializable

TypedObject Serializable Source # 
Instance details

Defined in GI.IBus.Objects.Serializable

Methods

glibType :: IO GType

HasParentTypes Serializable Source # 
Instance details

Defined in GI.IBus.Objects.Serializable

IsGValue (Maybe Serializable) Source #

Convert Serializable to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.IBus.Objects.Serializable

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Serializable -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Serializable)

type ParentTypes Serializable Source # 
Instance details

Defined in GI.IBus.Objects.Serializable

type ParentTypes Serializable = '[Object, Object]

class (GObject o, IsDescendantOf Serializable o) => IsSerializable o Source #

Type class for types which can be safely cast to Serializable, for instance with toSerializable.

Instances

Instances details
(GObject o, IsDescendantOf Serializable o) => IsSerializable o Source # 
Instance details

Defined in GI.IBus.Objects.Serializable

toSerializable :: (MonadIO m, IsSerializable o) => o -> m Serializable Source #

Cast to Serializable, for types for which this is known to be safe. For general casts, use castTo.

Methods

copy

serializableCopy Source #

Arguments

:: (HasCallStack, MonadIO m, IsSerializable a) 
=> a

serializable: An Serializable.

-> m Serializable

Returns: A newly allocated clone object; or Nothing if object is not serializable.

See also: IBusSerializableCopyFunc().

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

deserializeObject

serializableDeserializeObject Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GVariant

variant: A GVariant.

-> m Serializable

Returns: The deserialized Serializable.

See also: IBusSerializableCopyFunc().

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

getQattachment

serializableGetQattachment Source #

Arguments

:: (HasCallStack, MonadIO m, IsSerializable a) 
=> a

serializable: An Serializable.

-> Word32

key: String formatted key for indexing value.

-> m GVariant

Returns: The attached value; or Nothing if fail to retrieve the value.

See also: ibus_serializable_set_attachment().

Gets a value from attachment of an Serializable.

new

serializableNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Serializable

Returns: a new instance of Serializable.

Creates a new instance of an Serializable.

removeQattachment

serializableRemoveQattachment Source #

Arguments

:: (HasCallStack, MonadIO m, IsSerializable a) 
=> a

serializable: An Serializable.

-> Word32

key: String formatted key for indexing value.

-> m () 

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

serializeObject

serializableSerializeObject Source #

Arguments

:: (HasCallStack, MonadIO m, IsSerializable a) 
=> a

serializable: An Serializable.

-> m GVariant

Returns: A GVariant.

See also: IBusSerializableCopyFunc().

Serialize an Serializable to a GVariant. The serialize method should be implemented in extended class.

setQattachment

serializableSetQattachment Source #

Arguments

:: (HasCallStack, MonadIO m, IsSerializable a) 
=> a

serializable: An Serializable.

-> Word32

key: String formatted key for indexing value.

-> GVariant

value: Value to be attached or Nothing to remove any prevoius value.

-> m () 

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

See also: ibus_serializable_set_attachment().