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

The 'GI.Gio.Interfaces.Mount.Mount' interface represents user-visible mounts. Note, when
porting from GnomeVFS, 'GI.Gio.Interfaces.Mount.Mount' is the moral equivalent of @/GnomeVFSVolume/@.

'GI.Gio.Interfaces.Mount.Mount' is a \"mounted\" filesystem that you can access. Mounted is in
quotes because it\'s not the same as a unix mount, it might be a gvfs
mount, but you can still access the files on it if you use GIO. Might or
might not be related to a volume object.

Unmounting a 'GI.Gio.Interfaces.Mount.Mount' instance is an asynchronous operation. For
more information about asynchronous operations, see 'GI.Gio.Interfaces.AsyncResult.AsyncResult'
and 'GI.Gio.Objects.Task.Task'. To unmount a 'GI.Gio.Interfaces.Mount.Mount' instance, first call
'GI.Gio.Interfaces.Mount.mountUnmountWithOperation' with (at least) the 'GI.Gio.Interfaces.Mount.Mount' instance and a
'GI.Gio.Callbacks.AsyncReadyCallback'.  The callback will be fired when the
operation has resolved (either with success or failure), and a
@/GAsyncReady/@ structure will be passed to the callback.  That
callback should then call 'GI.Gio.Interfaces.Mount.mountUnmountWithOperationFinish' with the 'GI.Gio.Interfaces.Mount.Mount'
and the @/GAsyncReady/@ data to see if the operation was completed
successfully.  If an /@error@/ is present when 'GI.Gio.Interfaces.Mount.mountUnmountWithOperationFinish'
is called, then it will be filled with any error information.
-}

module GI.Gio.Interfaces.Mount
    ( 

-- * Exported types
    Mount(..)                               ,
    noMount                                 ,
    IsMount                                 ,
    toMount                                 ,


 -- * Methods
-- ** canEject #method:canEject#
    MountCanEjectMethodInfo                 ,
    mountCanEject                           ,


-- ** canUnmount #method:canUnmount#
    MountCanUnmountMethodInfo               ,
    mountCanUnmount                         ,


-- ** eject #method:eject#
    MountEjectMethodInfo                    ,
    mountEject                              ,


-- ** ejectFinish #method:ejectFinish#
    MountEjectFinishMethodInfo              ,
    mountEjectFinish                        ,


-- ** ejectWithOperation #method:ejectWithOperation#
    MountEjectWithOperationMethodInfo       ,
    mountEjectWithOperation                 ,


-- ** ejectWithOperationFinish #method:ejectWithOperationFinish#
    MountEjectWithOperationFinishMethodInfo ,
    mountEjectWithOperationFinish           ,


-- ** getDefaultLocation #method:getDefaultLocation#
    MountGetDefaultLocationMethodInfo       ,
    mountGetDefaultLocation                 ,


-- ** getDrive #method:getDrive#
    MountGetDriveMethodInfo                 ,
    mountGetDrive                           ,


-- ** getIcon #method:getIcon#
    MountGetIconMethodInfo                  ,
    mountGetIcon                            ,


-- ** getName #method:getName#
    MountGetNameMethodInfo                  ,
    mountGetName                            ,


-- ** getRoot #method:getRoot#
    MountGetRootMethodInfo                  ,
    mountGetRoot                            ,


-- ** getSortKey #method:getSortKey#
    MountGetSortKeyMethodInfo               ,
    mountGetSortKey                         ,


-- ** getSymbolicIcon #method:getSymbolicIcon#
    MountGetSymbolicIconMethodInfo          ,
    mountGetSymbolicIcon                    ,


-- ** getUuid #method:getUuid#
    MountGetUuidMethodInfo                  ,
    mountGetUuid                            ,


-- ** getVolume #method:getVolume#
    MountGetVolumeMethodInfo                ,
    mountGetVolume                          ,


-- ** guessContentType #method:guessContentType#
    MountGuessContentTypeMethodInfo         ,
    mountGuessContentType                   ,


-- ** guessContentTypeFinish #method:guessContentTypeFinish#
    MountGuessContentTypeFinishMethodInfo   ,
    mountGuessContentTypeFinish             ,


-- ** guessContentTypeSync #method:guessContentTypeSync#
    MountGuessContentTypeSyncMethodInfo     ,
    mountGuessContentTypeSync               ,


-- ** isShadowed #method:isShadowed#
    MountIsShadowedMethodInfo               ,
    mountIsShadowed                         ,


-- ** remount #method:remount#
    MountRemountMethodInfo                  ,
    mountRemount                            ,


-- ** remountFinish #method:remountFinish#
    MountRemountFinishMethodInfo            ,
    mountRemountFinish                      ,


-- ** shadow #method:shadow#
    MountShadowMethodInfo                   ,
    mountShadow                             ,


-- ** unmount #method:unmount#
    MountUnmountMethodInfo                  ,
    mountUnmount                            ,


-- ** unmountFinish #method:unmountFinish#
    MountUnmountFinishMethodInfo            ,
    mountUnmountFinish                      ,


-- ** unmountWithOperation #method:unmountWithOperation#
    MountUnmountWithOperationMethodInfo     ,
    mountUnmountWithOperation               ,


-- ** unmountWithOperationFinish #method:unmountWithOperationFinish#
    MountUnmountWithOperationFinishMethodInfo,
    mountUnmountWithOperationFinish         ,


-- ** unshadow #method:unshadow#
    MountUnshadowMethodInfo                 ,
    mountUnshadow                           ,




 -- * Signals
-- ** changed #signal:changed#
    C_MountChangedCallback                  ,
    MountChangedCallback                    ,
    MountChangedSignalInfo                  ,
    afterMountChanged                       ,
    genClosure_MountChanged                 ,
    mk_MountChangedCallback                 ,
    noMountChangedCallback                  ,
    onMountChanged                          ,
    wrap_MountChangedCallback               ,


-- ** preUnmount #signal:preUnmount#
    C_MountPreUnmountCallback               ,
    MountPreUnmountCallback                 ,
    MountPreUnmountSignalInfo               ,
    afterMountPreUnmount                    ,
    genClosure_MountPreUnmount              ,
    mk_MountPreUnmountCallback              ,
    noMountPreUnmountCallback               ,
    onMountPreUnmount                       ,
    wrap_MountPreUnmountCallback            ,


-- ** unmounted #signal:unmounted#
    C_MountUnmountedCallback                ,
    MountUnmountedCallback                  ,
    MountUnmountedSignalInfo                ,
    afterMountUnmounted                     ,
    genClosure_MountUnmounted               ,
    mk_MountUnmountedCallback               ,
    noMountUnmountedCallback                ,
    onMountUnmounted                        ,
    wrap_MountUnmountedCallback             ,




    ) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Drive as Gio.Drive
