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

'GI.Gio.Objects.MountOperation.MountOperation' provides a mechanism for interacting with the user.
It can be used for authenticating mountable operations, such as loop
mounting files, hard drive partitions or server locations. It can
also be used to ask the user questions or show a list of applications
preventing unmount or eject operations from completing.

Note that 'GI.Gio.Objects.MountOperation.MountOperation' is used for more than just 'GI.Gio.Interfaces.Mount.Mount'
objects – for example it is also used in 'GI.Gio.Interfaces.Drive.driveStart' and
'GI.Gio.Interfaces.Drive.driveStop'.

Users should instantiate a subclass of this that implements all the
various callbacks to show the required dialogs, such as
@/GtkMountOperation/@. If no user interaction is desired (for example
when automounting filesystems at login time), usually 'Nothing' can be
passed, see each method taking a 'GI.Gio.Objects.MountOperation.MountOperation' for details.
-}

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

module GI.Gio.Objects.MountOperation
    (

-- * Exported types
    MountOperation(..)                      ,
    IsMountOperation                        ,
    toMountOperation                        ,
    noMountOperation                        ,


 -- * Methods
-- ** getAnonymous #method:getAnonymous#

#if ENABLE_OVERLOADING
    MountOperationGetAnonymousMethodInfo    ,
#endif
    mountOperationGetAnonymous              ,


-- ** getChoice #method:getChoice#

#if ENABLE_OVERLOADING
    MountOperationGetChoiceMethodInfo       ,
#endif
    mountOperationGetChoice                 ,


-- ** getDomain #method:getDomain#

#if ENABLE_OVERLOADING
    MountOperationGetDomainMethodInfo       ,
#endif
    mountOperationGetDomain                 ,


-- ** getPassword #method:getPassword#

#if ENABLE_OVERLOADING
    MountOperationGetPasswordMethodInfo     ,
#endif
    mountOperationGetPassword               ,


-- ** getPasswordSave #method:getPasswordSave#

#if ENABLE_OVERLOADING
    MountOperationGetPasswordSaveMethodInfo ,
#endif
    mountOperationGetPasswordSave           ,


-- ** getUsername #method:getUsername#

#if ENABLE_OVERLOADING
    MountOperationGetUsernameMethodInfo     ,
#endif
    mountOperationGetUsername               ,


-- ** new #method:new#

    mountOperationNew                       ,


-- ** reply #method:reply#

#if ENABLE_OVERLOADING
    MountOperationReplyMethodInfo           ,
#endif
    mountOperationReply                     ,


-- ** setAnonymous #method:setAnonymous#

#if ENABLE_OVERLOADING
    MountOperationSetAnonymousMethodInfo    ,
#endif
    mountOperationSetAnonymous              ,


-- ** setChoice #method:setChoice#

#if ENABLE_OVERLOADING
    MountOperationSetChoiceMethodInfo       ,
#endif
    mountOperationSetChoice                 ,


-- ** setDomain #method:setDomain#

#if ENABLE_OVERLOADING
    MountOperationSetDomainMethodInfo       ,
#endif
    mountOperationSetDomain                 ,


-- ** setPassword #method:setPassword#

#if ENABLE_OVERLOADING
    MountOperationSetPasswordMethodInfo     ,
#endif
    mountOperationSetPassword               ,


-- ** setPasswordSave #method:setPasswordSave#

#if ENABLE_OVERLOADING
    MountOperationSetPasswordSaveMethodInfo ,
#endif
    mountOperationSetPasswordSave           ,


-- ** setUsername #method:setUsername#

#if ENABLE_OVERLOADING
    MountOperationSetUsernameMethodInfo     ,
#endif
    mountOperationSetUsername               ,




 -- * Properties
-- ** anonymous #attr:anonymous#
{- | Whether to use an anonymous user when authenticating.
-}
#if ENABLE_OVERLOADING
    MountOperationAnonymousPropertyInfo     ,
#endif
    constructMountOperationAnonymous        ,
    getMountOperationAnonymous              ,
#if ENABLE_OVERLOADING
    mountOperationAnonymous                 ,
#endif
    setMountOperationAnonymous              ,


-- ** choice #attr:choice#
{- | The index of the user\'s choice when a question is asked during the
mount operation. See the 'GI.Gio.Objects.MountOperation.MountOperation'::@/ask-question/@ signal.
-}
#if ENABLE_OVERLOADING
    MountOperationChoicePropertyInfo        ,
#endif
    constructMountOperationChoice           ,
    getMountOperationChoice                 ,
#if ENABLE_OVERLOADING
    mountOperationChoice                    ,
#endif
    setMountOperationChoice                 ,


-- ** domain #attr:domain#
{- | The domain to use for the mount operation.
-}
#if ENABLE_OVERLOADING
    MountOperationDomainPropertyInfo        ,
#endif
    constructMountOperationDomain           ,
    getMountOperationDomain                 ,
#if ENABLE_OVERLOADING
    mountOperationDomain                    ,
#endif
    setMountOperationDomain                 ,


-- ** password #attr:password#
{- | The password that is used for authentication when carrying out
the mount operation.
-}
#if ENABLE_OVERLOADING
    MountOperationPasswordPropertyInfo      ,
#endif
    constructMountOperationPassword         ,
    getMountOperationPassword               ,
#if ENABLE_OVERLOADING
    mountOperationPassword                  ,
#endif
    setMountOperationPassword               ,


-- ** passwordSave #attr:passwordSave#
{- | Determines if and how the password information should be saved.
-}
#if ENABLE_OVERLOADING
    MountOperationPasswordSavePropertyInfo  ,
#endif
    constructMountOperationPasswordSave     ,
    getMountOperationPasswordSave           ,
#if ENABLE_OVERLOADING
    mountOperationPasswordSave              ,
#endif
    setMountOperationPasswordSave           ,


-- ** username #attr:username#
{- | The user name that is used for authentication when carrying out
the mount operation.
-}
#if ENABLE_OVERLOADING
    MountOperationUsernamePropertyInfo      ,
#endif
    constructMountOperationUsername         ,
    getMountOperationUsername               ,
#if ENABLE_OVERLOADING
    mountOperationUsername                  ,
#endif
    setMountOperationUsername               ,




 -- * Signals
-- ** aborted #signal:aborted#

    C_MountOperationAbortedCallback         ,
    MountOperationAbortedCallback           ,
#if ENABLE_OVERLOADING
    MountOperationAbortedSignalInfo         ,
#endif
    afterMountOperationAborted              ,
    genClosure_MountOperationAborted        ,
    mk_MountOperationAbortedCallback        ,
    noMountOperationAbortedCallback         ,
    onMountOperationAborted                 ,
    wrap_MountOperationAbortedCallback      ,


-- ** askPassword #signal:askPassword#

    C_MountOperationAskPasswordCallback     ,
    MountOperationAskPasswordCallback       ,
#if ENABLE_OVERLOADING
    MountOperationAskPasswordSignalInfo     ,
#endif
    afterMountOperationAskPassword          ,
    genClosure_MountOperationAskPassword    ,
    mk_MountOperationAskPasswordCallback    ,
    noMountOperationAskPasswordCallback     ,
    onMountOperationAskPassword             ,
    wrap_MountOperationAskPasswordCallback  ,


-- ** askQuestion #signal:askQuestion#

    C_MountOperationAskQuestionCallback     ,
    MountOperationAskQuestionCallback       ,
#if ENABLE_OVERLOADING
    MountOperationAskQuestionSignalInfo     ,
#endif
    afterMountOperationAskQuestion          ,
    genClosure_MountOperationAskQuestion    ,
    mk_MountOperationAskQuestionCallback    ,
    noMountOperationAskQuestionCallback     ,
    onMountOperationAskQuestion             ,
    wrap_MountOperationAskQuestionCallback  ,


-- ** reply #signal:reply#

    C_MountOperationReplyCallback           ,
    MountOperationReplyCallback             ,
#if ENABLE_OVERLOADING
    MountOperationReplySignalInfo           ,
#endif
    afterMountOperationReply                ,
    genClosure_MountOperationReply          ,
    mk_MountOperationReplyCallback          ,
    noMountOperationReplyCallback           ,
    onMountOperationReply                   ,
    wrap_MountOperationReplyCallback        ,


-- ** showProcesses #signal:showProcesses#

    C_MountOperationShowProcessesCallback   ,
    MountOperationShowProcessesCallback     ,
#if ENABLE_OVERLOADING
    MountOperationShowProcessesSignalInfo   ,
#endif
    afterMountOperationShowProcesses        ,
    genClosure_MountOperationShowProcesses  ,
    mk_MountOperationShowProcessesCallback  ,
    noMountOperationShowProcessesCallback   ,
    onMountOperationShowProcesses           ,
    wrap_MountOperationShowProcessesCallback,


-- ** showUnmountProgress #signal:showUnmountProgress#

    C_MountOperationShowUnmountProgressCallback,
    MountOperationShowUnmountProgressCallback,
#if ENABLE_OVERLOADING
    MountOperationShowUnmountProgressSignalInfo,
#endif
    afterMountOperationShowUnmountProgress  ,
    genClosure_MountOperationShowUnmountProgress,
    mk_MountOperationShowUnmountProgressCallback,
    noMountOperationShowUnmountProgressCallback,
    onMountOperationShowUnmountProgress     ,
    wrap_MountOperationShowUnmountProgressCallback,




    ) 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.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.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 {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags

-- | Memory-managed wrapper type.
newtype MountOperation = MountOperation (ManagedPtr MountOperation)
foreign import ccall "g_mount_operation_get_type"
    c_g_mount_operation_get_type :: IO GType

instance GObject MountOperation where
    gobjectType _ = c_g_mount_operation_get_type


-- | Type class for types which can be safely cast to `MountOperation`, for instance with `toMountOperation`.
class GObject o => IsMountOperation o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError MountOperation a) =>
    IsMountOperation a
