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

module GI.Gio.Interfaces.AppInfo
    ( 

-- * Exported types
    AppInfo(..)                             ,
    noAppInfo                               ,
    AppInfoK                                ,
    toAppInfo                               ,


 -- * Methods
-- ** appInfoAddSupportsType
    appInfoAddSupportsType                  ,


-- ** appInfoCanDelete
    appInfoCanDelete                        ,


-- ** appInfoCanRemoveSupportsType
    appInfoCanRemoveSupportsType            ,


-- ** appInfoDelete
    appInfoDelete                           ,


-- ** appInfoDup
    appInfoDup                              ,


-- ** appInfoEqual
    appInfoEqual                            ,


-- ** appInfoGetCommandline
    appInfoGetCommandline                   ,


-- ** appInfoGetDescription
    appInfoGetDescription                   ,


-- ** appInfoGetDisplayName
    appInfoGetDisplayName                   ,


-- ** appInfoGetExecutable
    appInfoGetExecutable                    ,


-- ** appInfoGetIcon
    appInfoGetIcon                          ,


-- ** appInfoGetId
    appInfoGetId                            ,


-- ** appInfoGetName
    appInfoGetName                          ,


-- ** appInfoGetSupportedTypes
    appInfoGetSupportedTypes                ,


-- ** appInfoLaunch
    appInfoLaunch                           ,


-- ** appInfoLaunchUris
    appInfoLaunchUris                       ,


-- ** appInfoRemoveSupportsType
    appInfoRemoveSupportsType               ,


-- ** appInfoSetAsDefaultForExtension
    appInfoSetAsDefaultForExtension         ,


-- ** appInfoSetAsDefaultForType
    appInfoSetAsDefaultForType              ,


-- ** appInfoSetAsLastUsedForType
    appInfoSetAsLastUsedForType             ,


-- ** appInfoShouldShow
    appInfoShouldShow                       ,


-- ** appInfoSupportsFiles
    appInfoSupportsFiles                    ,


-- ** appInfoSupportsUris
    appInfoSupportsUris                     ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.Gio.Types
import GI.Gio.Callbacks
import qualified GI.GObject as GObject

-- interface AppInfo 

newtype AppInfo = AppInfo (ForeignPtr AppInfo)
noAppInfo :: Maybe AppInfo
noAppInfo = Nothing

type instance AttributeList AppInfo = AppInfoAttributeList
type AppInfoAttributeList = ('[ ] :: [(Symbol, *)])

type instance SignalList AppInfo = AppInfoSignalList
type AppInfoSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])

foreign import ccall "g_app_info_get_type"
    c_g_app_info_get_type :: IO GType

type instance ParentTypes AppInfo = AppInfoParentTypes
type AppInfoParentTypes = '[GObject.Object]

instance GObject AppInfo where
    gobjectIsInitiallyUnowned _ = False
    gobjectType _ = c_g_app_info_get_type
    

class GObject o => AppInfoK o
instance (GObject o, IsDescendantOf AppInfo o) => AppInfoK o

toAppInfo :: AppInfoK o => o -> IO AppInfo
toAppInfo = unsafeCastTo AppInfo

-- method AppInfo::add_supports_type
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "content_type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "content_type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : True
-- Skip return : False

foreign import ccall "g_app_info_add_supports_type" g_app_info_add_supports_type :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    CString ->                              -- content_type : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt


appInfoAddSupportsType ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    T.Text ->                               -- content_type
    m ()
appInfoAddSupportsType _obj content_type = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    content_type' <- textToCString content_type
    onException (do
        _ <- propagateGError $ g_app_info_add_supports_type _obj' content_type'
        touchManagedPtr _obj
        freeMem content_type'
        return ()
     ) (do
        freeMem content_type'
     )

-- method AppInfo::can_delete
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_can_delete" g_app_info_can_delete :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    IO CInt


appInfoCanDelete ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    m Bool
appInfoCanDelete _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- g_app_info_can_delete _obj'
    let result' = (/= 0) result
    touchManagedPtr _obj
    return result'