import {-# SOURCE #-} qualified GI.Gio.Interfaces.File as Gio.File
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Icon as Gio.Icon
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Volume as Gio.Volume
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.MountOperation as Gio.MountOperation

-- interface Mount 
newtype Mount = Mount (ManagedPtr Mount)
noMount :: Maybe Mount
noMount = Nothing

type family ResolveMountMethod (t :: Symbol) (o :: *) :: * where
    ResolveMountMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveMountMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveMountMethod "canEject" o = MountCanEjectMethodInfo
    ResolveMountMethod "canUnmount" o = MountCanUnmountMethodInfo
    ResolveMountMethod "eject" o = MountEjectMethodInfo
    ResolveMountMethod "ejectFinish" o = MountEjectFinishMethodInfo
    ResolveMountMethod "ejectWithOperation" o = MountEjectWithOperationMethodInfo
    ResolveMountMethod "ejectWithOperationFinish" o = MountEjectWithOperationFinishMethodInfo
    ResolveMountMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveMountMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveMountMethod "guessContentType" o = MountGuessContentTypeMethodInfo
    ResolveMountMethod "guessContentTypeFinish" o = MountGuessContentTypeFinishMethodInfo
    ResolveMountMethod "guessContentTypeSync" o = MountGuessContentTypeSyncMethodInfo
    ResolveMountMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveMountMethod "isShadowed" o = MountIsShadowedMethodInfo
    ResolveMountMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveMountMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveMountMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveMountMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveMountMethod "remount" o = MountRemountMethodInfo
    ResolveMountMethod "remountFinish" o = MountRemountFinishMethodInfo
    ResolveMountMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveMountMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveMountMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveMountMethod "shadow" o = MountShadowMethodInfo
    ResolveMountMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveMountMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveMountMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveMountMethod "unmount" o = MountUnmountMethodInfo
    ResolveMountMethod "unmountFinish" o = MountUnmountFinishMethodInfo
    ResolveMountMethod "unmountWithOperation" o = MountUnmountWithOperationMethodInfo
    ResolveMountMethod "unmountWithOperationFinish" o = MountUnmountWithOperationFinishMethodInfo
    ResolveMountMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveMountMethod "unshadow" o = MountUnshadowMethodInfo
    ResolveMountMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveMountMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveMountMethod "getDefaultLocation" o = MountGetDefaultLocationMethodInfo
    ResolveMountMethod "getDrive" o = MountGetDriveMethodInfo
    ResolveMountMethod "getIcon" o = MountGetIconMethodInfo
    ResolveMountMethod "getName" o = MountGetNameMethodInfo
    ResolveMountMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveMountMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveMountMethod "getRoot" o = MountGetRootMethodInfo
    ResolveMountMethod "getSortKey" o = MountGetSortKeyMethodInfo
    ResolveMountMethod "getSymbolicIcon" o = MountGetSymbolicIconMethodInfo
    ResolveMountMethod "getUuid" o = MountGetUuidMethodInfo
    ResolveMountMethod "getVolume" o = MountGetVolumeMethodInfo
    ResolveMountMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveMountMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveMountMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveMountMethod t Mount, O.MethodInfo info Mount p) => O.IsLabelProxy t (Mount -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveMountMethod t Mount, O.MethodInfo info Mount p) => O.IsLabel t (Mount -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

-- signal Mount::changed
type MountChangedCallback =
    IO ()

noMountChangedCallback :: Maybe MountChangedCallback
noMountChangedCallback = Nothing

type C_MountChangedCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_MountChangedCallback :: C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)

genClosure_MountChanged :: MountChangedCallback -> IO Closure
genClosure_MountChanged cb = do
    let cb' = wrap_MountChangedCallback cb
    mk_MountChangedCallback cb' >>= newCClosure


wrap_MountChangedCallback ::
    MountChangedCallback ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_MountChangedCallback _cb _ _ = do
    _cb 


onMountChanged :: (GObject a, MonadIO m) => a -> MountChangedCallback -> m SignalHandlerId
onMountChanged obj cb = liftIO $ connectMountChanged obj cb SignalConnectBefore
afterMountChanged :: (GObject a, MonadIO m) => a -> MountChangedCallback -> m SignalHandlerId
afterMountChanged obj cb = connectMountChanged obj cb SignalConnectAfter

connectMountChanged :: (GObject a, MonadIO m) =>
                       a -> MountChangedCallback -> SignalConnectMode -> m SignalHandlerId
connectMountChanged obj cb after = liftIO $ do
    let cb' = wrap_MountChangedCallback cb
    cb'' <- mk_MountChangedCallback cb'
    connectSignalFunPtr obj "changed" cb'' after

-- signal Mount::pre-unmount
type MountPreUnmountCallback =
    IO ()

noMountPreUnmountCallback :: Maybe MountPreUnmountCallback
noMountPreUnmountCallback = Nothing

type C_MountPreUnmountCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_MountPreUnmountCallback :: C_MountPreUnmountCallback -> IO (FunPtr C_MountPreUnmountCallback)

genClosure_MountPreUnmount :: MountPreUnmountCallback -> IO Closure
genClosure_MountPreUnmount cb = do
    let cb' = wrap_MountPreUnmountCallback cb
    mk_MountPreUnmountCallback cb' >>= newCClosure


wrap_MountPreUnmountCallback ::
    MountPreUnmountCallback ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_MountPreUnmountCallback _cb _ _ = do
    _cb 


