{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Unicode data likes code, name, alias, block-name.
-- You can get extended values with g_object_get_properties.

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.IBus.Objects.UnicodeData
    ( 
#if defined(ENABLE_OVERLOADING)
    UnicodeDataLoadAsyncMethodInfo          ,
#endif

-- * Exported types
    UnicodeData(..)                         ,
    IsUnicodeData                           ,
    toUnicodeData                           ,


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveUnicodeDataMethod                ,
#endif


-- ** getAlias #method:getAlias#

#if defined(ENABLE_OVERLOADING)
    UnicodeDataGetAliasMethodInfo           ,
#endif
    unicodeDataGetAlias                     ,


-- ** getBlockName #method:getBlockName#

#if defined(ENABLE_OVERLOADING)
    UnicodeDataGetBlockNameMethodInfo       ,
#endif
    unicodeDataGetBlockName                 ,


-- ** getCode #method:getCode#

#if defined(ENABLE_OVERLOADING)
    UnicodeDataGetCodeMethodInfo            ,
#endif
    unicodeDataGetCode                      ,


-- ** getName #method:getName#

#if defined(ENABLE_OVERLOADING)
    UnicodeDataGetNameMethodInfo            ,
#endif
    unicodeDataGetName                      ,


-- ** load #method:load#

    unicodeDataLoad                         ,


-- ** save #method:save#

    unicodeDataSave                         ,


-- ** setBlockName #method:setBlockName#

#if defined(ENABLE_OVERLOADING)
    UnicodeDataSetBlockNameMethodInfo       ,
#endif
    unicodeDataSetBlockName                 ,




 -- * Properties
-- ** alias #attr:alias#
-- | The Uniode alias name

#if defined(ENABLE_OVERLOADING)
    UnicodeDataAliasPropertyInfo            ,
#endif
    clearUnicodeDataAlias                   ,
    constructUnicodeDataAlias               ,
    getUnicodeDataAlias                     ,
    setUnicodeDataAlias                     ,
#if defined(ENABLE_OVERLOADING)
    unicodeDataAlias                        ,
#endif


-- ** blockName #attr:blockName#
-- | The Uniode block name

#if defined(ENABLE_OVERLOADING)
    UnicodeDataBlockNamePropertyInfo        ,
#endif
    constructUnicodeDataBlockName           ,
    getUnicodeDataBlockName                 ,
    setUnicodeDataBlockName                 ,
#if defined(ENABLE_OVERLOADING)
    unicodeDataBlockName                    ,
#endif


-- ** code #attr:code#
-- | The Uniode code point

#if defined(ENABLE_OVERLOADING)
    UnicodeDataCodePropertyInfo             ,
#endif
    constructUnicodeDataCode                ,
    getUnicodeDataCode                      ,
#if defined(ENABLE_OVERLOADING)
    unicodeDataCode                         ,
#endif


-- ** name #attr:name#
-- | The Uniode name

#if defined(ENABLE_OVERLOADING)
    UnicodeDataNamePropertyInfo             ,
#endif
    clearUnicodeDataName                    ,
    constructUnicodeDataName                ,
    getUnicodeDataName                      ,
    setUnicodeDataName                      ,
#if defined(ENABLE_OVERLOADING)
    unicodeDataName                         ,
#endif




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.IBus.Objects.Object as IBus.Object
import {-# SOURCE #-} qualified GI.IBus.Objects.Serializable as IBus.Serializable

-- | Memory-managed wrapper type.
newtype UnicodeData = UnicodeData (SP.ManagedPtr UnicodeData)
    deriving (UnicodeData -> UnicodeData -> Bool
(UnicodeData -> UnicodeData -> Bool)
-> (UnicodeData -> UnicodeData -> Bool) -> Eq UnicodeData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnicodeData -> UnicodeData -> Bool
$c/= :: UnicodeData -> UnicodeData -> Bool
== :: UnicodeData -> UnicodeData -> Bool
$c== :: UnicodeData -> UnicodeData -> Bool
Eq)

instance SP.ManagedPtrNewtype UnicodeData where
    toManagedPtr :: UnicodeData -> ManagedPtr UnicodeData
toManagedPtr (UnicodeData ManagedPtr UnicodeData
p) = ManagedPtr UnicodeData
p

foreign import ccall "ibus_unicode_data_get_type"
    c_ibus_unicode_data_get_type :: IO B.Types.GType

instance B.Types.TypedObject UnicodeData where
    glibType :: IO GType
glibType = IO GType
c_ibus_unicode_data_get_type

instance B.Types.GObject UnicodeData

-- | Convert 'UnicodeData' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue UnicodeData where
    toGValue :: UnicodeData -> IO GValue
toGValue UnicodeData
o = do
        GType
gtype <- IO GType
c_ibus_unicode_data_get_type
        UnicodeData -> (Ptr UnicodeData -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr UnicodeData
o (GType
-> (GValue -> Ptr UnicodeData -> IO ())
-> Ptr UnicodeData
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr UnicodeData -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
        
    fromGValue :: GValue -> IO UnicodeData
fromGValue GValue
gv = do
        Ptr UnicodeData
ptr <- GValue -> IO (Ptr UnicodeData)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr UnicodeData)
        (ManagedPtr UnicodeData -> UnicodeData)
-> Ptr UnicodeData -> IO UnicodeData
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr UnicodeData -> UnicodeData
UnicodeData Ptr UnicodeData
ptr
        
    

-- | Type class for types which can be safely cast to `UnicodeData`, for instance with `toUnicodeData`.
class (SP.GObject o, O.IsDescendantOf UnicodeData o) => IsUnicodeData o
instance (SP.GObject o, O.IsDescendantOf UnicodeData o) => IsUnicodeData o

instance O.HasParentTypes UnicodeData
type instance O.ParentTypes UnicodeData = '[IBus.Serializable.Serializable, IBus.Object.Object, GObject.Object.Object]

-- | Cast to `UnicodeData`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toUnicodeData :: (MonadIO m, IsUnicodeData o) => o -> m UnicodeData
toUnicodeData :: o -> m UnicodeData
toUnicodeData = IO UnicodeData -> m UnicodeData
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO UnicodeData -> m UnicodeData)
-> (o -> IO UnicodeData) -> o -> m UnicodeData
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr UnicodeData -> UnicodeData) -> o -> IO UnicodeData
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr UnicodeData -> UnicodeData
UnicodeData

#if defined(ENABLE_OVERLOADING)
type family ResolveUnicodeDataMethod (t :: Symbol) (o :: *) :: * where
    ResolveUnicodeDataMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveUnicodeDataMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveUnicodeDataMethod "copy" o = IBus.Serializable.SerializableCopyMethodInfo
    ResolveUnicodeDataMethod "destroy" o = IBus.Object.ObjectDestroyMethodInfo
    ResolveUnicodeDataMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveUnicodeDataMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveUnicodeDataMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveUnicodeDataMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveUnicodeDataMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveUnicodeDataMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveUnicodeDataMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveUnicodeDataMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveUnicodeDataMethod "removeQattachment" o = IBus.Serializable.SerializableRemoveQattachmentMethodInfo
    ResolveUnicodeDataMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveUnicodeDataMethod "serializeObject" o = IBus.Serializable.SerializableSerializeObjectMethodInfo
    ResolveUnicodeDataMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveUnicodeDataMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveUnicodeDataMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveUnicodeDataMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveUnicodeDataMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveUnicodeDataMethod "getAlias" o = UnicodeDataGetAliasMethodInfo
    ResolveUnicodeDataMethod "getBlockName" o = UnicodeDataGetBlockNameMethodInfo
    ResolveUnicodeDataMethod "getCode" o = UnicodeDataGetCodeMethodInfo
    ResolveUnicodeDataMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveUnicodeDataMethod "getName" o = UnicodeDataGetNameMethodInfo
    ResolveUnicodeDataMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveUnicodeDataMethod "getQattachment" o = IBus.Serializable.SerializableGetQattachmentMethodInfo
    ResolveUnicodeDataMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveUnicodeDataMethod "setBlockName" o = UnicodeDataSetBlockNameMethodInfo
    ResolveUnicodeDataMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveUnicodeDataMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveUnicodeDataMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveUnicodeDataMethod "setQattachment" o = IBus.Serializable.SerializableSetQattachmentMethodInfo
    ResolveUnicodeDataMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveUnicodeDataMethod t UnicodeData, O.MethodInfo info UnicodeData p) => OL.IsLabel t (UnicodeData -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#endif

-- VVV Prop "alias"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct]
   -- Nullable: (Just False,Nothing)

-- | Get the value of the “@alias@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' unicodeData #alias
-- @
getUnicodeDataAlias :: (MonadIO m, IsUnicodeData o) => o -> m T.Text
getUnicodeDataAlias :: o -> m Text
getUnicodeDataAlias o
obj = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getUnicodeDataAlias" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"alias"

-- | Set the value of the “@alias@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' unicodeData [ #alias 'Data.GI.Base.Attributes.:=' value ]
-- @
setUnicodeDataAlias :: (MonadIO m, IsUnicodeData o) => o -> T.Text -> m ()
setUnicodeDataAlias :: o -> Text -> m ()
setUnicodeDataAlias o
obj Text
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"alias" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

-- | Construct a `GValueConstruct` with valid value for the “@alias@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructUnicodeDataAlias :: (IsUnicodeData o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructUnicodeDataAlias :: Text -> m (GValueConstruct o)
constructUnicodeDataAlias Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"alias" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)

-- | Set the value of the “@alias@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #alias
-- @
clearUnicodeDataAlias :: (MonadIO m, IsUnicodeData o) => o -> m ()
clearUnicodeDataAlias :: o -> m ()
clearUnicodeDataAlias o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"alias" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)