#endif
instance IsMountOperation MountOperation
instance GObject.Object.IsObject MountOperation

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

-- | A convenience alias for `Nothing` :: `Maybe` `MountOperation`.
noMountOperation :: Maybe MountOperation
noMountOperation = Nothing

#if ENABLE_OVERLOADING
type family ResolveMountOperationMethod (t :: Symbol) (o :: *) :: * where
    ResolveMountOperationMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveMountOperationMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveMountOperationMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveMountOperationMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveMountOperationMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveMountOperationMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveMountOperationMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveMountOperationMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveMountOperationMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveMountOperationMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveMountOperationMethod "reply" o = MountOperationReplyMethodInfo
    ResolveMountOperationMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveMountOperationMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveMountOperationMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveMountOperationMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveMountOperationMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveMountOperationMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveMountOperationMethod "getAnonymous" o = MountOperationGetAnonymousMethodInfo
    ResolveMountOperationMethod "getChoice" o = MountOperationGetChoiceMethodInfo
    ResolveMountOperationMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveMountOperationMethod "getDomain" o = MountOperationGetDomainMethodInfo
    ResolveMountOperationMethod "getPassword" o = MountOperationGetPasswordMethodInfo
    ResolveMountOperationMethod "getPasswordSave" o = MountOperationGetPasswordSaveMethodInfo
    ResolveMountOperationMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveMountOperationMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveMountOperationMethod "getUsername" o = MountOperationGetUsernameMethodInfo
    ResolveMountOperationMethod "setAnonymous" o = MountOperationSetAnonymousMethodInfo
    ResolveMountOperationMethod "setChoice" o = MountOperationSetChoiceMethodInfo
    ResolveMountOperationMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveMountOperationMethod "setDomain" o = MountOperationSetDomainMethodInfo
    ResolveMountOperationMethod "setPassword" o = MountOperationSetPasswordMethodInfo
    ResolveMountOperationMethod "setPasswordSave" o = MountOperationSetPasswordSaveMethodInfo
    ResolveMountOperationMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveMountOperationMethod "setUsername" o = MountOperationSetUsernameMethodInfo
    ResolveMountOperationMethod l o = O.MethodResolutionFailed l o

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

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

#endif

-- signal MountOperation::aborted
{- |
Emitted by the backend when e.g. a device becomes unavailable
while a mount operation is in progress.

Implementations of GMountOperation should handle this signal
by dismissing open password dialogs.

/Since: 2.20/
-}
type MountOperationAbortedCallback =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MountOperationAbortedCallback`@.
noMountOperationAbortedCallback :: Maybe MountOperationAbortedCallback
noMountOperationAbortedCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MountOperationAbortedCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_MountOperationAbortedCallback`.
foreign import ccall "wrapper"
    mk_MountOperationAbortedCallback :: C_MountOperationAbortedCallback -> IO (FunPtr C_MountOperationAbortedCallback)

-- | Wrap the callback into a `Closure`.
genClosure_MountOperationAborted :: MountOperationAbortedCallback -> IO Closure
genClosure_MountOperationAborted cb = do
    let cb' = wrap_MountOperationAbortedCallback cb
    mk_MountOperationAbortedCallback cb' >>= newCClosure


-- | Wrap a `MountOperationAbortedCallback` into a `C_MountOperationAbortedCallback`.
wrap_MountOperationAbortedCallback ::
    MountOperationAbortedCallback ->
    C_MountOperationAbortedCallback
wrap_MountOperationAbortedCallback _cb _ _ = do
    _cb


{- |
Connect a signal handler for the “@aborted@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' mountOperation #aborted callback
@
-}
onMountOperationAborted :: (IsMountOperation a, MonadIO m) => a -> MountOperationAbortedCallback -> m SignalHandlerId
onMountOperationAborted obj cb = liftIO $ do
    let cb' = wrap_MountOperationAbortedCallback cb
    cb'' <- mk_MountOperationAbortedCallback cb'
    connectSignalFunPtr obj "aborted" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@aborted@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' mountOperation #aborted callback
@
-}
afterMountOperationAborted :: (IsMountOperation a, MonadIO m) => a -> MountOperationAbortedCallback -> m SignalHandlerId
afterMountOperationAborted obj cb = liftIO $ do
    let cb' = wrap_MountOperationAbortedCallback cb
    cb'' <- mk_MountOperationAbortedCallback cb'
    connectSignalFunPtr obj "aborted" cb'' SignalConnectAfter


