{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- An IBusAttribute represents an attribute that associate to IBusText.
-- It decorates preedit buffer and auxiliary text with underline, foreground
-- and background colors.

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

module GI.IBus.Objects.Attribute
    ( 

-- * Exported types
    Attribute(..)                           ,
    IsAttribute                             ,
    toAttribute                             ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [copy]("GI.IBus.Objects.Serializable#g:method:copy"), [destroy]("GI.IBus.Objects.Object#g:method:destroy"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [removeQattachment]("GI.IBus.Objects.Serializable#g:method:removeQattachment"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [serializeObject]("GI.IBus.Objects.Serializable#g:method:serializeObject"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getAttrType]("GI.IBus.Objects.Attribute#g:method:getAttrType"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getEndIndex]("GI.IBus.Objects.Attribute#g:method:getEndIndex"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQattachment]("GI.IBus.Objects.Serializable#g:method:getQattachment"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getStartIndex]("GI.IBus.Objects.Attribute#g:method:getStartIndex"), [getValue]("GI.IBus.Objects.Attribute#g:method:getValue").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setQattachment]("GI.IBus.Objects.Serializable#g:method:setQattachment").

#if defined(ENABLE_OVERLOADING)
    ResolveAttributeMethod                  ,
#endif

-- ** getAttrType #method:getAttrType#

#if defined(ENABLE_OVERLOADING)
    AttributeGetAttrTypeMethodInfo          ,
#endif
    attributeGetAttrType                    ,


-- ** getEndIndex #method:getEndIndex#

#if defined(ENABLE_OVERLOADING)
    AttributeGetEndIndexMethodInfo          ,
#endif
    attributeGetEndIndex                    ,


-- ** getStartIndex #method:getStartIndex#

#if defined(ENABLE_OVERLOADING)
    AttributeGetStartIndexMethodInfo        ,
#endif
    attributeGetStartIndex                  ,


-- ** getValue #method:getValue#

#if defined(ENABLE_OVERLOADING)
    AttributeGetValueMethodInfo             ,
#endif
    attributeGetValue                       ,


-- ** new #method:new#

    attributeNew                            ,




    ) 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.GArray as B.GArray
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 GHC.Records as R

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 Attribute = Attribute (SP.ManagedPtr Attribute)
    deriving (Attribute -> Attribute -> Bool
(Attribute -> Attribute -> Bool)
-> (Attribute -> Attribute -> Bool) -> Eq Attribute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Attribute -> Attribute -> Bool
$c/= :: Attribute -> Attribute -> Bool
== :: Attribute -> Attribute -> Bool
$c== :: Attribute -> Attribute -> Bool
Eq)

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

foreign import ccall "ibus_attribute_get_type"
    c_ibus_attribute_get_type :: IO B.Types.GType

instance B.Types.TypedObject Attribute where
    glibType :: IO GType
glibType = IO GType
c_ibus_attribute_get_type

instance B.Types.GObject Attribute

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

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

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

-- | Convert 'Attribute' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe Attribute) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ibus_attribute_get_type
    gvalueSet_ :: Ptr GValue -> Maybe Attribute -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Attribute
P.Nothing = Ptr GValue -> Ptr Attribute -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Attribute
forall a. Ptr a
FP.nullPtr :: FP.Ptr Attribute)
    gvalueSet_ Ptr GValue
gv (P.Just Attribute
obj) = Attribute -> (Ptr Attribute -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Attribute
obj (Ptr GValue -> Ptr Attribute -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe Attribute)
gvalueGet_ Ptr GValue
gv = do
        Ptr Attribute
ptr <- Ptr GValue -> IO (Ptr Attribute)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Attribute)
        if Ptr Attribute
ptr Ptr Attribute -> Ptr Attribute -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Attribute
forall a. Ptr a
FP.nullPtr
        then Attribute -> Maybe Attribute
forall a. a -> Maybe a
P.Just (Attribute -> Maybe Attribute)
-> IO Attribute -> IO (Maybe Attribute)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Attribute -> Attribute)
-> Ptr Attribute -> IO Attribute
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Attribute -> Attribute
Attribute Ptr Attribute
ptr
        else Maybe Attribute -> IO (Maybe Attribute)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Attribute