#if defined(ENABLE_OVERLOADING)
data UnicodeDataAliasPropertyInfo
instance AttrInfo UnicodeDataAliasPropertyInfo where
    type AttrAllowedOps UnicodeDataAliasPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint UnicodeDataAliasPropertyInfo = IsUnicodeData
    type AttrSetTypeConstraint UnicodeDataAliasPropertyInfo = (~) T.Text
    type AttrTransferTypeConstraint UnicodeDataAliasPropertyInfo = (~) T.Text
    type AttrTransferType UnicodeDataAliasPropertyInfo = T.Text
    type AttrGetType UnicodeDataAliasPropertyInfo = T.Text
    type AttrLabel UnicodeDataAliasPropertyInfo = "alias"
    type AttrOrigin UnicodeDataAliasPropertyInfo = UnicodeData
    attrGet = getUnicodeDataAlias
    attrSet = setUnicodeDataAlias
    attrTransfer _ v = do
        return v
    attrConstruct = constructUnicodeDataAlias
    attrClear = clearUnicodeDataAlias
#endif

-- VVV Prop "block-name"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct]
   -- Nullable: (Just False,Just False)

-- | Get the value of the “@block-name@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' unicodeData #blockName
-- @
getUnicodeDataBlockName :: (MonadIO m, IsUnicodeData o) => o -> m T.Text
getUnicodeDataBlockName :: o -> m Text
getUnicodeDataBlockName o
obj = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getUnicodeDataBlockName" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"block-name"