-- method AppInfo::can_remove_supports_type
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_can_remove_supports_type" g_app_info_can_remove_supports_type :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    IO CInt


appInfoCanRemoveSupportsType ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    m Bool
appInfoCanRemoveSupportsType _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- g_app_info_can_remove_supports_type _obj'
    let result' = (/= 0) result
    touchManagedPtr _obj
    return result'

-- method AppInfo::delete
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_delete" g_app_info_delete :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    IO CInt


appInfoDelete ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    m Bool
appInfoDelete _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- g_app_info_delete _obj'
    let result' = (/= 0) result
    touchManagedPtr _obj
    return result'

-- method AppInfo::dup
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "Gio" "AppInfo"
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_dup" g_app_info_dup :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    IO (Ptr AppInfo)


appInfoDup ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    m AppInfo
appInfoDup _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- g_app_info_dup _obj'
    checkUnexpectedReturnNULL "g_app_info_dup" result
    result' <- (wrapObject AppInfo) result
    touchManagedPtr _obj
    return result'

-- method AppInfo::equal
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "appinfo2", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "appinfo2", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_equal" g_app_info_equal :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    Ptr AppInfo ->                          -- appinfo2 : TInterface "Gio" "AppInfo"
    IO CInt


appInfoEqual ::
    (MonadIO m, AppInfoK a, AppInfoK b) =>
    a ->                                    -- _obj
    b ->                                    -- appinfo2
    m Bool
appInfoEqual _obj appinfo2 = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let appinfo2' = unsafeManagedPtrCastPtr appinfo2
    result <- g_app_info_equal _obj' appinfo2'
    let result' = (/= 0) result
    touchManagedPtr _obj
    touchManagedPtr appinfo2
    return result'

-- method AppInfo::get_commandline
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUTF8
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_get_commandline" g_app_info_get_commandline :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    IO CString


appInfoGetCommandline ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    m T.Text
appInfoGetCommandline _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- g_app_info_get_commandline _obj'
    checkUnexpectedReturnNULL "g_app_info_get_commandline" result
    result' <- cstringToText result
    touchManagedPtr _obj
    return result'

-- method AppInfo::get_description
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUTF8
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_get_description" g_app_info_get_description :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    IO CString


appInfoGetDescription ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    m T.Text
appInfoGetDescription _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- g_app_info_get_description _obj'
    checkUnexpectedReturnNULL "g_app_info_get_description" result
    result' <- cstringToText result
    touchManagedPtr _obj
    return result'

-- method AppInfo::get_display_name
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUTF8
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_get_display_name" g_app_info_get_display_name :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    IO CString


appInfoGetDisplayName ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    m T.Text
appInfoGetDisplayName _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- g_app_info_get_display_name _obj'
    checkUnexpectedReturnNULL "g_app_info_get_display_name" result
    result' <- cstringToText result
    touchManagedPtr _obj
    return result'

-- method AppInfo::get_executable
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUTF8
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_get_executable" g_app_info_get_executable :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    IO CString


appInfoGetExecutable ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    m T.Text
appInfoGetExecutable _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- g_app_info_get_executable _obj'
    checkUnexpectedReturnNULL "g_app_info_get_executable" result
    result' <- cstringToText result
    touchManagedPtr _obj
    return result'

-- method AppInfo::get_icon
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "Gio" "Icon"
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_get_icon" g_app_info_get_icon :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    IO (Ptr Icon)


appInfoGetIcon ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    m Icon
appInfoGetIcon _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- g_app_info_get_icon _obj'
    checkUnexpectedReturnNULL "g_app_info_get_icon" result
    result' <- (newObject Icon) result
    touchManagedPtr _obj
    return result'

-- method AppInfo::get_id
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUTF8
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_get_id" g_app_info_get_id :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    IO CString


appInfoGetId ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    m T.Text
appInfoGetId _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- g_app_info_get_id _obj'
    checkUnexpectedReturnNULL "g_app_info_get_id" result
    result' <- cstringToText result
    touchManagedPtr _obj
    return result'