onMountPreUnmount :: (GObject a, MonadIO m) => a -> MountPreUnmountCallback -> m SignalHandlerId
onMountPreUnmount obj cb = liftIO $ connectMountPreUnmount obj cb SignalConnectBefore
afterMountPreUnmount :: (GObject a, MonadIO m) => a -> MountPreUnmountCallback -> m SignalHandlerId
afterMountPreUnmount obj cb = connectMountPreUnmount obj cb SignalConnectAfter

connectMountPreUnmount :: (GObject a, MonadIO m) =>
                          a -> MountPreUnmountCallback -> SignalConnectMode -> m SignalHandlerId
connectMountPreUnmount obj cb after = liftIO $ do
    let cb' = wrap_MountPreUnmountCallback cb
    cb'' <- mk_MountPreUnmountCallback cb'
    connectSignalFunPtr obj "pre-unmount" cb'' after

-- signal Mount::unmounted
type MountUnmountedCallback =
    IO ()

noMountUnmountedCallback :: Maybe MountUnmountedCallback
noMountUnmountedCallback = Nothing

type C_MountUnmountedCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_MountUnmountedCallback :: C_MountUnmountedCallback -> IO (FunPtr C_MountUnmountedCallback)

genClosure_MountUnmounted :: MountUnmountedCallback -> IO Closure
genClosure_MountUnmounted cb = do
    let cb' = wrap_MountUnmountedCallback cb
    mk_MountUnmountedCallback cb' >>= newCClosure


wrap_MountUnmountedCallback ::
    MountUnmountedCallback ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_MountUnmountedCallback _cb _ _ = do
    _cb 


onMountUnmounted :: (GObject a, MonadIO m) => a -> MountUnmountedCallback -> m SignalHandlerId
onMountUnmounted obj cb = liftIO $ connectMountUnmounted obj cb SignalConnectBefore
afterMountUnmounted :: (GObject a, MonadIO m) => a -> MountUnmountedCallback -> m SignalHandlerId
afterMountUnmounted obj cb = connectMountUnmounted obj cb SignalConnectAfter

connectMountUnmounted :: (GObject a, MonadIO m) =>
                         a -> MountUnmountedCallback -> SignalConnectMode -> m SignalHandlerId
connectMountUnmounted obj cb after = liftIO $ do
    let cb' = wrap_MountUnmountedCallback cb
    cb'' <- mk_MountUnmountedCallback cb'
    connectSignalFunPtr obj "unmounted" cb'' after

instance O.HasAttributeList Mount
type instance O.AttributeList Mount = MountAttributeList
type MountAttributeList = ('[ ] :: [(Symbol, *)])

data MountChangedSignalInfo
instance SignalInfo MountChangedSignalInfo where
    type HaskellCallbackType MountChangedSignalInfo = MountChangedCallback
    connectSignal _ = connectMountChanged

data MountPreUnmountSignalInfo
instance SignalInfo MountPreUnmountSignalInfo where
    type HaskellCallbackType MountPreUnmountSignalInfo = MountPreUnmountCallback
    connectSignal _ = connectMountPreUnmount

data MountUnmountedSignalInfo
instance SignalInfo MountUnmountedSignalInfo where
    type HaskellCallbackType MountUnmountedSignalInfo = MountUnmountedCallback
    connectSignal _ = connectMountUnmounted

type instance O.SignalList Mount = MountSignalList
type MountSignalList = ('[ '("changed", MountChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("preUnmount", MountPreUnmountSignalInfo), '("unmounted", MountUnmountedSignalInfo)] :: [(Symbol, *)])

foreign import ccall "g_mount_get_type"
    c_g_mount_get_type :: IO GType

instance GObject Mount where
    gobjectType _ = c_g_mount_get_type
    

class GObject o => IsMount o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError Mount a) =>
    IsMount a
#endif
instance IsMount Mount
instance GObject.Object.IsObject Mount

toMount :: IsMount o => o -> IO Mount
toMount = unsafeCastTo Mount

-- method Mount::can_eject
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount.", 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_mount_can_eject" g_mount_can_eject :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    IO CInt

{- |
Checks if /@mount@/ can be eject.
-}
mountCanEject ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the /@mount@/ can be ejected. -}
mountCanEject mount = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result <- g_mount_can_eject mount'
    let result' = (/= 0) result
    touchManagedPtr mount
    return result'

data MountCanEjectMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMount a) => O.MethodInfo MountCanEjectMethodInfo a signature where
    overloadedMethod _ = mountCanEject

-- method Mount::can_unmount
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount.", 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_mount_can_unmount" g_mount_can_unmount :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    IO CInt

{- |
Checks if /@mount@/ can be mounted.
-}
mountCanUnmount ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the /@mount@/ can be unmounted. -}
mountCanUnmount mount = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result <- g_mount_can_unmount mount'
    let result' = (/= 0) result
    touchManagedPtr mount
    return result'

data MountCanUnmountMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMount a) => O.MethodInfo MountCanUnmountMethodInfo a signature where
    overloadedMethod _ = mountCanUnmount

-- method Mount::eject
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gio", name = "MountUnmountFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags affecting the unmount if required for eject", 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 "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GAsyncReadyCallback, or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, 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 passed to @callback.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_mount_eject" g_mount_eject :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gio", name = "MountUnmountFlags"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