-- | Set the value of the “@block-name@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' unicodeData [ #blockName 'Data.GI.Base.Attributes.:=' value ]
-- @
setUnicodeDataBlockName :: (MonadIO m, IsUnicodeData o) => o -> T.Text -> m ()
setUnicodeDataBlockName :: o -> Text -> m ()
setUnicodeDataBlockName o
obj Text
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"block-name" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

-- | Construct a `GValueConstruct` with valid value for the “@block-name@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructUnicodeDataBlockName :: (IsUnicodeData o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructUnicodeDataBlockName :: Text -> m (GValueConstruct o)
constructUnicodeDataBlockName Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"block-name" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)

#if defined(ENABLE_OVERLOADING)
data UnicodeDataBlockNamePropertyInfo
instance AttrInfo UnicodeDataBlockNamePropertyInfo where
    type AttrAllowedOps UnicodeDataBlockNamePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint UnicodeDataBlockNamePropertyInfo = IsUnicodeData
    type AttrSetTypeConstraint UnicodeDataBlockNamePropertyInfo = (~) T.Text
    type AttrTransferTypeConstraint UnicodeDataBlockNamePropertyInfo = (~) T.Text
    type AttrTransferType UnicodeDataBlockNamePropertyInfo = T.Text
    type AttrGetType UnicodeDataBlockNamePropertyInfo = T.Text
    type AttrLabel UnicodeDataBlockNamePropertyInfo = "block-name"
    type AttrOrigin UnicodeDataBlockNamePropertyInfo = UnicodeData
    attrGet = getUnicodeDataBlockName
    attrSet = setUnicodeDataBlockName
    attrTransfer _ v = do
        return v
    attrConstruct = constructUnicodeDataBlockName
    attrClear = undefined
#endif

