#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.WebKit2.Objects.FileChooserRequest
(
FileChooserRequest(..) ,
IsFileChooserRequest ,
toFileChooserRequest ,
noFileChooserRequest ,
#if ENABLE_OVERLOADING
FileChooserRequestCancelMethodInfo ,
#endif
fileChooserRequestCancel ,
#if ENABLE_OVERLOADING
FileChooserRequestGetMimeTypesMethodInfo,
#endif
fileChooserRequestGetMimeTypes ,
#if ENABLE_OVERLOADING
FileChooserRequestGetMimeTypesFilterMethodInfo,
#endif
fileChooserRequestGetMimeTypesFilter ,
#if ENABLE_OVERLOADING
FileChooserRequestGetSelectMultipleMethodInfo,
#endif
fileChooserRequestGetSelectMultiple ,
#if ENABLE_OVERLOADING
FileChooserRequestGetSelectedFilesMethodInfo,
#endif
fileChooserRequestGetSelectedFiles ,
#if ENABLE_OVERLOADING
FileChooserRequestSelectFilesMethodInfo ,
#endif
fileChooserRequestSelectFiles ,
#if ENABLE_OVERLOADING
FileChooserRequestFilterPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
fileChooserRequestFilter ,
#endif
getFileChooserRequestFilter ,
#if ENABLE_OVERLOADING
FileChooserRequestMimeTypesPropertyInfo ,
#endif
#if ENABLE_OVERLOADING
fileChooserRequestMimeTypes ,
#endif
getFileChooserRequestMimeTypes ,
#if ENABLE_OVERLOADING
FileChooserRequestSelectMultiplePropertyInfo,
#endif
#if ENABLE_OVERLOADING
fileChooserRequestSelectMultiple ,
#endif
getFileChooserRequestSelectMultiple ,
#if ENABLE_OVERLOADING
FileChooserRequestSelectedFilesPropertyInfo,
#endif
#if ENABLE_OVERLOADING
fileChooserRequestSelectedFiles ,
#endif
getFileChooserRequestSelectedFiles ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gtk.Objects.FileFilter as Gtk.FileFilter
newtype FileChooserRequest = FileChooserRequest (ManagedPtr FileChooserRequest)
foreign import ccall "webkit_file_chooser_request_get_type"
c_webkit_file_chooser_request_get_type :: IO GType
instance GObject FileChooserRequest where
gobjectType = c_webkit_file_chooser_request_get_type
class (GObject o, O.IsDescendantOf FileChooserRequest o) => IsFileChooserRequest o
instance (GObject o, O.IsDescendantOf FileChooserRequest o) => IsFileChooserRequest o
instance O.HasParentTypes FileChooserRequest
type instance O.ParentTypes FileChooserRequest = '[GObject.Object.Object]
toFileChooserRequest :: (MonadIO m, IsFileChooserRequest o) => o -> m FileChooserRequest
toFileChooserRequest = liftIO . unsafeCastTo FileChooserRequest
noFileChooserRequest :: Maybe FileChooserRequest
noFileChooserRequest = Nothing
#if ENABLE_OVERLOADING
type family ResolveFileChooserRequestMethod (t :: Symbol) (o :: *) :: * where
ResolveFileChooserRequestMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFileChooserRequestMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFileChooserRequestMethod "cancel" o = FileChooserRequestCancelMethodInfo
ResolveFileChooserRequestMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFileChooserRequestMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFileChooserRequestMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveFileChooserRequestMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFileChooserRequestMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFileChooserRequestMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFileChooserRequestMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFileChooserRequestMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFileChooserRequestMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFileChooserRequestMethod "selectFiles" o = FileChooserRequestSelectFilesMethodInfo
ResolveFileChooserRequestMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFileChooserRequestMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFileChooserRequestMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFileChooserRequestMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFileChooserRequestMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFileChooserRequestMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFileChooserRequestMethod "getMimeTypes" o = FileChooserRequestGetMimeTypesMethodInfo
ResolveFileChooserRequestMethod "getMimeTypesFilter" o = FileChooserRequestGetMimeTypesFilterMethodInfo
ResolveFileChooserRequestMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFileChooserRequestMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFileChooserRequestMethod "getSelectMultiple" o = FileChooserRequestGetSelectMultipleMethodInfo
ResolveFileChooserRequestMethod "getSelectedFiles" o = FileChooserRequestGetSelectedFilesMethodInfo
ResolveFileChooserRequestMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFileChooserRequestMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFileChooserRequestMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFileChooserRequestMethod t FileChooserRequest, O.MethodInfo info FileChooserRequest p) => OL.IsLabel t (FileChooserRequest -> 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
getFileChooserRequestFilter :: (MonadIO m, IsFileChooserRequest o) => o -> m (Maybe Gtk.FileFilter.FileFilter)
getFileChooserRequestFilter obj = liftIO $ B.Properties.getObjectPropertyObject obj "filter" Gtk.FileFilter.FileFilter
#if ENABLE_OVERLOADING
data FileChooserRequestFilterPropertyInfo
instance AttrInfo FileChooserRequestFilterPropertyInfo where
type AttrAllowedOps FileChooserRequestFilterPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileChooserRequestFilterPropertyInfo = (~) ()
type AttrBaseTypeConstraint FileChooserRequestFilterPropertyInfo = IsFileChooserRequest
type AttrGetType FileChooserRequestFilterPropertyInfo = (Maybe Gtk.FileFilter.FileFilter)
type AttrLabel FileChooserRequestFilterPropertyInfo = "filter"
type AttrOrigin FileChooserRequestFilterPropertyInfo = FileChooserRequest
attrGet _ = getFileChooserRequestFilter
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getFileChooserRequestMimeTypes :: (MonadIO m, IsFileChooserRequest o) => o -> m [T.Text]
getFileChooserRequestMimeTypes obj = liftIO $ checkUnexpectedNothing "getFileChooserRequestMimeTypes" $ B.Properties.getObjectPropertyStringArray obj "mime-types"
#if ENABLE_OVERLOADING
data FileChooserRequestMimeTypesPropertyInfo
instance AttrInfo FileChooserRequestMimeTypesPropertyInfo where
type AttrAllowedOps FileChooserRequestMimeTypesPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileChooserRequestMimeTypesPropertyInfo = (~) ()
type AttrBaseTypeConstraint FileChooserRequestMimeTypesPropertyInfo = IsFileChooserRequest
type AttrGetType FileChooserRequestMimeTypesPropertyInfo = [T.Text]
type AttrLabel FileChooserRequestMimeTypesPropertyInfo = "mime-types"
type AttrOrigin FileChooserRequestMimeTypesPropertyInfo = FileChooserRequest
attrGet _ = getFileChooserRequestMimeTypes
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getFileChooserRequestSelectMultiple :: (MonadIO m, IsFileChooserRequest o) => o -> m Bool
getFileChooserRequestSelectMultiple obj = liftIO $ B.Properties.getObjectPropertyBool obj "select-multiple"
#if ENABLE_OVERLOADING
data FileChooserRequestSelectMultiplePropertyInfo
instance AttrInfo FileChooserRequestSelectMultiplePropertyInfo where
type AttrAllowedOps FileChooserRequestSelectMultiplePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint FileChooserRequestSelectMultiplePropertyInfo = (~) ()
type AttrBaseTypeConstraint FileChooserRequestSelectMultiplePropertyInfo = IsFileChooserRequest
type AttrGetType FileChooserRequestSelectMultiplePropertyInfo = Bool
type AttrLabel FileChooserRequestSelectMultiplePropertyInfo = "select-multiple"
type AttrOrigin FileChooserRequestSelectMultiplePropertyInfo = FileChooserRequest
attrGet _ = getFileChooserRequestSelectMultiple
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getFileChooserRequestSelectedFiles :: (MonadIO m, IsFileChooserRequest o) => o -> m (Maybe [T.Text])
getFileChooserRequestSelectedFiles obj = liftIO $ B.Properties.getObjectPropertyStringArray obj "selected-files"
#if ENABLE_OVERLOADING
data FileChooserRequestSelectedFilesPropertyInfo
instance AttrInfo FileChooserRequestSelectedFilesPropertyInfo where
type AttrAllowedOps FileChooserRequestSelectedFilesPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileChooserRequestSelectedFilesPropertyInfo = (~) ()
type AttrBaseTypeConstraint FileChooserRequestSelectedFilesPropertyInfo = IsFileChooserRequest
type AttrGetType FileChooserRequestSelectedFilesPropertyInfo = (Maybe [T.Text])
type AttrLabel FileChooserRequestSelectedFilesPropertyInfo = "selected-files"
type AttrOrigin FileChooserRequestSelectedFilesPropertyInfo = FileChooserRequest
attrGet _ = getFileChooserRequestSelectedFiles
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList FileChooserRequest
type instance O.AttributeList FileChooserRequest = FileChooserRequestAttributeList
type FileChooserRequestAttributeList = ('[ '("filter", FileChooserRequestFilterPropertyInfo), '("mimeTypes", FileChooserRequestMimeTypesPropertyInfo), '("selectMultiple", FileChooserRequestSelectMultiplePropertyInfo), '("selectedFiles", FileChooserRequestSelectedFilesPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
fileChooserRequestFilter :: AttrLabelProxy "filter"
fileChooserRequestFilter = AttrLabelProxy
fileChooserRequestMimeTypes :: AttrLabelProxy "mimeTypes"
fileChooserRequestMimeTypes = AttrLabelProxy
fileChooserRequestSelectMultiple :: AttrLabelProxy "selectMultiple"
fileChooserRequestSelectMultiple = AttrLabelProxy
fileChooserRequestSelectedFiles :: AttrLabelProxy "selectedFiles"
fileChooserRequestSelectedFiles = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList FileChooserRequest = FileChooserRequestSignalList
type FileChooserRequestSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "webkit_file_chooser_request_cancel" webkit_file_chooser_request_cancel ::
Ptr FileChooserRequest ->
IO ()
fileChooserRequestCancel ::
(B.CallStack.HasCallStack, MonadIO m, IsFileChooserRequest a) =>
a
-> m ()
fileChooserRequestCancel request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
webkit_file_chooser_request_cancel request'
touchManagedPtr request
return ()
#if ENABLE_OVERLOADING
data FileChooserRequestCancelMethodInfo
instance (signature ~ (m ()), MonadIO m, IsFileChooserRequest a) => O.MethodInfo FileChooserRequestCancelMethodInfo a signature where
overloadedMethod _ = fileChooserRequestCancel
#endif
foreign import ccall "webkit_file_chooser_request_get_mime_types" webkit_file_chooser_request_get_mime_types ::
Ptr FileChooserRequest ->
IO (Ptr CString)
fileChooserRequestGetMimeTypes ::
(B.CallStack.HasCallStack, MonadIO m, IsFileChooserRequest a) =>
a
-> m [T.Text]
fileChooserRequestGetMimeTypes request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_file_chooser_request_get_mime_types request'
checkUnexpectedReturnNULL "fileChooserRequestGetMimeTypes" result
result' <- unpackZeroTerminatedUTF8CArray result
touchManagedPtr request
return result'
#if ENABLE_OVERLOADING
data FileChooserRequestGetMimeTypesMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsFileChooserRequest a) => O.MethodInfo FileChooserRequestGetMimeTypesMethodInfo a signature where
overloadedMethod _ = fileChooserRequestGetMimeTypes
#endif
foreign import ccall "webkit_file_chooser_request_get_mime_types_filter" webkit_file_chooser_request_get_mime_types_filter ::
Ptr FileChooserRequest ->
IO (Ptr Gtk.FileFilter.FileFilter)
fileChooserRequestGetMimeTypesFilter ::
(B.CallStack.HasCallStack, MonadIO m, IsFileChooserRequest a) =>
a
-> m (Maybe Gtk.FileFilter.FileFilter)
fileChooserRequestGetMimeTypesFilter request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_file_chooser_request_get_mime_types_filter request'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Gtk.FileFilter.FileFilter) result'
return result''
touchManagedPtr request
return maybeResult
#if ENABLE_OVERLOADING
data FileChooserRequestGetMimeTypesFilterMethodInfo
instance (signature ~ (m (Maybe Gtk.FileFilter.FileFilter)), MonadIO m, IsFileChooserRequest a) => O.MethodInfo FileChooserRequestGetMimeTypesFilterMethodInfo a signature where
overloadedMethod _ = fileChooserRequestGetMimeTypesFilter
#endif
foreign import ccall "webkit_file_chooser_request_get_select_multiple" webkit_file_chooser_request_get_select_multiple ::
Ptr FileChooserRequest ->
IO CInt
fileChooserRequestGetSelectMultiple ::
(B.CallStack.HasCallStack, MonadIO m, IsFileChooserRequest a) =>
a
-> m Bool
fileChooserRequestGetSelectMultiple request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_file_chooser_request_get_select_multiple request'
let result' = (/= 0) result
touchManagedPtr request
return result'
#if ENABLE_OVERLOADING
data FileChooserRequestGetSelectMultipleMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFileChooserRequest a) => O.MethodInfo FileChooserRequestGetSelectMultipleMethodInfo a signature where
overloadedMethod _ = fileChooserRequestGetSelectMultiple
#endif
foreign import ccall "webkit_file_chooser_request_get_selected_files" webkit_file_chooser_request_get_selected_files ::
Ptr FileChooserRequest ->
IO (Ptr CString)
fileChooserRequestGetSelectedFiles ::
(B.CallStack.HasCallStack, MonadIO m, IsFileChooserRequest a) =>
a
-> m (Maybe [T.Text])
fileChooserRequestGetSelectedFiles request = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
result <- webkit_file_chooser_request_get_selected_files request'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- unpackZeroTerminatedUTF8CArray result'
return result''
touchManagedPtr request
return maybeResult
#if ENABLE_OVERLOADING
data FileChooserRequestGetSelectedFilesMethodInfo
instance (signature ~ (m (Maybe [T.Text])), MonadIO m, IsFileChooserRequest a) => O.MethodInfo FileChooserRequestGetSelectedFilesMethodInfo a signature where
overloadedMethod _ = fileChooserRequestGetSelectedFiles
#endif
foreign import ccall "webkit_file_chooser_request_select_files" webkit_file_chooser_request_select_files ::
Ptr FileChooserRequest ->
Ptr CString ->
IO ()
fileChooserRequestSelectFiles ::
(B.CallStack.HasCallStack, MonadIO m, IsFileChooserRequest a) =>
a
-> [T.Text]
-> m ()
fileChooserRequestSelectFiles request files = liftIO $ do
request' <- unsafeManagedPtrCastPtr request
files' <- packZeroTerminatedUTF8CArray files
webkit_file_chooser_request_select_files request' files'
touchManagedPtr request
mapZeroTerminatedCArray freeMem files'
freeMem files'
return ()
#if ENABLE_OVERLOADING
data FileChooserRequestSelectFilesMethodInfo
instance (signature ~ ([T.Text] -> m ()), MonadIO m, IsFileChooserRequest a) => O.MethodInfo FileChooserRequestSelectFilesMethodInfo a signature where
overloadedMethod _ = fileChooserRequestSelectFiles
#endif