-- method AppInfo::get_name
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUTF8
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_get_name" g_app_info_get_name :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    IO CString


appInfoGetName ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    m T.Text
appInfoGetName _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- g_app_info_get_name _obj'
    checkUnexpectedReturnNULL "g_app_info_get_name" result
    result' <- cstringToText result
    touchManagedPtr _obj
    return result'

-- method AppInfo::get_supported_types
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TCArray True (-1) (-1) (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_get_supported_types" g_app_info_get_supported_types :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    IO (Ptr CString)


appInfoGetSupportedTypes ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    m [T.Text]
appInfoGetSupportedTypes _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- g_app_info_get_supported_types _obj'
    checkUnexpectedReturnNULL "g_app_info_get_supported_types" result
    result' <- unpackZeroTerminatedUTF8CArray result
    touchManagedPtr _obj
    return result'

-- method AppInfo::launch
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "files", argType = TGList (TInterface "Gio" "File"), direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "launch_context", argType = TInterface "Gio" "AppLaunchContext", direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "files", argType = TGList (TInterface "Gio" "File"), direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "launch_context", argType = TInterface "Gio" "AppLaunchContext", direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : True
-- Skip return : False

foreign import ccall "g_app_info_launch" g_app_info_launch :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    Ptr (GList (Ptr File)) ->               -- files : TGList (TInterface "Gio" "File")
    Ptr AppLaunchContext ->                 -- launch_context : TInterface "Gio" "AppLaunchContext"
    Ptr (Ptr GError) ->                     -- error
    IO CInt


appInfoLaunch ::
    (MonadIO m, AppInfoK a, FileK b, AppLaunchContextK c) =>
    a ->                                    -- _obj
    [b] ->                                  -- files
    Maybe (c) ->                            -- launch_context
    m ()
appInfoLaunch _obj files launch_context = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let files' = map unsafeManagedPtrCastPtr files
    files'' <- packGList files'
    maybeLaunch_context <- case launch_context of
        Nothing -> return nullPtr
        Just jLaunch_context -> do
            let jLaunch_context' = unsafeManagedPtrCastPtr jLaunch_context
            return jLaunch_context'
    onException (do
        _ <- propagateGError $ g_app_info_launch _obj' files'' maybeLaunch_context
        touchManagedPtr _obj
        mapM_ touchManagedPtr files
        whenJust launch_context touchManagedPtr
        g_list_free files''
        return ()
     ) (do
        g_list_free files''
     )

-- method AppInfo::launch_uris
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "uris", argType = TGList (TBasicType TUTF8), direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "launch_context", argType = TInterface "Gio" "AppLaunchContext", direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "uris", argType = TGList (TBasicType TUTF8), direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "launch_context", argType = TInterface "Gio" "AppLaunchContext", direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : True
-- Skip return : False

foreign import ccall "g_app_info_launch_uris" g_app_info_launch_uris :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    Ptr (GList CString) ->                  -- uris : TGList (TBasicType TUTF8)
    Ptr AppLaunchContext ->                 -- launch_context : TInterface "Gio" "AppLaunchContext"
    Ptr (Ptr GError) ->                     -- error
    IO CInt


appInfoLaunchUris ::
    (MonadIO m, AppInfoK a, AppLaunchContextK b) =>
    a ->                                    -- _obj
    [T.Text] ->                             -- uris
    Maybe (b) ->                            -- launch_context
    m ()
appInfoLaunchUris _obj uris launch_context = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    uris' <- mapM textToCString uris
    uris'' <- packGList uris'
    maybeLaunch_context <- case launch_context of
        Nothing -> return nullPtr
        Just jLaunch_context -> do
            let jLaunch_context' = unsafeManagedPtrCastPtr jLaunch_context
            return jLaunch_context'
    onException (do
        _ <- propagateGError $ g_app_info_launch_uris _obj' uris'' maybeLaunch_context
        touchManagedPtr _obj
        whenJust launch_context touchManagedPtr
        mapGList freeMem uris''
        g_list_free uris''
        return ()
     ) (do
        mapGList freeMem uris''
        g_list_free uris''
     )

-- method AppInfo::remove_supports_type
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "content_type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "content_type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : True
-- Skip return : False

foreign import ccall "g_app_info_remove_supports_type" g_app_info_remove_supports_type :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    CString ->                              -- content_type : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt


appInfoRemoveSupportsType ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    T.Text ->                               -- content_type
    m ()
appInfoRemoveSupportsType _obj content_type = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    content_type' <- textToCString content_type
    onException (do
        _ <- propagateGError $ g_app_info_remove_supports_type _obj' content_type'
        touchManagedPtr _obj
        freeMem content_type'
        return ()
     ) (do
        freeMem content_type'
     )

-- method AppInfo::set_as_default_for_extension
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "extension", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "extension", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : True
-- Skip return : False

foreign import ccall "g_app_info_set_as_default_for_extension" g_app_info_set_as_default_for_extension :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    CString ->                              -- extension : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt


appInfoSetAsDefaultForExtension ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    T.Text ->                               -- extension
    m ()
appInfoSetAsDefaultForExtension _obj extension = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    extension' <- textToCString extension
    onException (do
        _ <- propagateGError $ g_app_info_set_as_default_for_extension _obj' extension'
        touchManagedPtr _obj
        freeMem extension'
        return ()
     ) (do
        freeMem extension'
     )

-- method AppInfo::set_as_default_for_type
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "content_type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "content_type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : True
-- Skip return : False

foreign import ccall "g_app_info_set_as_default_for_type" g_app_info_set_as_default_for_type :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    CString ->                              -- content_type : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt


appInfoSetAsDefaultForType ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    T.Text ->                               -- content_type
    m ()
appInfoSetAsDefaultForType _obj content_type = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    content_type' <- textToCString content_type
    onException (do
        _ <- propagateGError $ g_app_info_set_as_default_for_type _obj' content_type'
        touchManagedPtr _obj
        freeMem content_type'
        return ()
     ) (do
        freeMem content_type'
     )

-- method AppInfo::set_as_last_used_for_type
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "content_type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "content_type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : True
-- Skip return : False

foreign import ccall "g_app_info_set_as_last_used_for_type" g_app_info_set_as_last_used_for_type :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    CString ->                              -- content_type : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt


appInfoSetAsLastUsedForType ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    T.Text ->                               -- content_type
    m ()
appInfoSetAsLastUsedForType _obj content_type = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    content_type' <- textToCString content_type
    onException (do
        _ <- propagateGError $ g_app_info_set_as_last_used_for_type _obj' content_type'
        touchManagedPtr _obj
        freeMem content_type'
        return ()
     ) (do
        freeMem content_type'
     )

-- method AppInfo::should_show
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_should_show" g_app_info_should_show :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    IO CInt


appInfoShouldShow ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    m Bool
appInfoShouldShow _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- g_app_info_should_show _obj'
    let result' = (/= 0) result
    touchManagedPtr _obj
    return result'

-- method AppInfo::supports_files
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_supports_files" g_app_info_supports_files :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    IO CInt


appInfoSupportsFiles ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    m Bool
appInfoSupportsFiles _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- g_app_info_supports_files _obj'
    let result' = (/= 0) result
    touchManagedPtr _obj
    return result'

-- method AppInfo::supports_uris
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gio" "AppInfo", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : False
-- Skip return : False

foreign import ccall "g_app_info_supports_uris" g_app_info_supports_uris :: 
    Ptr AppInfo ->                          -- _obj : TInterface "Gio" "AppInfo"
    IO CInt


appInfoSupportsUris ::
    (MonadIO m, AppInfoK a) =>
    a ->                                    -- _obj
    m Bool
appInfoSupportsUris _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- g_app_info_supports_uris _obj'
    let result' = (/= 0) result
    touchManagedPtr _obj
    return result'