-- VVV Prop "code"
   -- Type: TBasicType TUInt
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@code@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' unicodeData #code
-- @
getUnicodeDataCode :: (MonadIO m, IsUnicodeData o) => o -> m Word32
getUnicodeDataCode :: o -> m Word32
getUnicodeDataCode o
obj = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
B.Properties.getObjectPropertyUInt32 o
obj String
"code"

-- | Construct a `GValueConstruct` with valid value for the “@code@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructUnicodeDataCode :: (IsUnicodeData o, MIO.MonadIO m) => Word32 -> m (GValueConstruct o)
constructUnicodeDataCode :: Word32 -> m (GValueConstruct o)
constructUnicodeDataCode Word32
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Word32 -> IO (GValueConstruct o)
forall o. String -> Word32 -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyUInt32 String
"code" Word32
val

#if defined(ENABLE_OVERLOADING)
data UnicodeDataCodePropertyInfo
instance AttrInfo UnicodeDataCodePropertyInfo where
    type AttrAllowedOps UnicodeDataCodePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint UnicodeDataCodePropertyInfo = IsUnicodeData
    type AttrSetTypeConstraint UnicodeDataCodePropertyInfo = (~) Word32
    type AttrTransferTypeConstraint UnicodeDataCodePropertyInfo = (~) Word32
    type AttrTransferType UnicodeDataCodePropertyInfo = Word32
    type AttrGetType UnicodeDataCodePropertyInfo = Word32
    type AttrLabel UnicodeDataCodePropertyInfo = "code"
    type AttrOrigin UnicodeDataCodePropertyInfo = UnicodeData
    attrGet = getUnicodeDataCode
    attrSet = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructUnicodeDataCode
    attrClear = undefined
#endif

-- VVV Prop "name"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct]
   -- Nullable: (Just False,Nothing)

-- | Get the value of the “@name@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' unicodeData #name
-- @
getUnicodeDataName :: (MonadIO m, IsUnicodeData o) => o -> m T.Text
getUnicodeDataName :: o -> m Text
getUnicodeDataName o
obj = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getUnicodeDataName" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"name"

-- | Set the value of the “@name@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' unicodeData [ #name 'Data.GI.Base.Attributes.:=' value ]
-- @
setUnicodeDataName :: (MonadIO m, IsUnicodeData o) => o -> T.Text -> m ()
setUnicodeDataName :: o -> Text -> m ()
setUnicodeDataName o
obj Text
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"name" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

-- | Construct a `GValueConstruct` with valid value for the “@name@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructUnicodeDataName :: (IsUnicodeData o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructUnicodeDataName :: Text -> m (GValueConstruct o)
constructUnicodeDataName Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"name" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)

-- | Set the value of the “@name@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #name
-- @
clearUnicodeDataName :: (MonadIO m, IsUnicodeData o) => o -> m ()
clearUnicodeDataName :: o -> m ()
clearUnicodeDataName o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"name" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)