{-# DEPRECATED mountEject ["(Since version 2.22)","Use 'GI.Gio.Interfaces.Mount.mountEjectWithOperation' instead."] #-}
{- |
Ejects a mount. This is an asynchronous operation, and is
finished by calling 'GI.Gio.Interfaces.Mount.mountEjectFinish' with the /@mount@/
and 'GI.Gio.Interfaces.AsyncResult.AsyncResult' data returned in the /@callback@/.
-}
mountEject ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> [Gio.Flags.MountUnmountFlags]
    {- ^ /@flags@/: flags affecting the unmount if required for eject -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: a 'GI.Gio.Callbacks.AsyncReadyCallback', or 'Nothing'. -}
    -> m ()
mountEject mount flags cancellable callback = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    let flags' = gflagsToWord flags
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    g_mount_eject mount' flags' maybeCancellable maybeCallback userData
    touchManagedPtr mount
    whenJust cancellable touchManagedPtr
    return ()

data MountEjectMethodInfo
instance (signature ~ ([Gio.Flags.MountUnmountFlags] -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) => O.MethodInfo MountEjectMethodInfo a signature where
    overloadedMethod _ = mountEject

-- method Mount::eject_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GAsyncResult.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "g_mount_eject_finish" g_mount_eject_finish :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{-# DEPRECATED mountEjectFinish ["(Since version 2.22)","Use 'GI.Gio.Interfaces.Mount.mountEjectWithOperationFinish' instead."] #-}
{- |
Finishes ejecting a mount. If any errors occurred during the operation,
/@error@/ will be set to contain the errors and 'False' will be returned.
-}
mountEjectFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> b
    {- ^ /@result@/: a 'GI.Gio.Interfaces.AsyncResult.AsyncResult'. -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
mountEjectFinish mount result_ = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        _ <- propagateGError $ g_mount_eject_finish mount' result_'
        touchManagedPtr mount
        touchManagedPtr result_
        return ()
     ) (do
        return ()
     )

data MountEjectFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo MountEjectFinishMethodInfo a signature where
    overloadedMethod _ = mountEjectFinish

-- method Mount::eject_with_operation
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gio", name = "MountUnmountFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags affecting the unmount if required for eject", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "mount_operation", argType = TInterface (Name {namespace = "Gio", name = "MountOperation"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GMountOperation or %NULL to avoid\n    user interaction.", 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 "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GAsyncReadyCallback, or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 5, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to @callback.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_mount_eject_with_operation" g_mount_eject_with_operation :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gio", name = "MountUnmountFlags"})
    Ptr Gio.MountOperation.MountOperation -> -- mount_operation : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

{- |
Ejects a mount. This is an asynchronous operation, and is
finished by calling 'GI.Gio.Interfaces.Mount.mountEjectWithOperationFinish' with the /@mount@/
and 'GI.Gio.Interfaces.AsyncResult.AsyncResult' data returned in the /@callback@/.

@since 2.22
-}
mountEjectWithOperation ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> [Gio.Flags.MountUnmountFlags]
    {- ^ /@flags@/: flags affecting the unmount if required for eject -}
    -> Maybe (b)
    {- ^ /@mountOperation@/: a 'GI.Gio.Objects.MountOperation.MountOperation' or 'Nothing' to avoid
    user interaction. -}
    -> Maybe (c)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: a 'GI.Gio.Callbacks.AsyncReadyCallback', or 'Nothing'. -}
    -> m ()
mountEjectWithOperation mount flags mountOperation cancellable callback = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    let flags' = gflagsToWord flags
    maybeMountOperation <- case mountOperation of
        Nothing -> return nullPtr
        Just jMountOperation -> do
            jMountOperation' <- unsafeManagedPtrCastPtr jMountOperation
            return jMountOperation'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    g_mount_eject_with_operation mount' flags' maybeMountOperation maybeCancellable maybeCallback userData
    touchManagedPtr mount
    whenJust mountOperation touchManagedPtr
    whenJust cancellable touchManagedPtr
    return ()

data MountEjectWithOperationMethodInfo
instance (signature ~ ([Gio.Flags.MountUnmountFlags] -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsMount a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) => O.MethodInfo MountEjectWithOperationMethodInfo a signature where
    overloadedMethod _ = mountEjectWithOperation

-- method Mount::eject_with_operation_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GAsyncResult.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "g_mount_eject_with_operation_finish" g_mount_eject_with_operation_finish :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Finishes ejecting a mount. If any errors occurred during the operation,
/@error@/ will be set to contain the errors and 'False' will be returned.

@since 2.22
-}
mountEjectWithOperationFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> b
    {- ^ /@result@/: a 'GI.Gio.Interfaces.AsyncResult.AsyncResult'. -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
mountEjectWithOperationFinish mount result_ = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        _ <- propagateGError $ g_mount_eject_with_operation_finish mount' result_'
        touchManagedPtr mount
        touchManagedPtr result_
        return ()
     ) (do
        return ()
     )

data MountEjectWithOperationFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo MountEjectWithOperationFinishMethodInfo a signature where
    overloadedMethod _ = mountEjectWithOperationFinish

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

foreign import ccall "g_mount_get_default_location" g_mount_get_default_location :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    IO (Ptr Gio.File.File)

{- |
Gets the default location of /@mount@/. The default location of the given
/@mount@/ is a path that reflects the main entry point for the user (e.g.
the home directory, or the root of the volume).
-}
mountGetDefaultLocation ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> m Gio.File.File
    {- ^ __Returns:__ a 'GI.Gio.Interfaces.File.File'.
     The returned object should be unreffed with
     'GI.GObject.Objects.Object.objectUnref' when no longer needed. -}
mountGetDefaultLocation mount = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result <- g_mount_get_default_location mount'
    checkUnexpectedReturnNULL "mountGetDefaultLocation" result
    result' <- (wrapObject Gio.File.File) result
    touchManagedPtr mount
    return result'

data MountGetDefaultLocationMethodInfo
instance (signature ~ (m Gio.File.File), MonadIO m, IsMount a) => O.MethodInfo MountGetDefaultLocationMethodInfo a signature where
    overloadedMethod _ = mountGetDefaultLocation

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

foreign import ccall "g_mount_get_drive" g_mount_get_drive :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    IO (Ptr Gio.Drive.Drive)

{- |
Gets the drive for the /@mount@/.

This is a convenience method for getting the 'GI.Gio.Interfaces.Volume.Volume' and then
using that object to get the 'GI.Gio.Interfaces.Drive.Drive'.
-}
mountGetDrive ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> m Gio.Drive.Drive
    {- ^ __Returns:__ a 'GI.Gio.Interfaces.Drive.Drive' or 'Nothing' if /@mount@/ is not associated with a volume or a drive.
     The returned object should be unreffed with
     'GI.GObject.Objects.Object.objectUnref' when no longer needed. -}
mountGetDrive mount = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result <- g_mount_get_drive mount'
    checkUnexpectedReturnNULL "mountGetDrive" result
    result' <- (wrapObject Gio.Drive.Drive) result
    touchManagedPtr mount
    return result'

data MountGetDriveMethodInfo
instance (signature ~ (m Gio.Drive.Drive), MonadIO m, IsMount a) => O.MethodInfo MountGetDriveMethodInfo a signature where
    overloadedMethod _ = mountGetDrive

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

foreign import ccall "g_mount_get_icon" g_mount_get_icon :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    IO (Ptr Gio.Icon.Icon)

{- |
Gets the icon for /@mount@/.
-}
mountGetIcon ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> m Gio.Icon.Icon
    {- ^ __Returns:__ a 'GI.Gio.Interfaces.Icon.Icon'.
     The returned object should be unreffed with
     'GI.GObject.Objects.Object.objectUnref' when no longer needed. -}
mountGetIcon mount = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result <- g_mount_get_icon mount'
    checkUnexpectedReturnNULL "mountGetIcon" result
    result' <- (wrapObject Gio.Icon.Icon) result
    touchManagedPtr mount
    return result'

data MountGetIconMethodInfo
instance (signature ~ (m Gio.Icon.Icon), MonadIO m, IsMount a) => O.MethodInfo MountGetIconMethodInfo a signature where
    overloadedMethod _ = mountGetIcon

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

{- |
Gets the name of /@mount@/.
-}
mountGetName ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> m T.Text
    {- ^ __Returns:__ the name for the given /@mount@/.
    The returned string should be freed with 'GI.GLib.Functions.free'
    when no longer needed. -}
mountGetName mount = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result <- g_mount_get_name mount'
    checkUnexpectedReturnNULL "mountGetName" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr mount
    return result'

data MountGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsMount a) => O.MethodInfo MountGetNameMethodInfo a signature where
    overloadedMethod _ = mountGetName

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

foreign import ccall "g_mount_get_root" g_mount_get_root :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    IO (Ptr Gio.File.File)

{- |
Gets the root directory on /@mount@/.
-}
mountGetRoot ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> m Gio.File.File
    {- ^ __Returns:__ a 'GI.Gio.Interfaces.File.File'.
     The returned object should be unreffed with
     'GI.GObject.Objects.Object.objectUnref' when no longer needed. -}
mountGetRoot mount = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result <- g_mount_get_root mount'
    checkUnexpectedReturnNULL "mountGetRoot" result
    result' <- (wrapObject Gio.File.File) result
    touchManagedPtr mount
    return result'

data MountGetRootMethodInfo
instance (signature ~ (m Gio.File.File), MonadIO m, IsMount a) => O.MethodInfo MountGetRootMethodInfo a signature where
    overloadedMethod _ = mountGetRoot

-- method Mount::get_sort_key
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GMount.", 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_mount_get_sort_key" g_mount_get_sort_key :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    IO CString

{- |
Gets the sort key for /@mount@/, if any.

@since 2.32
-}
mountGetSortKey ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
    a
    {- ^ /@mount@/: A 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> m T.Text
    {- ^ __Returns:__ Sorting key for /@mount@/ or 'Nothing' if no such key is available. -}
mountGetSortKey mount = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result <- g_mount_get_sort_key mount'
    checkUnexpectedReturnNULL "mountGetSortKey" result
    result' <- cstringToText result
    touchManagedPtr mount
    return result'

data MountGetSortKeyMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsMount a) => O.MethodInfo MountGetSortKeyMethodInfo a signature where
    overloadedMethod _ = mountGetSortKey

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

foreign import ccall "g_mount_get_symbolic_icon" g_mount_get_symbolic_icon :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    IO (Ptr Gio.Icon.Icon)

{- |
Gets the symbolic icon for /@mount@/.

@since 2.34
-}
mountGetSymbolicIcon ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> m Gio.Icon.Icon
    {- ^ __Returns:__ a 'GI.Gio.Interfaces.Icon.Icon'.
     The returned object should be unreffed with
     'GI.GObject.Objects.Object.objectUnref' when no longer needed. -}
mountGetSymbolicIcon mount = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result <- g_mount_get_symbolic_icon mount'
    checkUnexpectedReturnNULL "mountGetSymbolicIcon" result
    result' <- (wrapObject Gio.Icon.Icon) result
    touchManagedPtr mount
    return result'

data MountGetSymbolicIconMethodInfo
instance (signature ~ (m Gio.Icon.Icon), MonadIO m, IsMount a) => O.MethodInfo MountGetSymbolicIconMethodInfo a signature where
    overloadedMethod _ = mountGetSymbolicIcon

-- method Mount::get_uuid
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount.", 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_mount_get_uuid" g_mount_get_uuid :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    IO CString

{- |
Gets the UUID for the /@mount@/. The reference is typically based on
the file system UUID for the mount in question and should be
considered an opaque string. Returns 'Nothing' if there is no UUID
available.
-}
mountGetUuid ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> m T.Text
    {- ^ __Returns:__ the UUID for /@mount@/ or 'Nothing' if no UUID can be computed.
    The returned string should be freed with 'GI.GLib.Functions.free'
    when no longer needed. -}
mountGetUuid mount = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result <- g_mount_get_uuid mount'
    checkUnexpectedReturnNULL "mountGetUuid" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr mount
    return result'

data MountGetUuidMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsMount a) => O.MethodInfo MountGetUuidMethodInfo a signature where
    overloadedMethod _ = mountGetUuid

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

