{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)

/No description available in the introspection data./
-}

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

module GI.Handy.Objects.EnumValueObject
    (

-- * Exported types
    EnumValueObject(..)                     ,
    IsEnumValueObject                       ,
    toEnumValueObject                       ,
    noEnumValueObject                       ,


 -- * Methods
-- ** getName #method:getName#

#if ENABLE_OVERLOADING
    EnumValueObjectGetNameMethodInfo        ,
#endif
    enumValueObjectGetName                  ,


-- ** getNick #method:getNick#

#if ENABLE_OVERLOADING
    EnumValueObjectGetNickMethodInfo        ,
#endif
    enumValueObjectGetNick                  ,


-- ** getValue #method:getValue#

#if ENABLE_OVERLOADING
    EnumValueObjectGetValueMethodInfo       ,
#endif
    enumValueObjectGetValue                 ,


-- ** new #method:new#

    enumValueObjectNew                      ,




    ) 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.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.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 qualified GI.GObject.Structs.EnumValue as GObject.EnumValue

-- | Memory-managed wrapper type.
newtype EnumValueObject = EnumValueObject (ManagedPtr EnumValueObject)
foreign import ccall "hdy_enum_value_object_get_type"
    c_hdy_enum_value_object_get_type :: IO GType

instance GObject EnumValueObject where
    gobjectType = c_hdy_enum_value_object_get_type


-- | Type class for types which can be safely cast to `EnumValueObject`, for instance with `toEnumValueObject`.
class (GObject o, O.IsDescendantOf EnumValueObject o) => IsEnumValueObject o
instance (GObject o, O.IsDescendantOf EnumValueObject o) => IsEnumValueObject o

instance O.HasParentTypes EnumValueObject
type instance O.ParentTypes EnumValueObject = '[GObject.Object.Object]

-- | Cast to `EnumValueObject`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toEnumValueObject :: (MonadIO m, IsEnumValueObject o) => o -> m EnumValueObject
toEnumValueObject = liftIO . unsafeCastTo EnumValueObject

-- | A convenience alias for `Nothing` :: `Maybe` `EnumValueObject`.
noEnumValueObject :: Maybe EnumValueObject
noEnumValueObject = Nothing

#if ENABLE_OVERLOADING
type family ResolveEnumValueObjectMethod (t :: Symbol) (o :: *) :: * where
    ResolveEnumValueObjectMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveEnumValueObjectMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveEnumValueObjectMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveEnumValueObjectMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveEnumValueObjectMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveEnumValueObjectMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveEnumValueObjectMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveEnumValueObjectMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveEnumValueObjectMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveEnumValueObjectMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveEnumValueObjectMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveEnumValueObjectMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveEnumValueObjectMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveEnumValueObjectMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveEnumValueObjectMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveEnumValueObjectMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveEnumValueObjectMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveEnumValueObjectMethod "getName" o = EnumValueObjectGetNameMethodInfo
    ResolveEnumValueObjectMethod "getNick" o = EnumValueObjectGetNickMethodInfo
    ResolveEnumValueObjectMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveEnumValueObjectMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveEnumValueObjectMethod "getValue" o = EnumValueObjectGetValueMethodInfo
    ResolveEnumValueObjectMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveEnumValueObjectMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveEnumValueObjectMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#if ENABLE_OVERLOADING
#endif

#if ENABLE_OVERLOADING
type instance O.SignalList EnumValueObject = EnumValueObjectSignalList
type EnumValueObjectSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method EnumValueObject::new
-- method type : Constructor
-- Args : [Arg {argCName = "enum_value", argType = TInterface (Name {namespace = "GObject", name = "EnumValue"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Handy", name = "EnumValueObject"}))
-- throws : False
-- Skip return : False

foreign import ccall "hdy_enum_value_object_new" hdy_enum_value_object_new ::
    Ptr GObject.EnumValue.EnumValue ->      -- enum_value : TInterface (Name {namespace = "GObject", name = "EnumValue"})
    IO (Ptr EnumValueObject)

{- |
/No description available in the introspection data./
-}
enumValueObjectNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    GObject.EnumValue.EnumValue
    -> m EnumValueObject
enumValueObjectNew enumValue = liftIO $ do
    enumValue' <- unsafeManagedPtrGetPtr enumValue
    result <- hdy_enum_value_object_new enumValue'
    checkUnexpectedReturnNULL "enumValueObjectNew" result
    result' <- (wrapObject EnumValueObject) result
    touchManagedPtr enumValue
    return result'

#if ENABLE_OVERLOADING
#endif

-- method EnumValueObject::get_name
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Handy", name = "EnumValueObject"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, 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 "hdy_enum_value_object_get_name" hdy_enum_value_object_get_name ::
    Ptr EnumValueObject ->                  -- self : TInterface (Name {namespace = "Handy", name = "EnumValueObject"})
    IO CString

{- |
/No description available in the introspection data./
-}
enumValueObjectGetName ::
    (B.CallStack.HasCallStack, MonadIO m, IsEnumValueObject a) =>
    a
    -> m T.Text
enumValueObjectGetName self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- hdy_enum_value_object_get_name self'
    checkUnexpectedReturnNULL "enumValueObjectGetName" result
    result' <- cstringToText result
    touchManagedPtr self
    return result'

#if ENABLE_OVERLOADING
data EnumValueObjectGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsEnumValueObject a) => O.MethodInfo EnumValueObjectGetNameMethodInfo a signature where
    overloadedMethod _ = enumValueObjectGetName

#endif

-- method EnumValueObject::get_nick
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Handy", name = "EnumValueObject"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, 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 "hdy_enum_value_object_get_nick" hdy_enum_value_object_get_nick ::
    Ptr EnumValueObject ->                  -- self : TInterface (Name {namespace = "Handy", name = "EnumValueObject"})
    IO CString

{- |
/No description available in the introspection data./
-}
enumValueObjectGetNick ::
    (B.CallStack.HasCallStack, MonadIO m, IsEnumValueObject a) =>
    a
    -> m T.Text
enumValueObjectGetNick self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- hdy_enum_value_object_get_nick self'
    checkUnexpectedReturnNULL "enumValueObjectGetNick" result
    result' <- cstringToText result
    touchManagedPtr self
    return result'

#if ENABLE_OVERLOADING
data EnumValueObjectGetNickMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsEnumValueObject a) => O.MethodInfo EnumValueObjectGetNickMethodInfo a signature where
    overloadedMethod _ = enumValueObjectGetNick

#endif

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

foreign import ccall "hdy_enum_value_object_get_value" hdy_enum_value_object_get_value ::
    Ptr EnumValueObject ->                  -- self : TInterface (Name {namespace = "Handy", name = "EnumValueObject"})
    IO Int32

{- |
/No description available in the introspection data./
-}
enumValueObjectGetValue ::
    (B.CallStack.HasCallStack, MonadIO m, IsEnumValueObject a) =>
    a
    -> m Int32
enumValueObjectGetValue self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- hdy_enum_value_object_get_value self'
    touchManagedPtr self
    return result

#if ENABLE_OVERLOADING
data EnumValueObjectGetValueMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsEnumValueObject a) => O.MethodInfo EnumValueObjectGetValueMethodInfo a signature where
    overloadedMethod _ = enumValueObjectGetValue

#endif