{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- t'GI.Gio.Objects.MenuLinkIter.MenuLinkIter' is an opaque structure type.  You must access it using
-- the functions below.
-- 
-- /Since: 2.32/

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

module GI.Gio.Objects.MenuLinkIter
    ( 

-- * Exported types
    MenuLinkIter(..)                        ,
    IsMenuLinkIter                          ,
    toMenuLinkIter                          ,
    noMenuLinkIter                          ,


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

#if defined(ENABLE_OVERLOADING)
    ResolveMenuLinkIterMethod               ,
#endif


-- ** getName #method:getName#

#if defined(ENABLE_OVERLOADING)
    MenuLinkIterGetNameMethodInfo           ,
#endif
    menuLinkIterGetName                     ,


-- ** getNext #method:getNext#

#if defined(ENABLE_OVERLOADING)
    MenuLinkIterGetNextMethodInfo           ,
#endif
    menuLinkIterGetNext                     ,


-- ** getValue #method:getValue#

#if defined(ENABLE_OVERLOADING)
    MenuLinkIterGetValueMethodInfo          ,
#endif
    menuLinkIterGetValue                    ,


-- ** next #method:next#

#if defined(ENABLE_OVERLOADING)
    MenuLinkIterNextMethodInfo              ,
#endif
    menuLinkIterNext                        ,




    ) 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.GI.Base.Signals as B.Signals
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.Gio.Objects.MenuModel as Gio.MenuModel

-- | Memory-managed wrapper type.
newtype MenuLinkIter = MenuLinkIter (ManagedPtr MenuLinkIter)
    deriving (MenuLinkIter -> MenuLinkIter -> Bool
(MenuLinkIter -> MenuLinkIter -> Bool)
-> (MenuLinkIter -> MenuLinkIter -> Bool) -> Eq MenuLinkIter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MenuLinkIter -> MenuLinkIter -> Bool
$c/= :: MenuLinkIter -> MenuLinkIter -> Bool
== :: MenuLinkIter -> MenuLinkIter -> Bool
$c== :: MenuLinkIter -> MenuLinkIter -> Bool
Eq)
foreign import ccall "g_menu_link_iter_get_type"
    c_g_menu_link_iter_get_type :: IO GType

instance GObject MenuLinkIter where
    gobjectType :: IO GType
gobjectType = IO GType
c_g_menu_link_iter_get_type
    

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

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

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

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

-- | A convenience alias for `Nothing` :: `Maybe` `MenuLinkIter`.
noMenuLinkIter :: Maybe MenuLinkIter
noMenuLinkIter :: Maybe MenuLinkIter
noMenuLinkIter = Maybe MenuLinkIter
forall a. Maybe a
Nothing

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

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

#endif

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

#if defined(ENABLE_OVERLOADING)
#endif

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

#endif

-- method MenuLinkIter::get_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "MenuLinkIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GMenuLinkIter" , 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 "g_menu_link_iter_get_name" g_menu_link_iter_get_name :: 
    Ptr MenuLinkIter ->                     -- iter : TInterface (Name {namespace = "Gio", name = "MenuLinkIter"})
    IO CString

-- | Gets the name of the link at the current iterator position.
-- 
-- The iterator is not advanced.
-- 
-- /Since: 2.32/
menuLinkIterGetName ::
    (B.CallStack.HasCallStack, MonadIO m, IsMenuLinkIter a) =>
    a
    -- ^ /@iter@/: a t'GI.Gio.Objects.MenuLinkIter.MenuLinkIter'
    -> m T.Text
    -- ^ __Returns:__ the type of the link
menuLinkIterGetName :: a -> m Text
menuLinkIterGetName iter :: a
iter = 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 MenuLinkIter
iter' <- a -> IO (Ptr MenuLinkIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
    CString
result <- Ptr MenuLinkIter -> IO CString
g_menu_link_iter_get_name Ptr MenuLinkIter
iter'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "menuLinkIterGetName" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
iter
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data MenuLinkIterGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsMenuLinkIter a) => O.MethodInfo MenuLinkIterGetNameMethodInfo a signature where
    overloadedMethod = menuLinkIterGetName

#endif