-- signal MountOperation::ask-password
{- |
Emitted when a mount operation asks the user for a password.

If the message contains a line break, the first line should be
presented as a heading. For example, it may be used as the
primary text in a @/GtkMessageDialog/@.
-}
type MountOperationAskPasswordCallback =
    T.Text
    {- ^ /@message@/: string containing a message to display to the user. -}
    -> T.Text
    {- ^ /@defaultUser@/: string containing the default user name. -}
    -> T.Text
    {- ^ /@defaultDomain@/: string containing the default domain. -}
    -> [Gio.Flags.AskPasswordFlags]
    {- ^ /@flags@/: a set of 'GI.Gio.Flags.AskPasswordFlags'. -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MountOperationAskPasswordCallback`@.
noMountOperationAskPasswordCallback :: Maybe MountOperationAskPasswordCallback
noMountOperationAskPasswordCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MountOperationAskPasswordCallback =
    Ptr () ->                               -- object
    CString ->
    CString ->
    CString ->
    CUInt ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_MountOperationAskPasswordCallback`.
foreign import ccall "wrapper"
    mk_MountOperationAskPasswordCallback :: C_MountOperationAskPasswordCallback -> IO (FunPtr C_MountOperationAskPasswordCallback)

-- | Wrap the callback into a `Closure`.
genClosure_MountOperationAskPassword :: MountOperationAskPasswordCallback -> IO Closure
genClosure_MountOperationAskPassword cb = do
    let cb' = wrap_MountOperationAskPasswordCallback cb
    mk_MountOperationAskPasswordCallback cb' >>= newCClosure


-- | Wrap a `MountOperationAskPasswordCallback` into a `C_MountOperationAskPasswordCallback`.
wrap_MountOperationAskPasswordCallback ::
    MountOperationAskPasswordCallback ->
    C_MountOperationAskPasswordCallback
wrap_MountOperationAskPasswordCallback _cb _ message defaultUser defaultDomain flags _ = do
    message' <- cstringToText message
    defaultUser' <- cstringToText defaultUser
    defaultDomain' <- cstringToText defaultDomain
    let flags' = wordToGFlags flags
    _cb  message' defaultUser' defaultDomain' flags'


{- |
Connect a signal handler for the “@ask-password@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' mountOperation #askPassword callback
@
-}
onMountOperationAskPassword :: (IsMountOperation a, MonadIO m) => a -> MountOperationAskPasswordCallback -> m SignalHandlerId
onMountOperationAskPassword obj cb = liftIO $ do
    let cb' = wrap_MountOperationAskPasswordCallback cb
    cb'' <- mk_MountOperationAskPasswordCallback cb'
    connectSignalFunPtr obj "ask-password" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@ask-password@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' mountOperation #askPassword callback
@
-}
afterMountOperationAskPassword :: (IsMountOperation a, MonadIO m) => a -> MountOperationAskPasswordCallback -> m SignalHandlerId
afterMountOperationAskPassword obj cb = liftIO $ do
    let cb' = wrap_MountOperationAskPasswordCallback cb
    cb'' <- mk_MountOperationAskPasswordCallback cb'
    connectSignalFunPtr obj "ask-password" cb'' SignalConnectAfter


-- signal MountOperation::ask-question
{- |
Emitted when asking the user a question and gives a list of
choices for the user to choose from.

If the message contains a line break, the first line should be
presented as a heading. For example, it may be used as the
primary text in a @/GtkMessageDialog/@.
-}
type MountOperationAskQuestionCallback =
    T.Text
    {- ^ /@message@/: string containing a message to display to the user. -}
    -> [T.Text]
    {- ^ /@choices@/: an array of strings for each possible choice. -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MountOperationAskQuestionCallback`@.
noMountOperationAskQuestionCallback :: Maybe MountOperationAskQuestionCallback
noMountOperationAskQuestionCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MountOperationAskQuestionCallback =
    Ptr () ->                               -- object
    CString ->
    Ptr CString ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_MountOperationAskQuestionCallback`.
foreign import ccall "wrapper"
    mk_MountOperationAskQuestionCallback :: C_MountOperationAskQuestionCallback -> IO (FunPtr C_MountOperationAskQuestionCallback)

-- | Wrap the callback into a `Closure`.
genClosure_MountOperationAskQuestion :: MountOperationAskQuestionCallback -> IO Closure
genClosure_MountOperationAskQuestion cb = do
    let cb' = wrap_MountOperationAskQuestionCallback cb
    mk_MountOperationAskQuestionCallback cb' >>= newCClosure


-- | Wrap a `MountOperationAskQuestionCallback` into a `C_MountOperationAskQuestionCallback`.
wrap_MountOperationAskQuestionCallback ::
    MountOperationAskQuestionCallback ->
    C_MountOperationAskQuestionCallback
wrap_MountOperationAskQuestionCallback _cb _ message choices _ = do
    message' <- cstringToText message
    choices' <- unpackZeroTerminatedUTF8CArray choices
    _cb  message' choices'


{- |
Connect a signal handler for the “@ask-question@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' mountOperation #askQuestion callback
@
-}
onMountOperationAskQuestion :: (IsMountOperation a, MonadIO m) => a -> MountOperationAskQuestionCallback -> m SignalHandlerId
onMountOperationAskQuestion obj cb = liftIO $ do
    let cb' = wrap_MountOperationAskQuestionCallback cb
    cb'' <- mk_MountOperationAskQuestionCallback cb'
    connectSignalFunPtr obj "ask-question" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@ask-question@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' mountOperation #askQuestion callback
@
-}
afterMountOperationAskQuestion :: (IsMountOperation a, MonadIO m) => a -> MountOperationAskQuestionCallback -> m SignalHandlerId
afterMountOperationAskQuestion obj cb = liftIO $ do
    let cb' = wrap_MountOperationAskQuestionCallback cb
    cb'' <- mk_MountOperationAskQuestionCallback cb'
    connectSignalFunPtr obj "ask-question" cb'' SignalConnectAfter


-- signal MountOperation::reply
{- |
Emitted when the user has replied to the mount operation.
-}
type MountOperationReplyCallback =
    Gio.Enums.MountOperationResult
    {- ^ /@result@/: a 'GI.Gio.Enums.MountOperationResult' indicating how the request was handled -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MountOperationReplyCallback`@.
noMountOperationReplyCallback :: Maybe MountOperationReplyCallback
noMountOperationReplyCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MountOperationReplyCallback =
    Ptr () ->                               -- object
    CUInt ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_MountOperationReplyCallback`.
foreign import ccall "wrapper"
    mk_MountOperationReplyCallback :: C_MountOperationReplyCallback -> IO (FunPtr C_MountOperationReplyCallback)

-- | Wrap the callback into a `Closure`.
genClosure_MountOperationReply :: MountOperationReplyCallback -> IO Closure
genClosure_MountOperationReply cb = do
    let cb' = wrap_MountOperationReplyCallback cb
    mk_MountOperationReplyCallback cb' >>= newCClosure


-- | Wrap a `MountOperationReplyCallback` into a `C_MountOperationReplyCallback`.
wrap_MountOperationReplyCallback ::
    MountOperationReplyCallback ->
    C_MountOperationReplyCallback
wrap_MountOperationReplyCallback _cb _ result_ _ = do
    let result_' = (toEnum . fromIntegral) result_
    _cb  result_'


{- |
Connect a signal handler for the “@reply@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' mountOperation #reply callback
@
-}
onMountOperationReply :: (IsMountOperation a, MonadIO m) => a -> MountOperationReplyCallback -> m SignalHandlerId
onMountOperationReply obj cb = liftIO $ do
    let cb' = wrap_MountOperationReplyCallback cb
    cb'' <- mk_MountOperationReplyCallback cb'
    connectSignalFunPtr obj "reply" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@reply@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' mountOperation #reply callback
@
-}
afterMountOperationReply :: (IsMountOperation a, MonadIO m) => a -> MountOperationReplyCallback -> m SignalHandlerId
afterMountOperationReply obj cb = liftIO $ do
    let cb' = wrap_MountOperationReplyCallback cb
    cb'' <- mk_MountOperationReplyCallback cb'
    connectSignalFunPtr obj "reply" cb'' SignalConnectAfter