forall a. Maybe a
P.Nothing
        
    

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

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

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveAttributeMethod t Attribute, O.OverloadedMethod info Attribute p, R.HasField t Attribute p) => R.HasField t Attribute p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveAttributeMethod t Attribute, O.OverloadedMethodInfo info Attribute) => OL.IsLabel t (O.MethodProxy info Attribute) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Attribute
type instance O.AttributeList Attribute = AttributeAttributeList
type AttributeAttributeList = ('[ ] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

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

#endif

-- method Attribute::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "type"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Type of the attribute."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Value of the attribute."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "start_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Where attribute starts."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "end_index"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "Where attribute ends."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "IBus" , name = "Attribute" })
-- throws : False
-- Skip return : False

foreign import ccall "ibus_attribute_new" ibus_attribute_new :: 
    Word32 ->                               -- type : TBasicType TUInt
    Word32 ->                               -- value : TBasicType TUInt
    Word32 ->                               -- start_index : TBasicType TUInt
    Word32 ->                               -- end_index : TBasicType TUInt
    IO (Ptr Attribute)

-- | Creates a new IBusAttribute.
attributeNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Word32
    -- ^ /@type@/: Type of the attribute.
    -> Word32
    -- ^ /@value@/: Value of the attribute.
    -> Word32
    -- ^ /@startIndex@/: Where attribute starts.
    -> Word32
    -- ^ /@endIndex@/: Where attribute ends.
    -> m Attribute
    -- ^ __Returns:__ A newly allocated IBusAttribute.
attributeNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Word32 -> Word32 -> Word32 -> Word32 -> m Attribute
attributeNew Word32
type_ Word32
value Word32
startIndex Word32
endIndex = IO Attribute -> m Attribute
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Attribute -> m Attribute) -> IO Attribute -> m Attribute
forall a b. (a -> b) -> a -> b
$ do
    Ptr Attribute
result <- Word32 -> Word32 -> Word32 -> Word32 -> IO (Ptr Attribute)
ibus_attribute_new Word32
type_ Word32
value Word32
startIndex Word32
endIndex
    Text -> Ptr Attribute -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"attributeNew" Ptr Attribute
result
    Attribute
result' <- ((ManagedPtr Attribute -> Attribute)
-> Ptr Attribute -> IO Attribute
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Attribute -> Attribute
Attribute) Ptr Attribute
result
    Attribute -> IO Attribute
forall (m :: * -> *) a. Monad m => a -> m a
return Attribute
result'

#if defined(ENABLE_OVERLOADING)
#endif

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

foreign import ccall "ibus_attribute_get_attr_type" ibus_attribute_get_attr_type :: 
    Ptr Attribute ->                        -- attr : TInterface (Name {namespace = "IBus", name = "Attribute"})
    IO Word32

-- | Gets an enum of t'GI.IBus.Enums.AttrType'.
attributeGetAttrType ::
    (B.CallStack.HasCallStack, MonadIO m, IsAttribute a) =>
    a
    -- ^ /@attr@/: An t'GI.IBus.Objects.Attribute.Attribute'
    -> m Word32
    -- ^ __Returns:__ An enum of t'GI.IBus.Enums.AttrType'.
attributeGetAttrType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAttribute a) =>
a -> m Word32
attributeGetAttrType a
attr = 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
$ do
    Ptr Attribute
attr' <- a -> IO (Ptr Attribute)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
attr
    Word32
result <- Ptr Attribute -> IO Word32
ibus_attribute_get_attr_type Ptr Attribute
attr'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
attr
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
data AttributeGetAttrTypeMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsAttribute a) => O.OverloadedMethod AttributeGetAttrTypeMethodInfo a signature where
    overloadedMethod = attributeGetAttrType

instance O.OverloadedMethodInfo AttributeGetAttrTypeMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.IBus.Objects.Attribute.attributeGetAttrType",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ibus-1.5.3/docs/GI-IBus-Objects-Attribute.html#v:attributeGetAttrType"
        }


#endif

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

foreign import ccall "ibus_attribute_get_end_index" ibus_attribute_get_end_index :: 
    Ptr Attribute ->                        -- attr : TInterface (Name {namespace = "IBus", name = "Attribute"})
    IO Word32