-- method MenuLinkIter::get_next
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "MenuLinkIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GMenuLinkIter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_link"
--           , argType = TBasicType TUTF8
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the link"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "MenuModel" }
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the linked #GMenuModel"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "g_menu_link_iter_get_next" g_menu_link_iter_get_next :: 
    Ptr MenuLinkIter ->                     -- iter : TInterface (Name {namespace = "Gio", name = "MenuLinkIter"})
    Ptr CString ->                          -- out_link : TBasicType TUTF8
    Ptr (Ptr Gio.MenuModel.MenuModel) ->    -- value : TInterface (Name {namespace = "Gio", name = "MenuModel"})
    IO CInt

-- | This function combines 'GI.Gio.Objects.MenuLinkIter.menuLinkIterNext' with
-- 'GI.Gio.Objects.MenuLinkIter.menuLinkIterGetName' and 'GI.Gio.Objects.MenuLinkIter.menuLinkIterGetValue'.
-- 
-- First the iterator is advanced to the next (possibly first) link.
-- If that fails, then 'P.False' is returned and there are no other effects.
-- 
-- If successful, /@outLink@/ and /@value@/ are set to the name and t'GI.Gio.Objects.MenuModel.MenuModel'
-- of the link that has just been advanced to.  At this point,
-- 'GI.Gio.Objects.MenuLinkIter.menuLinkIterGetName' and 'GI.Gio.Objects.MenuLinkIter.menuLinkIterGetValue' will return the
-- same values again.
-- 
-- The value returned in /@outLink@/ remains valid for as long as the iterator
-- remains at the current position.  The value returned in /@value@/ must
-- be unreffed using 'GI.GObject.Objects.Object.objectUnref' when it is no longer in use.
-- 
-- /Since: 2.32/
menuLinkIterGetNext ::
    (B.CallStack.HasCallStack, MonadIO m, IsMenuLinkIter a) =>
    a
    -- ^ /@iter@/: a t'GI.Gio.Objects.MenuLinkIter.MenuLinkIter'
    -> m ((Bool, T.Text, Gio.MenuModel.MenuModel))
    -- ^ __Returns:__ 'P.True' on success, or 'P.False' if there is no additional link
menuLinkIterGetNext :: a -> m (Bool, Text, MenuModel)
menuLinkIterGetNext iter :: a
iter = IO (Bool, Text, MenuModel) -> m (Bool, Text, MenuModel)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Text, MenuModel) -> m (Bool, Text, MenuModel))
-> IO (Bool, Text, MenuModel) -> m (Bool, Text, MenuModel)
forall a b. (a -> b) -> a -> b
$ do
    Ptr MenuLinkIter
iter' <- a -> IO (Ptr MenuLinkIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
    Ptr CString
outLink <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CString)
    Ptr (Ptr MenuModel)
value <- IO (Ptr (Ptr MenuModel))
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr (Ptr Gio.MenuModel.MenuModel))
    CInt
result <- Ptr MenuLinkIter -> Ptr CString -> Ptr (Ptr MenuModel) -> IO CInt
g_menu_link_iter_get_next Ptr MenuLinkIter
iter' Ptr CString
outLink Ptr (Ptr MenuModel)
value
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    CString
outLink' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outLink
    Text
outLink'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outLink'
    Ptr MenuModel
value' <- Ptr (Ptr MenuModel) -> IO (Ptr MenuModel)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr MenuModel)
value
    MenuModel
value'' <- ((ManagedPtr MenuModel -> MenuModel)
-> Ptr MenuModel -> IO MenuModel
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr MenuModel -> MenuModel
Gio.MenuModel.MenuModel) Ptr MenuModel
value'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
iter
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outLink
    Ptr (Ptr MenuModel) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr MenuModel)
value
    (Bool, Text, MenuModel) -> IO (Bool, Text, MenuModel)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Text
outLink'', MenuModel
value'')

#if defined(ENABLE_OVERLOADING)
data MenuLinkIterGetNextMethodInfo
instance (signature ~ (m ((Bool, T.Text, Gio.MenuModel.MenuModel))), MonadIO m, IsMenuLinkIter a) => O.MethodInfo MenuLinkIterGetNextMethodInfo a signature where
    overloadedMethod = menuLinkIterGetNext