-- signal MountOperation::show-processes
{- |
Emitted when one or more processes are blocking an operation
e.g. unmounting\/ejecting a 'GI.Gio.Interfaces.Mount.Mount' or stopping a 'GI.Gio.Interfaces.Drive.Drive'.

Note that this signal may be emitted several times to update the
list of blocking processes as processes close files. The
application should only respond with 'GI.Gio.Objects.MountOperation.mountOperationReply' to
the latest signal (setting 'GI.Gio.Objects.MountOperation.MountOperation':@/choice/@ to the choice
the user made).

If the message contains a line break, the first line should be
presented as a heading. For example, it may be used as the
primary text in a @/GtkMessageDialog/@.

/Since: 2.22/
-}
type MountOperationShowProcessesCallback =
    T.Text
    {- ^ /@message@/: string containing a message to display to the user. -}
    -> [Int32]
    {- ^ /@processes@/: an array of @/GPid/@ for processes
  blocking the operation. -}
    -> [T.Text]
    {- ^ /@choices@/: an array of strings for each possible choice. -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MountOperationShowProcessesCallback`@.
noMountOperationShowProcessesCallback :: Maybe MountOperationShowProcessesCallback
noMountOperationShowProcessesCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MountOperationShowProcessesCallback =
    Ptr () ->                               -- object
    CString ->
    Ptr (GArray Int32) ->
    Ptr CString ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_MountOperationShowProcessesCallback`.
foreign import ccall "wrapper"
    mk_MountOperationShowProcessesCallback :: C_MountOperationShowProcessesCallback -> IO (FunPtr C_MountOperationShowProcessesCallback)

-- | Wrap the callback into a `Closure`.
genClosure_MountOperationShowProcesses :: MountOperationShowProcessesCallback -> IO Closure
genClosure_MountOperationShowProcesses cb = do
    let cb' = wrap_MountOperationShowProcessesCallback cb
    mk_MountOperationShowProcessesCallback cb' >>= newCClosure


-- | Wrap a `MountOperationShowProcessesCallback` into a `C_MountOperationShowProcessesCallback`.
wrap_MountOperationShowProcessesCallback ::
    MountOperationShowProcessesCallback ->
    C_MountOperationShowProcessesCallback
wrap_MountOperationShowProcessesCallback _cb _ message processes choices _ = do
    message' <- cstringToText message
    processes' <- unpackGArray processes
    choices' <- unpackZeroTerminatedUTF8CArray choices
    _cb  message' processes' choices'


{- |
Connect a signal handler for the “@show-processes@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' mountOperation #showProcesses callback
@
-}
onMountOperationShowProcesses :: (IsMountOperation a, MonadIO m) => a -> MountOperationShowProcessesCallback -> m SignalHandlerId
onMountOperationShowProcesses obj cb = liftIO $ do
    let cb' = wrap_MountOperationShowProcessesCallback cb
    cb'' <- mk_MountOperationShowProcessesCallback cb'
    connectSignalFunPtr obj "show-processes" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@show-processes@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' mountOperation #showProcesses callback
@
-}
afterMountOperationShowProcesses :: (IsMountOperation a, MonadIO m) => a -> MountOperationShowProcessesCallback -> m SignalHandlerId
afterMountOperationShowProcesses obj cb = liftIO $ do
    let cb' = wrap_MountOperationShowProcessesCallback cb
    cb'' <- mk_MountOperationShowProcessesCallback cb'
    connectSignalFunPtr obj "show-processes" cb'' SignalConnectAfter


-- signal MountOperation::show-unmount-progress
{- |
Emitted when an unmount operation has been busy for more than some time
(typically 1.5 seconds).

When unmounting or ejecting a volume, the kernel might need to flush
pending data in its buffers to the volume stable storage, and this operation
can take a considerable amount of time. This signal may be emitted several
times as long as the unmount operation is outstanding, and then one
last time when the operation is completed, with /@bytesLeft@/ set to zero.

Implementations of GMountOperation should handle this signal by
showing an UI notification, and then dismiss it, or show another notification
of completion, when /@bytesLeft@/ reaches zero.

If the message contains a line break, the first line should be
presented as a heading. For example, it may be used as the
primary text in a @/GtkMessageDialog/@.

/Since: 2.34/
-}
type MountOperationShowUnmountProgressCallback =
    T.Text
    {- ^ /@message@/: string containing a mesage to display to the user -}
    -> Int64
    {- ^ /@timeLeft@/: the estimated time left before the operation completes,
    in microseconds, or -1 -}
    -> Int64
    {- ^ /@bytesLeft@/: the amount of bytes to be written before the operation
    completes (or -1 if such amount is not known), or zero if the operation
    is completed -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MountOperationShowUnmountProgressCallback`@.
noMountOperationShowUnmountProgressCallback :: Maybe MountOperationShowUnmountProgressCallback
noMountOperationShowUnmountProgressCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_MountOperationShowUnmountProgressCallback =
    Ptr () ->                               -- object
    CString ->
    Int64 ->
    Int64 ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_MountOperationShowUnmountProgressCallback`.
foreign import ccall "wrapper"
    mk_MountOperationShowUnmountProgressCallback :: C_MountOperationShowUnmountProgressCallback -> IO (FunPtr C_MountOperationShowUnmountProgressCallback)

-- | Wrap the callback into a `Closure`.
genClosure_MountOperationShowUnmountProgress :: MountOperationShowUnmountProgressCallback -> IO Closure
genClosure_MountOperationShowUnmountProgress cb = do
    let cb' = wrap_MountOperationShowUnmountProgressCallback cb
    mk_MountOperationShowUnmountProgressCallback cb' >>= newCClosure


-- | Wrap a `MountOperationShowUnmountProgressCallback` into a `C_MountOperationShowUnmountProgressCallback`.
wrap_MountOperationShowUnmountProgressCallback ::
    MountOperationShowUnmountProgressCallback ->
    C_MountOperationShowUnmountProgressCallback
wrap_MountOperationShowUnmountProgressCallback _cb _ message timeLeft bytesLeft _ = do
    message' <- cstringToText message
    _cb  message' timeLeft bytesLeft


{- |
Connect a signal handler for the “@show-unmount-progress@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' mountOperation #showUnmountProgress callback
@
-}
onMountOperationShowUnmountProgress :: (IsMountOperation a, MonadIO m) => a -> MountOperationShowUnmountProgressCallback -> m SignalHandlerId
onMountOperationShowUnmountProgress obj cb = liftIO $ do
    let cb' = wrap_MountOperationShowUnmountProgressCallback cb
    cb'' <- mk_MountOperationShowUnmountProgressCallback cb'
    connectSignalFunPtr obj "show-unmount-progress" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@show-unmount-progress@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' mountOperation #showUnmountProgress callback
@
-}
afterMountOperationShowUnmountProgress :: (IsMountOperation a, MonadIO m) => a -> MountOperationShowUnmountProgressCallback -> m SignalHandlerId
afterMountOperationShowUnmountProgress obj cb = liftIO $ do
    let cb' = wrap_MountOperationShowUnmountProgressCallback cb
    cb'' <- mk_MountOperationShowUnmountProgressCallback cb'
    connectSignalFunPtr obj "show-unmount-progress" cb'' SignalConnectAfter