#if defined(ENABLE_OVERLOADING)
data UnicodeDataNamePropertyInfo
instance AttrInfo UnicodeDataNamePropertyInfo where
    type AttrAllowedOps UnicodeDataNamePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint UnicodeDataNamePropertyInfo = IsUnicodeData
    type AttrSetTypeConstraint UnicodeDataNamePropertyInfo = (~) T.Text
    type AttrTransferTypeConstraint UnicodeDataNamePropertyInfo = (~) T.Text
    type AttrTransferType UnicodeDataNamePropertyInfo = T.Text
    type AttrGetType UnicodeDataNamePropertyInfo = T.Text
    type AttrLabel UnicodeDataNamePropertyInfo = "name"
    type AttrOrigin UnicodeDataNamePropertyInfo = UnicodeData
    attrGet = getUnicodeDataName
    attrSet = setUnicodeDataName
    attrTransfer _ v = do
        return v
    attrConstruct = constructUnicodeDataName
    attrClear = clearUnicodeDataName
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList UnicodeData
type instance O.AttributeList UnicodeData = UnicodeDataAttributeList
type UnicodeDataAttributeList = ('[ '("alias", UnicodeDataAliasPropertyInfo), '("blockName", UnicodeDataBlockNamePropertyInfo), '("code", UnicodeDataCodePropertyInfo), '("name", UnicodeDataNamePropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
unicodeDataAlias :: AttrLabelProxy "alias"
unicodeDataAlias = AttrLabelProxy

unicodeDataBlockName :: AttrLabelProxy "blockName"
unicodeDataBlockName = AttrLabelProxy

unicodeDataCode :: AttrLabelProxy "code"
unicodeDataCode = AttrLabelProxy

unicodeDataName :: AttrLabelProxy "name"
unicodeDataName = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList UnicodeData = UnicodeDataSignalList
type UnicodeDataSignalList = ('[ '("destroy", IBus.Object.ObjectDestroySignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method UnicodeData::get_alias
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "unicode"
--           , argType =
--               TInterface Name { namespace = "IBus" , name = "UnicodeData" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #IBusUnicodeData"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "ibus_unicode_data_get_alias" ibus_unicode_data_get_alias :: 
    Ptr UnicodeData ->                      -- unicode : TInterface (Name {namespace = "IBus", name = "UnicodeData"})
    IO CString

-- | Gets the alias in t'GI.IBus.Objects.UnicodeData.UnicodeData'. It should not be freed.
unicodeDataGetAlias ::
    (B.CallStack.HasCallStack, MonadIO m, IsUnicodeData a) =>
    a
    -- ^ /@unicode@/: An t'GI.IBus.Objects.UnicodeData.UnicodeData'
    -> m T.Text
    -- ^ __Returns:__ alias property in t'GI.IBus.Objects.UnicodeData.UnicodeData'
unicodeDataGetAlias :: a -> m Text
unicodeDataGetAlias a
unicode = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeData
unicode' <- a -> IO (Ptr UnicodeData)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
unicode
    CString
result <- Ptr UnicodeData -> IO CString
ibus_unicode_data_get_alias Ptr UnicodeData
unicode'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"unicodeDataGetAlias" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
unicode
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data UnicodeDataGetAliasMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsUnicodeData a) => O.MethodInfo UnicodeDataGetAliasMethodInfo a signature where
    overloadedMethod = unicodeDataGetAlias

#endif

-- method UnicodeData::get_block_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "unicode"
--           , argType =
--               TInterface Name { namespace = "IBus" , name = "UnicodeData" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #IBusUnicodeData"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "ibus_unicode_data_get_block_name" ibus_unicode_data_get_block_name :: 
    Ptr UnicodeData ->                      -- unicode : TInterface (Name {namespace = "IBus", name = "UnicodeData"})
    IO CString

-- | Gets the block name in t'GI.IBus.Objects.UnicodeData.UnicodeData'. It should not be freed.
unicodeDataGetBlockName ::
    (B.CallStack.HasCallStack, MonadIO m, IsUnicodeData a) =>
    a
    -- ^ /@unicode@/: An t'GI.IBus.Objects.UnicodeData.UnicodeData'
    -> m T.Text
    -- ^ __Returns:__ block-name property in t'GI.IBus.Objects.UnicodeData.UnicodeData'
unicodeDataGetBlockName :: a -> m Text
unicodeDataGetBlockName a
unicode = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeData
unicode' <- a -> IO (Ptr UnicodeData)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
unicode
    CString
result <- Ptr UnicodeData -> IO CString
ibus_unicode_data_get_block_name Ptr UnicodeData
unicode'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"unicodeDataGetBlockName" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
unicode
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data UnicodeDataGetBlockNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsUnicodeData a) => O.MethodInfo UnicodeDataGetBlockNameMethodInfo a signature where
    overloadedMethod = unicodeDataGetBlockName

#endif

-- method UnicodeData::get_code
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "unicode"
--           , argType =
--               TInterface Name { namespace = "IBus" , name = "UnicodeData" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #IBusUnicodeData"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUniChar)
-- throws : False
-- Skip return : False

foreign import ccall "ibus_unicode_data_get_code" ibus_unicode_data_get_code :: 
    Ptr UnicodeData ->                      -- unicode : TInterface (Name {namespace = "IBus", name = "UnicodeData"})
    IO CInt

-- | Gets the code point in t'GI.IBus.Objects.UnicodeData.UnicodeData'.
unicodeDataGetCode ::
    (B.CallStack.HasCallStack, MonadIO m, IsUnicodeData a) =>
    a
    -- ^ /@unicode@/: An t'GI.IBus.Objects.UnicodeData.UnicodeData'
    -> m Char
    -- ^ __Returns:__ code property in t'GI.IBus.Objects.UnicodeData.UnicodeData'
unicodeDataGetCode :: a -> m Char
unicodeDataGetCode a
unicode = IO Char -> m Char
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Char -> m Char) -> IO Char -> m Char
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeData
unicode' <- a -> IO (Ptr UnicodeData)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
unicode
    CInt
result <- Ptr UnicodeData -> IO CInt
ibus_unicode_data_get_code Ptr UnicodeData
unicode'
    let result' :: Char
result' = (Int -> Char
chr (Int -> Char) -> (CInt -> Int) -> CInt -> Char
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
unicode
    Char -> IO Char
forall (m :: * -> *) a. Monad m => a -> m a
return Char
result'

#if defined(ENABLE_OVERLOADING)
data UnicodeDataGetCodeMethodInfo
instance (signature ~ (m Char), MonadIO m, IsUnicodeData a) => O.MethodInfo UnicodeDataGetCodeMethodInfo a signature where
    overloadedMethod = unicodeDataGetCode

#endif

-- method UnicodeData::get_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "unicode"
--           , argType =
--               TInterface Name { namespace = "IBus" , name = "UnicodeData" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #IBusUnicodeData"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "ibus_unicode_data_get_name" ibus_unicode_data_get_name :: 
    Ptr UnicodeData ->                      -- unicode : TInterface (Name {namespace = "IBus", name = "UnicodeData"})
    IO CString

-- | Gets the name in t'GI.IBus.Objects.UnicodeData.UnicodeData'. It should not be freed.
unicodeDataGetName ::
    (B.CallStack.HasCallStack, MonadIO m, IsUnicodeData a) =>
    a
    -- ^ /@unicode@/: An t'GI.IBus.Objects.UnicodeData.UnicodeData'
    -> m T.Text
    -- ^ __Returns:__ name property in t'GI.IBus.Objects.UnicodeData.UnicodeData'
unicodeDataGetName :: a -> m Text
unicodeDataGetName a
unicode = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeData
unicode' <- a -> IO (Ptr UnicodeData)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
unicode
    CString
result <- Ptr UnicodeData -> IO CString
ibus_unicode_data_get_name Ptr UnicodeData
unicode'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"unicodeDataGetName" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
unicode
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data UnicodeDataGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsUnicodeData a) => O.MethodInfo UnicodeDataGetNameMethodInfo a signature where
    overloadedMethod = unicodeDataGetName

#endif

-- method UnicodeData::set_block_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "unicode"
--           , argType =
--               TInterface Name { namespace = "IBus" , name = "UnicodeData" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "An #IBusUnicodeData"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "block_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A block name" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ibus_unicode_data_set_block_name" ibus_unicode_data_set_block_name :: 
    Ptr UnicodeData ->                      -- unicode : TInterface (Name {namespace = "IBus", name = "UnicodeData"})
    CString ->                              -- block_name : TBasicType TUTF8
    IO ()

-- | Sets the block name in t'GI.IBus.Objects.UnicodeData.UnicodeData'.
unicodeDataSetBlockName ::
    (B.CallStack.HasCallStack, MonadIO m, IsUnicodeData a) =>
    a
    -- ^ /@unicode@/: An t'GI.IBus.Objects.UnicodeData.UnicodeData'
    -> T.Text
    -- ^ /@blockName@/: A block name
    -> m ()
unicodeDataSetBlockName :: a -> Text -> m ()
unicodeDataSetBlockName a
unicode Text
blockName = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr UnicodeData
unicode' <- a -> IO (Ptr UnicodeData)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
unicode
    CString
blockName' <- Text -> IO CString
textToCString Text
blockName
    Ptr UnicodeData -> CString -> IO ()
ibus_unicode_data_set_block_name Ptr UnicodeData
unicode' CString
blockName'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
unicode
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
blockName'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data UnicodeDataSetBlockNameMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsUnicodeData a) => O.MethodInfo UnicodeDataSetBlockNameMethodInfo a signature where
    overloadedMethod = unicodeDataSetBlockName

#endif

-- method UnicodeData::load
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "path"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A path of the saved dictionary file."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "object"
--           , argType =
--               TInterface Name { namespace = "GObject" , name = "Object" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "If the #GObject has \"unicode-deserialize-progress\"\n   signal, this function will emit (the number of desrialized\n   #IBusUnicodeData, * the total number of #IBusUnicodeData) of uint values\n   with that signal by 100 times. Otherwise %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TGSList
--                  (TInterface Name { namespace = "IBus" , name = "UnicodeData" }))
-- throws : False
-- Skip return : False

foreign import ccall "ibus_unicode_data_load" ibus_unicode_data_load :: 
    CString ->                              -- path : TBasicType TUTF8
    Ptr GObject.Object.Object ->            -- object : TInterface (Name {namespace = "GObject", name = "Object"})
    IO (Ptr (GSList (Ptr UnicodeData)))

-- | /No description available in the introspection data./
unicodeDataLoad ::
    (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) =>
    T.Text
    -- ^ /@path@/: A path of the saved dictionary file.
    -> Maybe (a)
    -- ^ /@object@/: If the t'GI.GObject.Objects.Object.Object' has \"unicode-deserialize-progress\"
    --    signal, this function will emit (the number of desrialized
    --    t'GI.IBus.Objects.UnicodeData.UnicodeData', * the total number of t'GI.IBus.Objects.UnicodeData.UnicodeData') of uint values
    --    with that signal by 100 times. Otherwise 'P.Nothing'.
    -> m [UnicodeData]
    -- ^ __Returns:__ 
    -- An t'GI.IBus.Objects.UnicodeData.UnicodeData' list loaded from the saved cache file.
unicodeDataLoad :: Text -> Maybe a -> m [UnicodeData]
unicodeDataLoad Text
path Maybe a
object = IO [UnicodeData] -> m [UnicodeData]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [UnicodeData] -> m [UnicodeData])
-> IO [UnicodeData] -> m [UnicodeData]
forall a b. (a -> b) -> a -> b
$ do
    CString
path' <- Text -> IO CString
textToCString Text
path
    Ptr Object
maybeObject <- case Maybe a
object of
        Maybe a
Nothing -> Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
forall a. Ptr a
nullPtr
        Just a
jObject -> do
            Ptr Object
jObject' <- a -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jObject
            Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
jObject'
    Ptr (GSList (Ptr UnicodeData))
result <- CString -> Ptr Object -> IO (Ptr (GSList (Ptr UnicodeData)))
ibus_unicode_data_load CString
path' Ptr Object
maybeObject
    [Ptr UnicodeData]
result' <- Ptr (GSList (Ptr UnicodeData)) -> IO [Ptr UnicodeData]
forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a]
unpackGSList Ptr (GSList (Ptr UnicodeData))
result
    [UnicodeData]
result'' <- (Ptr UnicodeData -> IO UnicodeData)
-> [Ptr UnicodeData] -> IO [UnicodeData]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr UnicodeData -> UnicodeData)
-> Ptr UnicodeData -> IO UnicodeData
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr UnicodeData -> UnicodeData
UnicodeData) [Ptr UnicodeData]
result'
    Ptr (GSList (Ptr UnicodeData)) -> IO ()