foreign import ccall "g_mount_get_volume" g_mount_get_volume :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    IO (Ptr Gio.Volume.Volume)

{- |
Gets the volume for the /@mount@/.
-}
mountGetVolume ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> m Gio.Volume.Volume
    {- ^ __Returns:__ a 'GI.Gio.Interfaces.Volume.Volume' or 'Nothing' if /@mount@/ is not associated with a volume.
     The returned object should be unreffed with
     'GI.GObject.Objects.Object.objectUnref' when no longer needed. -}
mountGetVolume mount = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result <- g_mount_get_volume mount'
    checkUnexpectedReturnNULL "mountGetVolume" result
    result' <- (wrapObject Gio.Volume.Volume) result
    touchManagedPtr mount
    return result'

data MountGetVolumeMethodInfo
instance (signature ~ (m Gio.Volume.Volume), MonadIO m, IsMount a) => O.MethodInfo MountGetVolumeMethodInfo a signature where
    overloadedMethod _ = mountGetVolume

-- method Mount::guess_content_type
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "force_rescan", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Whether to force a rescan of the content.\n    Otherwise a cached result will be used if available", 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 "optional #GCancellable object, %NULL to ignore", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GAsyncReadyCallback", sinceVersion = Nothing}, argScope = ScopeTypeAsync, 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 passed to @callback", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_mount_guess_content_type" g_mount_guess_content_type :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    CInt ->                                 -- force_rescan : TBasicType TBoolean
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