-- VVV Prop "anonymous"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

{- |
Get the value of the “@anonymous@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' mountOperation #anonymous
@
-}
getMountOperationAnonymous :: (MonadIO m, IsMountOperation o) => o -> m Bool
getMountOperationAnonymous obj = liftIO $ getObjectPropertyBool obj "anonymous"

{- |
Set the value of the “@anonymous@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' mountOperation [ #anonymous 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMountOperationAnonymous :: (MonadIO m, IsMountOperation o) => o -> Bool -> m ()
setMountOperationAnonymous obj val = liftIO $ setObjectPropertyBool obj "anonymous" val

{- |
Construct a `GValueConstruct` with valid value for the “@anonymous@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMountOperationAnonymous :: (IsMountOperation o) => Bool -> IO (GValueConstruct o)
constructMountOperationAnonymous val = constructObjectPropertyBool "anonymous" val

#if ENABLE_OVERLOADING
data MountOperationAnonymousPropertyInfo
instance AttrInfo MountOperationAnonymousPropertyInfo where
    type AttrAllowedOps MountOperationAnonymousPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint MountOperationAnonymousPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint MountOperationAnonymousPropertyInfo = IsMountOperation
    type AttrGetType MountOperationAnonymousPropertyInfo = Bool
    type AttrLabel MountOperationAnonymousPropertyInfo = "anonymous"
    type AttrOrigin MountOperationAnonymousPropertyInfo = MountOperation
    attrGet _ = getMountOperationAnonymous
    attrSet _ = setMountOperationAnonymous
    attrConstruct _ = constructMountOperationAnonymous
    attrClear _ = undefined
#endif

-- VVV Prop "choice"
   -- Type: TBasicType TInt
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

{- |
Get the value of the “@choice@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' mountOperation #choice
@
-}
getMountOperationChoice :: (MonadIO m, IsMountOperation o) => o -> m Int32
getMountOperationChoice obj = liftIO $ getObjectPropertyInt32 obj "choice"

{- |
Set the value of the “@choice@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' mountOperation [ #choice 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMountOperationChoice :: (MonadIO m, IsMountOperation o) => o -> Int32 -> m ()
setMountOperationChoice obj val = liftIO $ setObjectPropertyInt32 obj "choice" val

{- |
Construct a `GValueConstruct` with valid value for the “@choice@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMountOperationChoice :: (IsMountOperation o) => Int32 -> IO (GValueConstruct o)
constructMountOperationChoice val = constructObjectPropertyInt32 "choice" val

#if ENABLE_OVERLOADING
data MountOperationChoicePropertyInfo
instance AttrInfo MountOperationChoicePropertyInfo where
    type AttrAllowedOps MountOperationChoicePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint MountOperationChoicePropertyInfo = (~) Int32
    type AttrBaseTypeConstraint MountOperationChoicePropertyInfo = IsMountOperation
    type AttrGetType MountOperationChoicePropertyInfo = Int32
    type AttrLabel MountOperationChoicePropertyInfo = "choice"
    type AttrOrigin MountOperationChoicePropertyInfo = MountOperation
    attrGet _ = getMountOperationChoice
    attrSet _ = setMountOperationChoice
    attrConstruct _ = constructMountOperationChoice
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@domain@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' mountOperation #domain
@
-}
getMountOperationDomain :: (MonadIO m, IsMountOperation o) => o -> m T.Text
getMountOperationDomain obj = liftIO $ checkUnexpectedNothing "getMountOperationDomain" $ getObjectPropertyString obj "domain"

{- |
Set the value of the “@domain@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' mountOperation [ #domain 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMountOperationDomain :: (MonadIO m, IsMountOperation o) => o -> T.Text -> m ()
setMountOperationDomain obj val = liftIO $ setObjectPropertyString obj "domain" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@domain@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMountOperationDomain :: (IsMountOperation o) => T.Text -> IO (GValueConstruct o)
constructMountOperationDomain val = constructObjectPropertyString "domain" (Just val)

#if ENABLE_OVERLOADING
data MountOperationDomainPropertyInfo
instance AttrInfo MountOperationDomainPropertyInfo where
    type AttrAllowedOps MountOperationDomainPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint MountOperationDomainPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint MountOperationDomainPropertyInfo = IsMountOperation
    type AttrGetType MountOperationDomainPropertyInfo = T.Text
    type AttrLabel MountOperationDomainPropertyInfo = "domain"
    type AttrOrigin MountOperationDomainPropertyInfo = MountOperation
    attrGet _ = getMountOperationDomain
    attrSet _ = setMountOperationDomain
    attrConstruct _ = constructMountOperationDomain
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@password@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' mountOperation #password
@
-}
getMountOperationPassword :: (MonadIO m, IsMountOperation o) => o -> m T.Text
getMountOperationPassword obj = liftIO $ checkUnexpectedNothing "getMountOperationPassword" $ getObjectPropertyString obj "password"

{- |
Set the value of the “@password@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' mountOperation [ #password 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMountOperationPassword :: (MonadIO m, IsMountOperation o) => o -> T.Text -> m ()
setMountOperationPassword obj val = liftIO $ setObjectPropertyString obj "password" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@password@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMountOperationPassword :: (IsMountOperation o) => T.Text -> IO (GValueConstruct o)
constructMountOperationPassword val = constructObjectPropertyString "password" (Just val)

#if ENABLE_OVERLOADING
data MountOperationPasswordPropertyInfo
instance AttrInfo MountOperationPasswordPropertyInfo where
    type AttrAllowedOps MountOperationPasswordPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint MountOperationPasswordPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint MountOperationPasswordPropertyInfo = IsMountOperation
    type AttrGetType MountOperationPasswordPropertyInfo = T.Text
    type AttrLabel MountOperationPasswordPropertyInfo = "password"
    type AttrOrigin MountOperationPasswordPropertyInfo = MountOperation
    attrGet _ = getMountOperationPassword
    attrSet _ = setMountOperationPassword
    attrConstruct _ = constructMountOperationPassword
    attrClear _ = undefined
#endif

-- VVV Prop "password-save"
   -- Type: TInterface (Name {namespace = "Gio", name = "PasswordSave"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

{- |
Get the value of the “@password-save@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' mountOperation #passwordSave
@
-}
getMountOperationPasswordSave :: (MonadIO m, IsMountOperation o) => o -> m Gio.Enums.PasswordSave
getMountOperationPasswordSave obj = liftIO $ getObjectPropertyEnum obj "password-save"

{- |
Set the value of the “@password-save@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' mountOperation [ #passwordSave 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMountOperationPasswordSave :: (MonadIO m, IsMountOperation o) => o -> Gio.Enums.PasswordSave -> m ()
setMountOperationPasswordSave obj val = liftIO $ setObjectPropertyEnum obj "password-save" val

{- |
Construct a `GValueConstruct` with valid value for the “@password-save@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMountOperationPasswordSave :: (IsMountOperation o) => Gio.Enums.PasswordSave -> IO (GValueConstruct o)
constructMountOperationPasswordSave val = constructObjectPropertyEnum "password-save" val

#if ENABLE_OVERLOADING
data MountOperationPasswordSavePropertyInfo
instance AttrInfo MountOperationPasswordSavePropertyInfo where
    type AttrAllowedOps MountOperationPasswordSavePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint MountOperationPasswordSavePropertyInfo = (~) Gio.Enums.PasswordSave
    type AttrBaseTypeConstraint MountOperationPasswordSavePropertyInfo = IsMountOperation
    type AttrGetType MountOperationPasswordSavePropertyInfo = Gio.Enums.PasswordSave
    type AttrLabel MountOperationPasswordSavePropertyInfo = "password-save"
    type AttrOrigin MountOperationPasswordSavePropertyInfo = MountOperation
    attrGet _ = getMountOperationPasswordSave
    attrSet _ = setMountOperationPasswordSave
    attrConstruct _ = constructMountOperationPasswordSave
    attrClear _ = undefined
#endif

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

{- |
Get the value of the “@username@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' mountOperation #username
@
-}
getMountOperationUsername :: (MonadIO m, IsMountOperation o) => o -> m T.Text
getMountOperationUsername obj = liftIO $ checkUnexpectedNothing "getMountOperationUsername" $ getObjectPropertyString obj "username"

{- |
Set the value of the “@username@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' mountOperation [ #username 'Data.GI.Base.Attributes.:=' value ]
@
-}
setMountOperationUsername :: (MonadIO m, IsMountOperation o) => o -> T.Text -> m ()
setMountOperationUsername obj val = liftIO $ setObjectPropertyString obj "username" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@username@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructMountOperationUsername :: (IsMountOperation o) => T.Text -> IO (GValueConstruct o)
constructMountOperationUsername val = constructObjectPropertyString "username" (Just val)

#if ENABLE_OVERLOADING
data MountOperationUsernamePropertyInfo
instance AttrInfo MountOperationUsernamePropertyInfo where
    type AttrAllowedOps MountOperationUsernamePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint MountOperationUsernamePropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint MountOperationUsernamePropertyInfo = IsMountOperation
    type AttrGetType MountOperationUsernamePropertyInfo = T.Text
    type AttrLabel MountOperationUsernamePropertyInfo = "username"
    type AttrOrigin MountOperationUsernamePropertyInfo = MountOperation
    attrGet _ = getMountOperationUsername
    attrSet _ = setMountOperationUsername
    attrConstruct _ = constructMountOperationUsername
    attrClear _ = undefined
#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList MountOperation
type instance O.AttributeList MountOperation = MountOperationAttributeList
type MountOperationAttributeList = ('[ '("anonymous", MountOperationAnonymousPropertyInfo), '("choice", MountOperationChoicePropertyInfo), '("domain", MountOperationDomainPropertyInfo), '("password", MountOperationPasswordPropertyInfo), '("passwordSave", MountOperationPasswordSavePropertyInfo), '("username", MountOperationUsernamePropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
mountOperationAnonymous :: AttrLabelProxy "anonymous"
mountOperationAnonymous = AttrLabelProxy

mountOperationChoice :: AttrLabelProxy "choice"
mountOperationChoice = AttrLabelProxy

mountOperationDomain :: AttrLabelProxy "domain"
mountOperationDomain = AttrLabelProxy

mountOperationPassword :: AttrLabelProxy "password"
mountOperationPassword = AttrLabelProxy

mountOperationPasswordSave :: AttrLabelProxy "passwordSave"
mountOperationPasswordSave = AttrLabelProxy

mountOperationUsername :: AttrLabelProxy "username"
mountOperationUsername = AttrLabelProxy

#endif

#if ENABLE_OVERLOADING
data MountOperationAbortedSignalInfo
instance SignalInfo MountOperationAbortedSignalInfo where
    type HaskellCallbackType MountOperationAbortedSignalInfo = MountOperationAbortedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MountOperationAbortedCallback cb
        cb'' <- mk_MountOperationAbortedCallback cb'
        connectSignalFunPtr obj "aborted" cb'' connectMode

data MountOperationAskPasswordSignalInfo
instance SignalInfo MountOperationAskPasswordSignalInfo where
    type HaskellCallbackType MountOperationAskPasswordSignalInfo = MountOperationAskPasswordCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MountOperationAskPasswordCallback cb
        cb'' <- mk_MountOperationAskPasswordCallback cb'
        connectSignalFunPtr obj "ask-password" cb'' connectMode

data MountOperationAskQuestionSignalInfo
instance SignalInfo MountOperationAskQuestionSignalInfo where
    type HaskellCallbackType MountOperationAskQuestionSignalInfo = MountOperationAskQuestionCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MountOperationAskQuestionCallback cb
        cb'' <- mk_MountOperationAskQuestionCallback cb'
        connectSignalFunPtr obj "ask-question" cb'' connectMode

data MountOperationReplySignalInfo
instance SignalInfo MountOperationReplySignalInfo where
    type HaskellCallbackType MountOperationReplySignalInfo = MountOperationReplyCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MountOperationReplyCallback cb
        cb'' <- mk_MountOperationReplyCallback cb'
        connectSignalFunPtr obj "reply" cb'' connectMode

data MountOperationShowProcessesSignalInfo
instance SignalInfo MountOperationShowProcessesSignalInfo where
    type HaskellCallbackType MountOperationShowProcessesSignalInfo = MountOperationShowProcessesCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MountOperationShowProcessesCallback cb
        cb'' <- mk_MountOperationShowProcessesCallback cb'
        connectSignalFunPtr obj "show-processes" cb'' connectMode

data MountOperationShowUnmountProgressSignalInfo
instance SignalInfo MountOperationShowUnmountProgressSignalInfo where
    type HaskellCallbackType MountOperationShowUnmountProgressSignalInfo = MountOperationShowUnmountProgressCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_MountOperationShowUnmountProgressCallback cb
        cb'' <- mk_MountOperationShowUnmountProgressCallback cb'
        connectSignalFunPtr obj "show-unmount-progress" cb'' connectMode

type instance O.SignalList MountOperation = MountOperationSignalList
type MountOperationSignalList = ('[ '("aborted", MountOperationAbortedSignalInfo), '("askPassword", MountOperationAskPasswordSignalInfo), '("askQuestion", MountOperationAskQuestionSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("reply", MountOperationReplySignalInfo), '("showProcesses", MountOperationShowProcessesSignalInfo), '("showUnmountProgress", MountOperationShowUnmountProgressSignalInfo)] :: [(Symbol, *)])

#endif

-- method MountOperation::new
-- method type : Constructor
-- Args : []
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "MountOperation"}))
-- throws : False
-- Skip return : False

foreign import ccall "g_mount_operation_new" g_mount_operation_new ::
    IO (Ptr MountOperation)

{- |
Creates a new mount operation.
-}
mountOperationNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m MountOperation
    {- ^ __Returns:__ a 'GI.Gio.Objects.MountOperation.MountOperation'. -}
mountOperationNew  = liftIO $ do
    result <- g_mount_operation_new
    checkUnexpectedReturnNULL "mountOperationNew" result
    result' <- (wrapObject MountOperation) result
    return result'

#if ENABLE_OVERLOADING
#endif

-- method MountOperation::get_anonymous
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gio", name = "MountOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMountOperation.", 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_operation_get_anonymous" g_mount_operation_get_anonymous ::
    Ptr MountOperation ->                   -- op : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    IO CInt

{- |
Check to see whether the mount operation is being used
for an anonymous user.
-}
mountOperationGetAnonymous ::
    (B.CallStack.HasCallStack, MonadIO m, IsMountOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gio.Objects.MountOperation.MountOperation'. -}
    -> m Bool
    {- ^ __Returns:__ 'True' if mount operation is anonymous. -}
mountOperationGetAnonymous op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    result <- g_mount_operation_get_anonymous op'
    let result' = (/= 0) result
    touchManagedPtr op
    return result'

#if ENABLE_OVERLOADING
data MountOperationGetAnonymousMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMountOperation a) => O.MethodInfo MountOperationGetAnonymousMethodInfo a signature where
    overloadedMethod _ = mountOperationGetAnonymous

#endif

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

foreign import ccall "g_mount_operation_get_choice" g_mount_operation_get_choice ::
    Ptr MountOperation ->                   -- op : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    IO Int32

{- |
Gets a choice from the mount operation.
-}
mountOperationGetChoice ::
    (B.CallStack.HasCallStack, MonadIO m, IsMountOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gio.Objects.MountOperation.MountOperation'. -}
    -> m Int32
    {- ^ __Returns:__ an integer containing an index of the user\'s choice from
the choice\'s list, or @/0/@. -}
mountOperationGetChoice op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    result <- g_mount_operation_get_choice op'
    touchManagedPtr op
    return result

#if ENABLE_OVERLOADING
data MountOperationGetChoiceMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsMountOperation a) => O.MethodInfo MountOperationGetChoiceMethodInfo a signature where
    overloadedMethod _ = mountOperationGetChoice

#endif

-- method MountOperation::get_domain
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gio", name = "MountOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMountOperation.", 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_operation_get_domain" g_mount_operation_get_domain ::
    Ptr MountOperation ->                   -- op : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    IO CString

{- |
Gets the domain of the mount operation.
-}
mountOperationGetDomain ::
    (B.CallStack.HasCallStack, MonadIO m, IsMountOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gio.Objects.MountOperation.MountOperation'. -}
    -> m T.Text
    {- ^ __Returns:__ a string set to the domain. -}
mountOperationGetDomain op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    result <- g_mount_operation_get_domain op'
    checkUnexpectedReturnNULL "mountOperationGetDomain" result
    result' <- cstringToText result
    touchManagedPtr op
    return result'

#if ENABLE_OVERLOADING
data MountOperationGetDomainMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsMountOperation a) => O.MethodInfo MountOperationGetDomainMethodInfo a signature where
    overloadedMethod _ = mountOperationGetDomain

#endif

-- method MountOperation::get_password
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gio", name = "MountOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMountOperation.", 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_operation_get_password" g_mount_operation_get_password ::
    Ptr MountOperation ->                   -- op : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    IO CString

{- |
Gets a password from the mount operation.
-}
mountOperationGetPassword ::
    (B.CallStack.HasCallStack, MonadIO m, IsMountOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gio.Objects.MountOperation.MountOperation'. -}
    -> m T.Text
    {- ^ __Returns:__ a string containing the password within /@op@/. -}
mountOperationGetPassword op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    result <- g_mount_operation_get_password op'
    checkUnexpectedReturnNULL "mountOperationGetPassword" result
    result' <- cstringToText result
    touchManagedPtr op
    return result'

#if ENABLE_OVERLOADING
data MountOperationGetPasswordMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsMountOperation a) => O.MethodInfo MountOperationGetPasswordMethodInfo a signature where
    overloadedMethod _ = mountOperationGetPassword

#endif

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

foreign import ccall "g_mount_operation_get_password_save" g_mount_operation_get_password_save ::
    Ptr MountOperation ->                   -- op : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    IO CUInt

{- |
Gets the state of saving passwords for the mount operation.
-}
mountOperationGetPasswordSave ::
    (B.CallStack.HasCallStack, MonadIO m, IsMountOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gio.Objects.MountOperation.MountOperation'. -}
    -> m Gio.Enums.PasswordSave
    {- ^ __Returns:__ a 'GI.Gio.Enums.PasswordSave' flag. -}
mountOperationGetPasswordSave op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    result <- g_mount_operation_get_password_save op'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr op
    return result'

#if ENABLE_OVERLOADING
data MountOperationGetPasswordSaveMethodInfo
instance (signature ~ (m Gio.Enums.PasswordSave), MonadIO m, IsMountOperation a) => O.MethodInfo MountOperationGetPasswordSaveMethodInfo a signature where
    overloadedMethod _ = mountOperationGetPasswordSave

#endif

-- method MountOperation::get_username
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gio", name = "MountOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMountOperation.", 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_operation_get_username" g_mount_operation_get_username ::
    Ptr MountOperation ->                   -- op : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    IO CString

{- |
Get the user name from the mount operation.
-}
mountOperationGetUsername ::
    (B.CallStack.HasCallStack, MonadIO m, IsMountOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gio.Objects.MountOperation.MountOperation'. -}
    -> m T.Text
    {- ^ __Returns:__ a string containing the user name. -}
mountOperationGetUsername op = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    result <- g_mount_operation_get_username op'
    checkUnexpectedReturnNULL "mountOperationGetUsername" result
    result' <- cstringToText result
    touchManagedPtr op
    return result'

#if ENABLE_OVERLOADING
data MountOperationGetUsernameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsMountOperation a) => O.MethodInfo MountOperationGetUsernameMethodInfo a signature where
    overloadedMethod _ = mountOperationGetUsername

#endif

-- method MountOperation::reply
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gio", name = "MountOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMountOperation", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "MountOperationResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMountOperationResult", 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_operation_reply" g_mount_operation_reply ::
    Ptr MountOperation ->                   -- op : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    CUInt ->                                -- result : TInterface (Name {namespace = "Gio", name = "MountOperationResult"})
    IO ()

{- |
Emits the 'GI.Gio.Objects.MountOperation.MountOperation'::@/reply/@ signal.
-}
mountOperationReply ::
    (B.CallStack.HasCallStack, MonadIO m, IsMountOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gio.Objects.MountOperation.MountOperation' -}
    -> Gio.Enums.MountOperationResult
    {- ^ /@result@/: a 'GI.Gio.Enums.MountOperationResult' -}
    -> m ()
mountOperationReply op result_ = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    let result_' = (fromIntegral . fromEnum) result_
    g_mount_operation_reply op' result_'
    touchManagedPtr op
    return ()

#if ENABLE_OVERLOADING
data MountOperationReplyMethodInfo
instance (signature ~ (Gio.Enums.MountOperationResult -> m ()), MonadIO m, IsMountOperation a) => O.MethodInfo MountOperationReplyMethodInfo a signature where
    overloadedMethod _ = mountOperationReply

#endif

-- method MountOperation::set_anonymous
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gio", name = "MountOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMountOperation.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "anonymous", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "boolean value.", 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_operation_set_anonymous" g_mount_operation_set_anonymous ::
    Ptr MountOperation ->                   -- op : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    CInt ->                                 -- anonymous : TBasicType TBoolean
    IO ()

{- |
Sets the mount operation to use an anonymous user if /@anonymous@/ is 'True'.
-}
mountOperationSetAnonymous ::
    (B.CallStack.HasCallStack, MonadIO m, IsMountOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gio.Objects.MountOperation.MountOperation'. -}
    -> Bool
    {- ^ /@anonymous@/: boolean value. -}
    -> m ()
mountOperationSetAnonymous op anonymous = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    let anonymous' = (fromIntegral . fromEnum) anonymous
    g_mount_operation_set_anonymous op' anonymous'
    touchManagedPtr op
    return ()

#if ENABLE_OVERLOADING
data MountOperationSetAnonymousMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsMountOperation a) => O.MethodInfo MountOperationSetAnonymousMethodInfo a signature where
    overloadedMethod _ = mountOperationSetAnonymous

#endif

-- method MountOperation::set_choice
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gio", name = "MountOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMountOperation.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "choice", argType = TBasicType TInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an integer.", 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_operation_set_choice" g_mount_operation_set_choice ::
    Ptr MountOperation ->                   -- op : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    Int32 ->                                -- choice : TBasicType TInt
    IO ()

{- |
Sets a default choice for the mount operation.
-}
mountOperationSetChoice ::
    (B.CallStack.HasCallStack, MonadIO m, IsMountOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gio.Objects.MountOperation.MountOperation'. -}
    -> Int32
    {- ^ /@choice@/: an integer. -}
    -> m ()
mountOperationSetChoice op choice = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    g_mount_operation_set_choice op' choice
    touchManagedPtr op
    return ()

#if ENABLE_OVERLOADING
data MountOperationSetChoiceMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsMountOperation a) => O.MethodInfo MountOperationSetChoiceMethodInfo a signature where
    overloadedMethod _ = mountOperationSetChoice

#endif

-- method MountOperation::set_domain
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gio", name = "MountOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMountOperation.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "domain", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the domain to set.", 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_operation_set_domain" g_mount_operation_set_domain ::
    Ptr MountOperation ->                   -- op : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    CString ->                              -- domain : TBasicType TUTF8
    IO ()

{- |
Sets the mount operation\'s domain.
-}
mountOperationSetDomain ::
    (B.CallStack.HasCallStack, MonadIO m, IsMountOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gio.Objects.MountOperation.MountOperation'. -}
    -> T.Text
    {- ^ /@domain@/: the domain to set. -}
    -> m ()
mountOperationSetDomain op domain = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    domain' <- textToCString domain
    g_mount_operation_set_domain op' domain'
    touchManagedPtr op
    freeMem domain'
    return ()

#if ENABLE_OVERLOADING
data MountOperationSetDomainMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsMountOperation a) => O.MethodInfo MountOperationSetDomainMethodInfo a signature where
    overloadedMethod _ = mountOperationSetDomain

#endif

-- method MountOperation::set_password
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gio", name = "MountOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMountOperation.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "password", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "password to set.", 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_operation_set_password" g_mount_operation_set_password ::
    Ptr MountOperation ->                   -- op : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    CString ->                              -- password : TBasicType TUTF8
    IO ()

{- |
Sets the mount operation\'s password to /@password@/.
-}
mountOperationSetPassword ::
    (B.CallStack.HasCallStack, MonadIO m, IsMountOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gio.Objects.MountOperation.MountOperation'. -}
    -> T.Text
    {- ^ /@password@/: password to set. -}
    -> m ()
mountOperationSetPassword op password = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    password' <- textToCString password
    g_mount_operation_set_password op' password'
    touchManagedPtr op
    freeMem password'
    return ()

#if ENABLE_OVERLOADING
data MountOperationSetPasswordMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsMountOperation a) => O.MethodInfo MountOperationSetPasswordMethodInfo a signature where
    overloadedMethod _ = mountOperationSetPassword

#endif

-- method MountOperation::set_password_save
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gio", name = "MountOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMountOperation.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "save", argType = TInterface (Name {namespace = "Gio", name = "PasswordSave"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a set of #GPasswordSave flags.", 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_operation_set_password_save" g_mount_operation_set_password_save ::
    Ptr MountOperation ->                   -- op : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    CUInt ->                                -- save : TInterface (Name {namespace = "Gio", name = "PasswordSave"})
    IO ()

{- |
Sets the state of saving passwords for the mount operation.
-}
mountOperationSetPasswordSave ::
    (B.CallStack.HasCallStack, MonadIO m, IsMountOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gio.Objects.MountOperation.MountOperation'. -}
    -> Gio.Enums.PasswordSave
    {- ^ /@save@/: a set of 'GI.Gio.Enums.PasswordSave' flags. -}
    -> m ()
mountOperationSetPasswordSave op save = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    let save' = (fromIntegral . fromEnum) save
    g_mount_operation_set_password_save op' save'
    touchManagedPtr op
    return ()

#if ENABLE_OVERLOADING
data MountOperationSetPasswordSaveMethodInfo
instance (signature ~ (Gio.Enums.PasswordSave -> m ()), MonadIO m, IsMountOperation a) => O.MethodInfo MountOperationSetPasswordSaveMethodInfo a signature where
    overloadedMethod _ = mountOperationSetPasswordSave

#endif

-- method MountOperation::set_username
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "op", argType = TInterface (Name {namespace = "Gio", name = "MountOperation"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GMountOperation.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "username", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "input username.", 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_operation_set_username" g_mount_operation_set_username ::
    Ptr MountOperation ->                   -- op : TInterface (Name {namespace = "Gio", name = "MountOperation"})
    CString ->                              -- username : TBasicType TUTF8
    IO ()

{- |
Sets the user name within /@op@/ to /@username@/.
-}
mountOperationSetUsername ::
    (B.CallStack.HasCallStack, MonadIO m, IsMountOperation a) =>
    a
    {- ^ /@op@/: a 'GI.Gio.Objects.MountOperation.MountOperation'. -}
    -> T.Text
    {- ^ /@username@/: input username. -}
    -> m ()
mountOperationSetUsername op username = liftIO $ do
    op' <- unsafeManagedPtrCastPtr op
    username' <- textToCString username
    g_mount_operation_set_username op' username'
    touchManagedPtr op
    freeMem username'
    return ()

#if ENABLE_OVERLOADING
data MountOperationSetUsernameMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsMountOperation a) => O.MethodInfo MountOperationSetUsernameMethodInfo a signature where
    overloadedMethod _ = mountOperationSetUsername

#endif