-- | Gets an end unsigned index
attributeGetEndIndex ::
    (B.CallStack.HasCallStack, MonadIO m, IsAttribute a) =>
    a
    -- ^ /@attr@/: An t'GI.IBus.Objects.Attribute.Attribute'
    -> m Word32
    -- ^ __Returns:__ A end unsigned index
attributeGetEndIndex :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAttribute a) =>
a -> m Word32
attributeGetEndIndex a
attr = 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
$ do
    Ptr Attribute
attr' <- a -> IO (Ptr Attribute)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
attr
    Word32
result <- Ptr Attribute -> IO Word32
ibus_attribute_get_end_index Ptr Attribute
attr'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
attr
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
data AttributeGetEndIndexMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsAttribute a) => O.OverloadedMethod AttributeGetEndIndexMethodInfo a signature where
    overloadedMethod = attributeGetEndIndex

instance O.OverloadedMethodInfo AttributeGetEndIndexMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.IBus.Objects.Attribute.attributeGetEndIndex",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ibus-1.5.3/docs/GI-IBus-Objects-Attribute.html#v:attributeGetEndIndex"
        }


#endif

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

foreign import ccall "ibus_attribute_get_start_index" ibus_attribute_get_start_index :: 
    Ptr Attribute ->                        -- attr : TInterface (Name {namespace = "IBus", name = "Attribute"})
    IO Word32

-- | Gets a start unsigned index
attributeGetStartIndex ::
    (B.CallStack.HasCallStack, MonadIO m, IsAttribute a) =>
    a
    -- ^ /@attr@/: An t'GI.IBus.Objects.Attribute.Attribute'
    -> m Word32
    -- ^ __Returns:__ A start unsigned index
attributeGetStartIndex :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAttribute a) =>
a -> m Word32
attributeGetStartIndex a
attr = 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
$ do
    Ptr Attribute
attr' <- a -> IO (Ptr Attribute)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
attr
    Word32
result <- Ptr Attribute -> IO Word32
ibus_attribute_get_start_index Ptr Attribute
attr'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
attr
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
data AttributeGetStartIndexMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsAttribute a) => O.OverloadedMethod AttributeGetStartIndexMethodInfo a signature where
    overloadedMethod = attributeGetStartIndex

instance O.OverloadedMethodInfo AttributeGetStartIndexMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.IBus.Objects.Attribute.attributeGetStartIndex",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ibus-1.5.3/docs/GI-IBus-Objects-Attribute.html#v:attributeGetStartIndex"
        }


#endif

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

foreign import ccall "ibus_attribute_get_value" ibus_attribute_get_value :: 
    Ptr Attribute ->                        -- attr : TInterface (Name {namespace = "IBus", name = "Attribute"})
    IO Word32

-- | Gets an unsigned int value relative with t'GI.IBus.Enums.AttrType'.
-- If the type is 'GI.IBus.Enums.AttrTypeUnderline', the return value is
-- t'GI.IBus.Enums.AttrUnderline'. If the type is 'GI.IBus.Enums.AttrTypeForeground',
-- the return value is the color RGB.
attributeGetValue ::
    (B.CallStack.HasCallStack, MonadIO m, IsAttribute a) =>
    a
    -- ^ /@attr@/: An t'GI.IBus.Objects.Attribute.Attribute'
    -> m Word32
    -- ^ __Returns:__ An unsigned int value relative with t'GI.IBus.Enums.AttrType'.
attributeGetValue :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAttribute a) =>
a -> m Word32
attributeGetValue a
attr = 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
$ do
    Ptr Attribute
attr' <- a -> IO (Ptr Attribute)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
attr
    Word32
result <- Ptr Attribute -> IO Word32
ibus_attribute_get_value Ptr Attribute
attr'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
attr
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
data AttributeGetValueMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsAttribute a) => O.OverloadedMethod AttributeGetValueMethodInfo a signature where
    overloadedMethod = attributeGetValue

instance O.OverloadedMethodInfo AttributeGetValueMethodInfo a where
    overloadedMethodInfo = O.MethodInfo {
        O.overloadedMethodName = "GI.IBus.Objects.Attribute.attributeGetValue",
        O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-ibus-1.5.3/docs/GI-IBus-Objects-Attribute.html#v:attributeGetValue"
        }


#endif