{- |
Tries to guess the type of content stored on /@mount@/. Returns one or
more textual identifiers of well-known content types (typically
prefixed with \"x-content\/\"), e.g. x-content\/image-dcf for camera
memory cards. See the
<http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec shared-mime-info>
specification for more on x-content types.

This is an asynchronous operation (see
'GI.Gio.Interfaces.Mount.mountGuessContentTypeSync' for the synchronous version), and
is finished by calling 'GI.Gio.Interfaces.Mount.mountGuessContentTypeFinish' with the
/@mount@/ and 'GI.Gio.Interfaces.AsyncResult.AsyncResult' data returned in the /@callback@/.

@since 2.18
-}
mountGuessContentType ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount' -}
    -> Bool
    {- ^ /@forceRescan@/: Whether to force a rescan of the content.
    Otherwise a cached result will be used if available -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: a 'GI.Gio.Callbacks.AsyncReadyCallback' -}
    -> m ()
mountGuessContentType mount forceRescan cancellable callback = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    let forceRescan' = (fromIntegral . fromEnum) forceRescan
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    g_mount_guess_content_type mount' forceRescan' maybeCancellable maybeCallback userData
    touchManagedPtr mount
    whenJust cancellable touchManagedPtr
    return ()

data MountGuessContentTypeMethodInfo
instance (signature ~ (Bool -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) => O.MethodInfo MountGuessContentTypeMethodInfo a signature where
    overloadedMethod _ = mountGuessContentType

-- method Mount::guess_content_type_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GAsyncResult", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : True
-- Skip return : False

foreign import ccall "g_mount_guess_content_type_finish" g_mount_guess_content_type_finish :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr CString)

{- |
Finishes guessing content types of /@mount@/. If any errors occurred
during the operation, /@error@/ will be set to contain the errors and
'False' will be returned. In particular, you may get an
'GI.Gio.Enums.IOErrorEnumNotSupported' if the mount does not support content
guessing.

@since 2.18
-}
mountGuessContentTypeFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount' -}
    -> b
    {- ^ /@result@/: a 'GI.Gio.Interfaces.AsyncResult.AsyncResult' -}
    -> m [T.Text]
    {- ^ __Returns:__ a 'Nothing'-terminated array of content types or 'Nothing' on error.
    Caller should free this array with 'GI.GLib.Functions.strfreev' when done with it. /(Can throw 'Data.GI.Base.GError.GError')/ -}
mountGuessContentTypeFinish mount result_ = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        result <- propagateGError $ g_mount_guess_content_type_finish mount' result_'
        checkUnexpectedReturnNULL "mountGuessContentTypeFinish" result
        result' <- unpackZeroTerminatedUTF8CArray result
        mapZeroTerminatedCArray freeMem result
        freeMem result
        touchManagedPtr mount
        touchManagedPtr result_
        return result'
     ) (do
        return ()
     )

data MountGuessContentTypeFinishMethodInfo
instance (signature ~ (b -> m [T.Text]), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo MountGuessContentTypeFinishMethodInfo a signature where
    overloadedMethod _ = mountGuessContentTypeFinish

-- method Mount::guess_content_type_sync
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "force_rescan", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Whether to force a rescan of the content.\n    Otherwise a cached result will be used if available", 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 "optional #GCancellable object, %NULL to ignore", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : True
-- Skip return : False

foreign import ccall "g_mount_guess_content_type_sync" g_mount_guess_content_type_sync :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    CInt ->                                 -- force_rescan : TBasicType TBoolean
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr CString)