forall a. Ptr (GSList a) -> IO ()
g_slist_free Ptr (GSList (Ptr UnicodeData))
result
    Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
object a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
    [UnicodeData] -> IO [UnicodeData]
forall (m :: * -> *) a. Monad m => a -> m a
return [UnicodeData]
result''

#if defined(ENABLE_OVERLOADING)
#endif

-- XXX Could not generate method UnicodeData::load_async
{-  Bad introspection data: ScopeTypeNotified without destructor! Callable
      { returnType = Nothing
      , returnMayBeNull = False
      , returnTransfer = TransferNothing
      , returnDocumentation =
          Documentation { rawDocText = Nothing , sinceVersion = Nothing }
      , args =
          [ Arg
              { argCName = "path"
              , argType = TBasicType TUTF8
              , direction = DirectionIn
              , mayBeNull = False
              , argDoc =
                  Documentation
                    { rawDocText = Just "A path of the saved dictionary file."
                    , sinceVersion = Nothing
                    }
              , argScope = ScopeTypeInvalid
              , argClosure = -1
              , argDestroy = -1
              , argCallerAllocates = False
              , transfer = TransferNothing
              }
          , Arg
              { argCName = "object"
              , argType =
                  TInterface Name { namespace = "GObject" , name = "Object" }
              , direction = DirectionIn
              , mayBeNull = True
              , argDoc =
                  Documentation
                    { rawDocText =
                        Just
                          "If the #GObject has \"unicode-deserialize-progress\"\n   signal, this function will emit (the number of desrialized\n   #IBusUnicodeData, * the total number of #IBusUnicodeData) of uint values\n   with that signal by 100 times. Otherwise %NULL."
                    , sinceVersion = Nothing
                    }
              , argScope = ScopeTypeInvalid
              , argClosure = -1
              , argDestroy = -1
              , argCallerAllocates = False
              , transfer = TransferNothing
              }
          , Arg
              { argCName = "cancellable"
              , argType =
                  TInterface Name { namespace = "Gio" , name = "Cancellable" }
              , direction = DirectionIn
              , mayBeNull = True
              , argDoc =
                  Documentation
                    { rawDocText = Just "cancellable." , sinceVersion = Nothing }
              , argScope = ScopeTypeInvalid
              , argClosure = -1
              , argDestroy = -1
              , argCallerAllocates = False
              , transfer = TransferNothing
              }
          , Arg
              { argCName = "callback"
              , argType =
                  TInterface
                    Name { namespace = "IBus" , name = "UnicodeDataLoadAsyncFinish" }
              , direction = DirectionIn
              , mayBeNull = False
              , argDoc =
                  Documentation
                    { rawDocText = Just "IBusUnicodeDataLoadAsyncFinish."
                    , sinceVersion = Nothing
                    }
              , argScope = ScopeTypeNotified
              , argClosure = 4
              , argDestroy = -1
              , argCallerAllocates = False
              , transfer = TransferNothing
              }
          , Arg
              { argCName = "user_data"
              , argType = TBasicType TPtr
              , direction = DirectionIn
              , mayBeNull = True
              , argDoc =
                  Documentation
                    { rawDocText = Just "User data." , sinceVersion = Nothing }
              , argScope = ScopeTypeInvalid
              , argClosure = -1
              , argDestroy = -1
              , argCallerAllocates = False
              , transfer = TransferNothing
              }
          ]
      , skipReturn = False
      , callableThrows = False
      , callableDeprecated = Nothing
      , callableDocumentation =
          Documentation
            { rawDocText =
                Just
                  "IBusUnicodeDataLoadAsyncFinish can receive the list of #IBusUnicodeData."
            , sinceVersion = Nothing
            }
      , callableResolvable = Just True
      }
-}
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data UnicodeDataLoadAsyncMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "loadAsync" UnicodeData) => O.MethodInfo UnicodeDataLoadAsyncMethodInfo o p where
    overloadedMethod = undefined