#endif

-- method MenuLinkIter::get_value
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "MenuLinkIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GMenuLinkIter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gio" , name = "MenuModel" })
-- throws : False
-- Skip return : False

foreign import ccall "g_menu_link_iter_get_value" g_menu_link_iter_get_value :: 
    Ptr MenuLinkIter ->                     -- iter : TInterface (Name {namespace = "Gio", name = "MenuLinkIter"})
    IO (Ptr Gio.MenuModel.MenuModel)

-- | Gets the linked t'GI.Gio.Objects.MenuModel.MenuModel' at the current iterator position.
-- 
-- The iterator is not advanced.
-- 
-- /Since: 2.32/
menuLinkIterGetValue ::
    (B.CallStack.HasCallStack, MonadIO m, IsMenuLinkIter a) =>
    a
    -- ^ /@iter@/: a t'GI.Gio.Objects.MenuLinkIter.MenuLinkIter'
    -> m Gio.MenuModel.MenuModel
    -- ^ __Returns:__ the t'GI.Gio.Objects.MenuModel.MenuModel' that is linked to
menuLinkIterGetValue :: a -> m MenuModel
menuLinkIterGetValue iter :: a
iter = IO MenuModel -> m MenuModel
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO MenuModel -> m MenuModel) -> IO MenuModel -> m MenuModel
forall a b. (a -> b) -> a -> b
$ do
    Ptr MenuLinkIter
iter' <- a -> IO (Ptr MenuLinkIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
    Ptr MenuModel
result <- Ptr MenuLinkIter -> IO (Ptr MenuModel)
g_menu_link_iter_get_value Ptr MenuLinkIter
iter'
    Text -> Ptr MenuModel -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "menuLinkIterGetValue" Ptr MenuModel
result
    MenuModel
result' <- ((ManagedPtr MenuModel -> MenuModel)
-> Ptr MenuModel -> IO MenuModel
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr MenuModel -> MenuModel
Gio.MenuModel.MenuModel) Ptr MenuModel
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
iter
    MenuModel -> IO MenuModel
forall (m :: * -> *) a. Monad m => a -> m a
return MenuModel
result'

#if defined(ENABLE_OVERLOADING)
data MenuLinkIterGetValueMethodInfo
instance (signature ~ (m Gio.MenuModel.MenuModel), MonadIO m, IsMenuLinkIter a) => O.MethodInfo MenuLinkIterGetValueMethodInfo a signature where
    overloadedMethod = menuLinkIterGetValue

#endif

-- method MenuLinkIter::next
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "iter"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "MenuLinkIter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GMenuLinkIter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "g_menu_link_iter_next" g_menu_link_iter_next :: 
    Ptr MenuLinkIter ->                     -- iter : TInterface (Name {namespace = "Gio", name = "MenuLinkIter"})
    IO CInt

-- | Attempts to advance the iterator to the next (possibly first)
-- link.
-- 
-- 'P.True' is returned on success, or 'P.False' if there are no more links.
-- 
-- You must call this function when you first acquire the iterator to
-- advance it to the first link (and determine if the first link exists
-- at all).
-- 
-- /Since: 2.32/
menuLinkIterNext ::
    (B.CallStack.HasCallStack, MonadIO m, IsMenuLinkIter a) =>
    a
    -- ^ /@iter@/: a t'GI.Gio.Objects.MenuLinkIter.MenuLinkIter'
    -> m Bool
    -- ^ __Returns:__ 'P.True' on success, or 'P.False' when there are no more links
menuLinkIterNext :: a -> m Bool
menuLinkIterNext iter :: a
iter = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr MenuLinkIter
iter' <- a -> IO (Ptr MenuLinkIter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
iter
    CInt
result <- Ptr MenuLinkIter -> IO CInt
g_menu_link_iter_next Ptr MenuLinkIter
iter'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
iter
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data MenuLinkIterNextMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMenuLinkIter a) => O.MethodInfo MenuLinkIterNextMethodInfo a signature where
    overloadedMethod = menuLinkIterNext

#endif