{- |
Tries to guess the type of content stored on /@mount@/. Returns one or
more textual identifiers of well-known content types (typically
prefixed with \"x-content\/\"), e.g. x-content\/image-dcf for camera
memory cards. See the
<http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec shared-mime-info>
specification for more on x-content types.

This is an synchronous operation and as such may block doing IO;
see 'GI.Gio.Interfaces.Mount.mountGuessContentType' for the asynchronous version.

@since 2.18
-}
mountGuessContentTypeSync ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount' -}
    -> Bool
    {- ^ /@forceRescan@/: Whether to force a rescan of the content.
    Otherwise a cached result will be used if available -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore -}
    -> m [T.Text]
    {- ^ __Returns:__ a 'Nothing'-terminated array of content types or 'Nothing' on error.
    Caller should free this array with 'GI.GLib.Functions.strfreev' when done with it. /(Can throw 'Data.GI.Base.GError.GError')/ -}
mountGuessContentTypeSync mount forceRescan cancellable = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    let forceRescan' = (fromIntegral . fromEnum) forceRescan
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    onException (do
        result <- propagateGError $ g_mount_guess_content_type_sync mount' forceRescan' maybeCancellable
        checkUnexpectedReturnNULL "mountGuessContentTypeSync" result
        result' <- unpackZeroTerminatedUTF8CArray result
        mapZeroTerminatedCArray freeMem result
        freeMem result
        touchManagedPtr mount
        whenJust cancellable touchManagedPtr
        return result'
     ) (do
        return ()
     )

data MountGuessContentTypeSyncMethodInfo
instance (signature ~ (Bool -> Maybe (b) -> m [T.Text]), MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) => O.MethodInfo MountGuessContentTypeSyncMethodInfo a signature where
    overloadedMethod _ = mountGuessContentTypeSync

-- method Mount::is_shadowed
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GMount.", 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_mount_is_shadowed" g_mount_is_shadowed :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    IO CInt

{- |
Determines if /@mount@/ is shadowed. Applications or libraries should
avoid displaying /@mount@/ in the user interface if it is shadowed.

A mount is said to be shadowed if there exists one or more user
visible objects (currently 'GI.Gio.Interfaces.Mount.Mount' objects) with a root that is
inside the root of /@mount@/.

One application of shadow mounts is when exposing a single file
system that is used to address several logical volumes. In this
situation, a 'GI.Gio.Objects.VolumeMonitor.VolumeMonitor' implementation would create two
'GI.Gio.Interfaces.Volume.Volume' objects (for example, one for the camera functionality of
the device and one for a SD card reader on the device) with
activation URIs @gphoto2:\/\/[usb:001,002]\/store1\/@
and @gphoto2:\/\/[usb:001,002]\/store2\/@. When the
underlying mount (with root
@gphoto2:\/\/[usb:001,002]\/@) is mounted, said
'GI.Gio.Objects.VolumeMonitor.VolumeMonitor' implementation would create two 'GI.Gio.Interfaces.Mount.Mount' objects
(each with their root matching the corresponding volume activation
root) that would shadow the original mount.

The proxy monitor in GVfs 2.26 and later, automatically creates and
manage shadow mounts (and shadows the underlying mount) if the
activation root on a 'GI.Gio.Interfaces.Volume.Volume' is set.

@since 2.20
-}
mountIsShadowed ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
    a
    {- ^ /@mount@/: A 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> m Bool
    {- ^ __Returns:__ 'True' if /@mount@/ is shadowed. -}
mountIsShadowed mount = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result <- g_mount_is_shadowed mount'
    let result' = (/= 0) result
    touchManagedPtr mount
    return result'

data MountIsShadowedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMount a) => O.MethodInfo MountIsShadowedMethodInfo a signature where
    overloadedMethod _ = mountIsShadowed

-- method Mount::remount
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gio", name = "MountMountFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags affecting the operation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "mount_operation", argType = TInterface (Name {namespace = "Gio", name = "MountOperation"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GMountOperation or %NULL to avoid\n    user interaction.", 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 "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GAsyncReadyCallback, or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 5, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to @callback.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_mount_remount" g_mount_remount :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gio", name = "MountMountFlags"})
    Ptr Gio.MountOperation.MountOperation -> -- mount_operation : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

{- |
Remounts a mount. This is an asynchronous operation, and is
finished by calling 'GI.Gio.Interfaces.Mount.mountRemountFinish' with the /@mount@/
and @/GAsyncResults/@ data returned in the /@callback@/.

Remounting is useful when some setting affecting the operation
of the volume has been changed, as these may need a remount to
take affect. While this is semantically equivalent with unmounting
and then remounting not all backends might need to actually be
unmounted.
-}
mountRemount ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> [Gio.Flags.MountMountFlags]
    {- ^ /@flags@/: flags affecting the operation -}
    -> Maybe (b)
    {- ^ /@mountOperation@/: a 'GI.Gio.Objects.MountOperation.MountOperation' or 'Nothing' to avoid
    user interaction. -}
    -> Maybe (c)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: a 'GI.Gio.Callbacks.AsyncReadyCallback', or 'Nothing'. -}
    -> m ()
mountRemount mount flags mountOperation cancellable callback = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    let flags' = gflagsToWord flags
    maybeMountOperation <- case mountOperation of
        Nothing -> return nullPtr
        Just jMountOperation -> do
            jMountOperation' <- unsafeManagedPtrCastPtr jMountOperation
            return jMountOperation'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    g_mount_remount mount' flags' maybeMountOperation maybeCancellable maybeCallback userData
    touchManagedPtr mount
    whenJust mountOperation touchManagedPtr
    whenJust cancellable touchManagedPtr
    return ()

data MountRemountMethodInfo
instance (signature ~ ([Gio.Flags.MountMountFlags] -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsMount a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) => O.MethodInfo MountRemountMethodInfo a signature where
    overloadedMethod _ = mountRemount

-- method Mount::remount_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GAsyncResult.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "g_mount_remount_finish" g_mount_remount_finish :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Finishes remounting a mount. If any errors occurred during the operation,
/@error@/ will be set to contain the errors and 'False' will be returned.
-}
mountRemountFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> b
    {- ^ /@result@/: a 'GI.Gio.Interfaces.AsyncResult.AsyncResult'. -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
mountRemountFinish mount result_ = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        _ <- propagateGError $ g_mount_remount_finish mount' result_'
        touchManagedPtr mount
        touchManagedPtr result_
        return ()
     ) (do
        return ()
     )

data MountRemountFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo MountRemountFinishMethodInfo a signature where
    overloadedMethod _ = mountRemountFinish

-- method Mount::shadow
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GMount.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_mount_shadow" g_mount_shadow :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    IO ()

{- |
Increments the shadow count on /@mount@/. Usually used by
'GI.Gio.Objects.VolumeMonitor.VolumeMonitor' implementations when creating a shadow mount for
/@mount@/, see 'GI.Gio.Interfaces.Mount.mountIsShadowed' for more information. The caller
will need to emit the 'GI.Gio.Interfaces.Mount.Mount'::@/changed/@ signal on /@mount@/ manually.

@since 2.20
-}
mountShadow ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
    a
    {- ^ /@mount@/: A 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> m ()
mountShadow mount = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    g_mount_shadow mount'
    touchManagedPtr mount
    return ()

data MountShadowMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMount a) => O.MethodInfo MountShadowMethodInfo a signature where
    overloadedMethod _ = mountShadow

-- method Mount::unmount
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gio", name = "MountUnmountFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags affecting the operation", 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 "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GAsyncReadyCallback, or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, 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 passed to @callback.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_mount_unmount" g_mount_unmount :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gio", name = "MountUnmountFlags"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

{-# DEPRECATED mountUnmount ["(Since version 2.22)","Use 'GI.Gio.Interfaces.Mount.mountUnmountWithOperation' instead."] #-}
{- |
Unmounts a mount. This is an asynchronous operation, and is
finished by calling 'GI.Gio.Interfaces.Mount.mountUnmountFinish' with the /@mount@/
and 'GI.Gio.Interfaces.AsyncResult.AsyncResult' data returned in the /@callback@/.
-}
mountUnmount ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> [Gio.Flags.MountUnmountFlags]
    {- ^ /@flags@/: flags affecting the operation -}
    -> Maybe (b)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: a 'GI.Gio.Callbacks.AsyncReadyCallback', or 'Nothing'. -}
    -> m ()
