Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- newtype Serializable = Serializable (ManagedPtr Serializable)
- class (GObject o, IsDescendantOf Serializable o) => IsSerializable o
- toSerializable :: (MonadIO m, IsSerializable o) => o -> m Serializable
- serializableCopy :: (HasCallStack, MonadIO m, IsSerializable a) => a -> m Serializable
- serializableDeserializeObject :: (HasCallStack, MonadIO m) => GVariant -> m Serializable
- serializableGetQattachment :: (HasCallStack, MonadIO m, IsSerializable a) => a -> Word32 -> m GVariant
- serializableNew :: (HasCallStack, MonadIO m) => m Serializable
- serializableRemoveQattachment :: (HasCallStack, MonadIO m, IsSerializable a) => a -> Word32 -> m ()
- serializableSerializeObject :: (HasCallStack, MonadIO m, IsSerializable a) => a -> m GVariant
- serializableSetQattachment :: (HasCallStack, MonadIO m, IsSerializable a) => a -> Word32 -> GVariant -> m ()
Exported types
newtype Serializable Source #
Memory-managed wrapper type.
Serializable (ManagedPtr Serializable) |
Instances
Eq Serializable Source # | |
Defined in GI.IBus.Objects.Serializable (==) :: Serializable -> Serializable -> Bool # (/=) :: Serializable -> Serializable -> Bool # | |
GObject Serializable Source # | |
Defined in GI.IBus.Objects.Serializable | |
ManagedPtrNewtype Serializable Source # | |
Defined in GI.IBus.Objects.Serializable toManagedPtr :: Serializable -> ManagedPtr Serializable | |
TypedObject Serializable Source # | |
Defined in GI.IBus.Objects.Serializable | |
HasParentTypes Serializable Source # | |
Defined in GI.IBus.Objects.Serializable | |
IsGValue (Maybe Serializable) Source # | Convert |
Defined in GI.IBus.Objects.Serializable gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Serializable -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Serializable) | |
type ParentTypes Serializable Source # | |
Defined in GI.IBus.Objects.Serializable |
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
(GObject o, IsDescendantOf Serializable o) => IsSerializable o Source # | |
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
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, copy, destroy, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, removeQattachment, runDispose, serializeObject, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getProperty, getQattachment, getQdata.
Setters
copy
:: (HasCallStack, MonadIO m, IsSerializable a) | |
=> a |
|
-> m Serializable | Returns: A newly allocated clone object; or See also: |
Clone an Serializable
.
The copy method should be implemented in extended class.
deserializeObject
serializableDeserializeObject Source #
:: (HasCallStack, MonadIO m) | |
=> GVariant |
|
-> m Serializable | Returns: The deserialized See also: |
Deserialize a GVariant
to an Serializable
/
The deserialize method should be implemented in extended class.
getQattachment
serializableGetQattachment Source #
:: (HasCallStack, MonadIO m, IsSerializable a) | |
=> a |
|
-> Word32 |
|
-> m GVariant | Returns: The attached value; or See also: |
Gets a value from attachment of an Serializable
.
new
:: (HasCallStack, MonadIO m) | |
=> m Serializable | Returns: a new instance of |
Creates a new instance of an Serializable
.
removeQattachment
serializableRemoveQattachment Source #
:: (HasCallStack, MonadIO m, IsSerializable a) | |
=> a |
|
-> Word32 |
|
-> m () |
Remove a value from attachment of an Serializable
.
See also: ibus_serializable_remove_attachment()
.
serializeObject
serializableSerializeObject Source #
:: (HasCallStack, MonadIO m, IsSerializable a) | |
=> a |
|
-> m GVariant | Returns: A See also: |
Serialize an Serializable
to a GVariant
.
The serialize method should be implemented in extended class.
setQattachment
serializableSetQattachment Source #
:: (HasCallStack, MonadIO m, IsSerializable a) | |
=> a |
|
-> Word32 |
|
-> GVariant |
|
-> m () |
Attach a value to an Serializable
. If the value is floating,
the serializable will take the ownership.
See also: ibus_serializable_set_attachment()
.