#endif

-- method UnicodeData::save
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "path"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A path of the saved Unicode data."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "list"
--           , argType =
--               TGSList
--                 (TInterface Name { namespace = "IBus" , name = "UnicodeData" })
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A list of unicode\n data."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "ibus_unicode_data_save" ibus_unicode_data_save :: 
    CString ->                              -- path : TBasicType TUTF8
    Ptr (GSList (Ptr UnicodeData)) ->       -- list : TGSList (TInterface (Name {namespace = "IBus", name = "UnicodeData"}))
    IO ()

-- | Save the list of t'GI.IBus.Objects.UnicodeData.UnicodeData' to the cache file.
unicodeDataSave ::
    (B.CallStack.HasCallStack, MonadIO m, IsUnicodeData a) =>
    T.Text
    -- ^ /@path@/: A path of the saved Unicode data.
    -> [a]
    -- ^ /@list@/: A list of unicode
    --  data.
    -> m ()
unicodeDataSave :: Text -> [a] -> m ()
unicodeDataSave Text
path [a]
list = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    CString
path' <- Text -> IO CString
textToCString Text
path
    [Ptr UnicodeData]
list' <- (a -> IO (Ptr UnicodeData)) -> [a] -> IO [Ptr UnicodeData]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM a -> IO (Ptr UnicodeData)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr [a]
list
    Ptr (GSList (Ptr UnicodeData))
list'' <- [Ptr UnicodeData] -> IO (Ptr (GSList (Ptr UnicodeData)))
forall a. [Ptr a] -> IO (Ptr (GSList (Ptr a)))
packGSList [Ptr UnicodeData]
list'
    CString -> Ptr (GSList (Ptr UnicodeData)) -> IO ()
ibus_unicode_data_save CString
path' Ptr (GSList (Ptr UnicodeData))
list''
    (a -> IO ()) -> [a] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [a]
list
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
    Ptr (GSList (Ptr UnicodeData)) -> IO ()
forall a. Ptr (GSList a) -> IO ()
g_slist_free Ptr (GSList (Ptr UnicodeData))
list''
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
#endif