mountUnmount mount flags cancellable callback = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    let flags' = gflagsToWord flags
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    g_mount_unmount mount' flags' maybeCancellable maybeCallback userData
    touchManagedPtr mount
    whenJust cancellable touchManagedPtr
    return ()

data MountUnmountMethodInfo
instance (signature ~ ([Gio.Flags.MountUnmountFlags] -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) => O.MethodInfo MountUnmountMethodInfo a signature where
    overloadedMethod _ = mountUnmount

-- method Mount::unmount_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GAsyncResult.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "g_mount_unmount_finish" g_mount_unmount_finish :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{-# DEPRECATED mountUnmountFinish ["(Since version 2.22)","Use 'GI.Gio.Interfaces.Mount.mountUnmountWithOperationFinish' instead."] #-}
{- |
Finishes unmounting a mount. If any errors occurred during the operation,
/@error@/ will be set to contain the errors and 'False' will be returned.
-}
mountUnmountFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> b
    {- ^ /@result@/: a 'GI.Gio.Interfaces.AsyncResult.AsyncResult'. -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
mountUnmountFinish mount result_ = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        _ <- propagateGError $ g_mount_unmount_finish mount' result_'
        touchManagedPtr mount
        touchManagedPtr result_
        return ()
     ) (do
        return ()
     )

data MountUnmountFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo MountUnmountFinishMethodInfo a signature where
    overloadedMethod _ = mountUnmountFinish

-- method Mount::unmount_with_operation
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "flags", argType = TInterface (Name {namespace = "Gio", name = "MountUnmountFlags"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "flags affecting the operation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "mount_operation", argType = TInterface (Name {namespace = "Gio", name = "MountOperation"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GMountOperation or %NULL to avoid\n    user interaction.", 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 "optional #GCancellable object, %NULL to ignore.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GAsyncReadyCallback, or %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 5, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to @callback.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_mount_unmount_with_operation" g_mount_unmount_with_operation :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    CUInt ->                                -- flags : TInterface (Name {namespace = "Gio", name = "MountUnmountFlags"})
    Ptr Gio.MountOperation.MountOperation -> -- mount_operation : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

{- |
Unmounts a mount. This is an asynchronous operation, and is
finished by calling 'GI.Gio.Interfaces.Mount.mountUnmountWithOperationFinish' with the /@mount@/
and 'GI.Gio.Interfaces.AsyncResult.AsyncResult' data returned in the /@callback@/.

@since 2.22
-}
mountUnmountWithOperation ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> [Gio.Flags.MountUnmountFlags]
    {- ^ /@flags@/: flags affecting the operation -}
    -> Maybe (b)
    {- ^ /@mountOperation@/: a 'GI.Gio.Objects.MountOperation.MountOperation' or 'Nothing' to avoid
    user interaction. -}
    -> Maybe (c)
    {- ^ /@cancellable@/: optional 'GI.Gio.Objects.Cancellable.Cancellable' object, 'Nothing' to ignore. -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: a 'GI.Gio.Callbacks.AsyncReadyCallback', or 'Nothing'. -}
    -> m ()
mountUnmountWithOperation mount flags mountOperation cancellable callback = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    let flags' = gflagsToWord flags
    maybeMountOperation <- case mountOperation of
        Nothing -> return nullPtr
        Just jMountOperation -> do
            jMountOperation' <- unsafeManagedPtrCastPtr jMountOperation
            return jMountOperation'
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    g_mount_unmount_with_operation mount' flags' maybeMountOperation maybeCancellable maybeCallback userData
    touchManagedPtr mount
    whenJust mountOperation touchManagedPtr
    whenJust cancellable touchManagedPtr
    return ()

data MountUnmountWithOperationMethodInfo
instance (signature ~ ([Gio.Flags.MountUnmountFlags] -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsMount a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) => O.MethodInfo MountUnmountWithOperationMethodInfo a signature where
    overloadedMethod _ = mountUnmountWithOperation

-- method Mount::unmount_with_operation_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMount.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GAsyncResult.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "g_mount_unmount_with_operation_finish" g_mount_unmount_with_operation_finish :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{- |
Finishes unmounting a mount. If any errors occurred during the operation,
/@error@/ will be set to contain the errors and 'False' will be returned.

@since 2.22
-}
mountUnmountWithOperationFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    {- ^ /@mount@/: a 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> b
    {- ^ /@result@/: a 'GI.Gio.Interfaces.AsyncResult.AsyncResult'. -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
mountUnmountWithOperationFinish mount result_ = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        _ <- propagateGError $ g_mount_unmount_with_operation_finish mount' result_'
        touchManagedPtr mount
        touchManagedPtr result_
        return ()
     ) (do
        return ()
     )

data MountUnmountWithOperationFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo MountUnmountWithOperationFinishMethodInfo a signature where
    overloadedMethod _ = mountUnmountWithOperationFinish

-- method Mount::unshadow
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "mount", argType = TInterface (Name {namespace = "Gio", name = "Mount"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GMount.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_mount_unshadow" g_mount_unshadow :: 
    Ptr Mount ->                            -- mount : TInterface (Name {namespace = "Gio", name = "Mount"})
    IO ()

{- |
Decrements the shadow count on /@mount@/. Usually used by
'GI.Gio.Objects.VolumeMonitor.VolumeMonitor' implementations when destroying a shadow mount for
/@mount@/, see 'GI.Gio.Interfaces.Mount.mountIsShadowed' for more information. The caller
will need to emit the 'GI.Gio.Interfaces.Mount.Mount'::@/changed/@ signal on /@mount@/ manually.

@since 2.20
-}
mountUnshadow ::
    (B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
    a
    {- ^ /@mount@/: A 'GI.Gio.Interfaces.Mount.Mount'. -}
    -> m ()
mountUnshadow mount = liftIO $ do
    mount' <- unsafeManagedPtrCastPtr mount
    g_mount_unshadow mount'
    touchManagedPtr mount
    return ()

data MountUnshadowMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMount a) => O.MethodInfo MountUnshadowMethodInfo a signature where
    overloadedMethod _ = mountUnshadow