{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Structs.FileFilterInfo
(
FileFilterInfo(..) ,
newZeroFileFilterInfo ,
noFileFilterInfo ,
#if defined(ENABLE_OVERLOADING)
ResolveFileFilterInfoMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
fileFilterInfo_contains ,
#endif
getFileFilterInfoContains ,
setFileFilterInfoContains ,
clearFileFilterInfoDisplayName ,
#if defined(ENABLE_OVERLOADING)
fileFilterInfo_displayName ,
#endif
getFileFilterInfoDisplayName ,
setFileFilterInfoDisplayName ,
clearFileFilterInfoFilename ,
#if defined(ENABLE_OVERLOADING)
fileFilterInfo_filename ,
#endif
getFileFilterInfoFilename ,
setFileFilterInfoFilename ,
clearFileFilterInfoMimeType ,
#if defined(ENABLE_OVERLOADING)
fileFilterInfo_mimeType ,
#endif
getFileFilterInfoMimeType ,
setFileFilterInfoMimeType ,
clearFileFilterInfoUri ,
#if defined(ENABLE_OVERLOADING)
fileFilterInfo_uri ,
#endif
getFileFilterInfoUri ,
setFileFilterInfoUri ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import {-# SOURCE #-} qualified GI.Gtk.Flags as Gtk.Flags
newtype FileFilterInfo = FileFilterInfo (ManagedPtr FileFilterInfo)
deriving (FileFilterInfo -> FileFilterInfo -> Bool
(FileFilterInfo -> FileFilterInfo -> Bool)
-> (FileFilterInfo -> FileFilterInfo -> Bool) -> Eq FileFilterInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FileFilterInfo -> FileFilterInfo -> Bool
$c/= :: FileFilterInfo -> FileFilterInfo -> Bool
== :: FileFilterInfo -> FileFilterInfo -> Bool
$c== :: FileFilterInfo -> FileFilterInfo -> Bool
Eq)
instance WrappedPtr FileFilterInfo where
wrappedPtrCalloc :: IO (Ptr FileFilterInfo)
wrappedPtrCalloc = Int -> IO (Ptr FileFilterInfo)
forall a. Int -> IO (Ptr a)
callocBytes 40
wrappedPtrCopy :: FileFilterInfo -> IO FileFilterInfo
wrappedPtrCopy = \p :: FileFilterInfo
p -> FileFilterInfo
-> (Ptr FileFilterInfo -> IO FileFilterInfo) -> IO FileFilterInfo
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FileFilterInfo
p (Int -> Ptr FileFilterInfo -> IO (Ptr FileFilterInfo)
forall a. WrappedPtr a => Int -> Ptr a -> IO (Ptr a)
copyBytes 40 (Ptr FileFilterInfo -> IO (Ptr FileFilterInfo))
-> (Ptr FileFilterInfo -> IO FileFilterInfo)
-> Ptr FileFilterInfo
-> IO FileFilterInfo
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr FileFilterInfo -> FileFilterInfo)
-> Ptr FileFilterInfo -> IO FileFilterInfo
forall a.
(HasCallStack, WrappedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr FileFilterInfo -> FileFilterInfo
FileFilterInfo)
wrappedPtrFree :: Maybe (GDestroyNotify FileFilterInfo)
wrappedPtrFree = GDestroyNotify FileFilterInfo
-> Maybe (GDestroyNotify FileFilterInfo)
forall a. a -> Maybe a
Just GDestroyNotify FileFilterInfo
forall a. FunPtr (Ptr a -> IO ())
ptr_to_g_free
newZeroFileFilterInfo :: MonadIO m => m FileFilterInfo
newZeroFileFilterInfo :: m FileFilterInfo
newZeroFileFilterInfo = IO FileFilterInfo -> m FileFilterInfo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileFilterInfo -> m FileFilterInfo)
-> IO FileFilterInfo -> m FileFilterInfo
forall a b. (a -> b) -> a -> b
$ IO (Ptr FileFilterInfo)
forall a. WrappedPtr a => IO (Ptr a)
wrappedPtrCalloc IO (Ptr FileFilterInfo)
-> (Ptr FileFilterInfo -> IO FileFilterInfo) -> IO FileFilterInfo
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr FileFilterInfo -> FileFilterInfo)
-> Ptr FileFilterInfo -> IO FileFilterInfo
forall a.
(HasCallStack, WrappedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr FileFilterInfo -> FileFilterInfo
FileFilterInfo
instance tag ~ 'AttrSet => Constructible FileFilterInfo tag where
new :: (ManagedPtr FileFilterInfo -> FileFilterInfo)
-> [AttrOp FileFilterInfo tag] -> m FileFilterInfo
new _ attrs :: [AttrOp FileFilterInfo tag]
attrs = do
FileFilterInfo
o <- m FileFilterInfo
forall (m :: * -> *). MonadIO m => m FileFilterInfo
newZeroFileFilterInfo
FileFilterInfo -> [AttrOp FileFilterInfo 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set FileFilterInfo
o [AttrOp FileFilterInfo tag]
[AttrOp FileFilterInfo 'AttrSet]
attrs
FileFilterInfo -> m FileFilterInfo
forall (m :: * -> *) a. Monad m => a -> m a
return FileFilterInfo
o
noFileFilterInfo :: Maybe FileFilterInfo
noFileFilterInfo :: Maybe FileFilterInfo
noFileFilterInfo = Maybe FileFilterInfo
forall a. Maybe a
Nothing
getFileFilterInfoContains :: MonadIO m => FileFilterInfo -> m [Gtk.Flags.FileFilterFlags]
getFileFilterInfoContains :: FileFilterInfo -> m [FileFilterFlags]
getFileFilterInfoContains s :: FileFilterInfo
s = IO [FileFilterFlags] -> m [FileFilterFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [FileFilterFlags] -> m [FileFilterFlags])
-> IO [FileFilterFlags] -> m [FileFilterFlags]
forall a b. (a -> b) -> a -> b
$ FileFilterInfo
-> (Ptr FileFilterInfo -> IO [FileFilterFlags])
-> IO [FileFilterFlags]
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FileFilterInfo
s ((Ptr FileFilterInfo -> IO [FileFilterFlags])
-> IO [FileFilterFlags])
-> (Ptr FileFilterInfo -> IO [FileFilterFlags])
-> IO [FileFilterFlags]
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr FileFilterInfo
ptr -> do
CUInt
val <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek (Ptr FileFilterInfo
ptr Ptr FileFilterInfo -> Int -> Ptr CUInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0) :: IO CUInt
let val' :: [FileFilterFlags]
val' = CUInt -> [FileFilterFlags]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
val
[FileFilterFlags] -> IO [FileFilterFlags]
forall (m :: * -> *) a. Monad m => a -> m a
return [FileFilterFlags]
val'
setFileFilterInfoContains :: MonadIO m => FileFilterInfo -> [Gtk.Flags.FileFilterFlags] -> m ()
setFileFilterInfoContains :: FileFilterInfo -> [FileFilterFlags] -> m ()
setFileFilterInfoContains s :: FileFilterInfo
s val :: [FileFilterFlags]
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ FileFilterInfo -> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FileFilterInfo
s ((Ptr FileFilterInfo -> IO ()) -> IO ())
-> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr FileFilterInfo
ptr -> do
let val' :: CUInt
val' = [FileFilterFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [FileFilterFlags]
val
Ptr CUInt -> CUInt -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FileFilterInfo
ptr Ptr FileFilterInfo -> Int -> Ptr CUInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0) (CUInt
val' :: CUInt)
#if defined(ENABLE_OVERLOADING)
data FileFilterInfoContainsFieldInfo
instance AttrInfo FileFilterInfoContainsFieldInfo where
type AttrBaseTypeConstraint FileFilterInfoContainsFieldInfo = (~) FileFilterInfo
type AttrAllowedOps FileFilterInfoContainsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint FileFilterInfoContainsFieldInfo = (~) [Gtk.Flags.FileFilterFlags]
type AttrTransferTypeConstraint FileFilterInfoContainsFieldInfo = (~)[Gtk.Flags.FileFilterFlags]
type AttrTransferType FileFilterInfoContainsFieldInfo = [Gtk.Flags.FileFilterFlags]
type AttrGetType FileFilterInfoContainsFieldInfo = [Gtk.Flags.FileFilterFlags]
type AttrLabel FileFilterInfoContainsFieldInfo = "contains"
type AttrOrigin FileFilterInfoContainsFieldInfo = FileFilterInfo
attrGet = getFileFilterInfoContains
attrSet = setFileFilterInfoContains
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
fileFilterInfo_contains :: AttrLabelProxy "contains"
fileFilterInfo_contains = AttrLabelProxy
#endif
getFileFilterInfoFilename :: MonadIO m => FileFilterInfo -> m (Maybe T.Text)
getFileFilterInfoFilename :: FileFilterInfo -> m (Maybe Text)
getFileFilterInfoFilename s :: FileFilterInfo
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ FileFilterInfo
-> (Ptr FileFilterInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FileFilterInfo
s ((Ptr FileFilterInfo -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr FileFilterInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr FileFilterInfo
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr FileFilterInfo
ptr Ptr FileFilterInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \val' :: CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setFileFilterInfoFilename :: MonadIO m => FileFilterInfo -> CString -> m ()
setFileFilterInfoFilename :: FileFilterInfo -> CString -> m ()
setFileFilterInfoFilename s :: FileFilterInfo
s val :: CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ FileFilterInfo -> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FileFilterInfo
s ((Ptr FileFilterInfo -> IO ()) -> IO ())
-> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr FileFilterInfo
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FileFilterInfo
ptr Ptr FileFilterInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8) (CString
val :: CString)
clearFileFilterInfoFilename :: MonadIO m => FileFilterInfo -> m ()
clearFileFilterInfoFilename :: FileFilterInfo -> m ()
clearFileFilterInfoFilename s :: FileFilterInfo
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ FileFilterInfo -> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FileFilterInfo
s ((Ptr FileFilterInfo -> IO ()) -> IO ())
-> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr FileFilterInfo
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FileFilterInfo
ptr Ptr FileFilterInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data FileFilterInfoFilenameFieldInfo
instance AttrInfo FileFilterInfoFilenameFieldInfo where
type AttrBaseTypeConstraint FileFilterInfoFilenameFieldInfo = (~) FileFilterInfo
type AttrAllowedOps FileFilterInfoFilenameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileFilterInfoFilenameFieldInfo = (~) CString
type AttrTransferTypeConstraint FileFilterInfoFilenameFieldInfo = (~)CString
type AttrTransferType FileFilterInfoFilenameFieldInfo = CString
type AttrGetType FileFilterInfoFilenameFieldInfo = Maybe T.Text
type AttrLabel FileFilterInfoFilenameFieldInfo = "filename"
type AttrOrigin FileFilterInfoFilenameFieldInfo = FileFilterInfo
attrGet = getFileFilterInfoFilename
attrSet = setFileFilterInfoFilename
attrConstruct = undefined
attrClear = clearFileFilterInfoFilename
attrTransfer _ v = do
return v
fileFilterInfo_filename :: AttrLabelProxy "filename"
fileFilterInfo_filename = AttrLabelProxy
#endif
getFileFilterInfoUri :: MonadIO m => FileFilterInfo -> m (Maybe T.Text)
getFileFilterInfoUri :: FileFilterInfo -> m (Maybe Text)
getFileFilterInfoUri s :: FileFilterInfo
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ FileFilterInfo
-> (Ptr FileFilterInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FileFilterInfo
s ((Ptr FileFilterInfo -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr FileFilterInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr FileFilterInfo
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr FileFilterInfo
ptr Ptr FileFilterInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \val' :: CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setFileFilterInfoUri :: MonadIO m => FileFilterInfo -> CString -> m ()
setFileFilterInfoUri :: FileFilterInfo -> CString -> m ()
setFileFilterInfoUri s :: FileFilterInfo
s val :: CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ FileFilterInfo -> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FileFilterInfo
s ((Ptr FileFilterInfo -> IO ()) -> IO ())
-> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr FileFilterInfo
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FileFilterInfo
ptr Ptr FileFilterInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16) (CString
val :: CString)
clearFileFilterInfoUri :: MonadIO m => FileFilterInfo -> m ()
clearFileFilterInfoUri :: FileFilterInfo -> m ()
clearFileFilterInfoUri s :: FileFilterInfo
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ FileFilterInfo -> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FileFilterInfo
s ((Ptr FileFilterInfo -> IO ()) -> IO ())
-> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr FileFilterInfo
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FileFilterInfo
ptr Ptr FileFilterInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data FileFilterInfoUriFieldInfo
instance AttrInfo FileFilterInfoUriFieldInfo where
type AttrBaseTypeConstraint FileFilterInfoUriFieldInfo = (~) FileFilterInfo
type AttrAllowedOps FileFilterInfoUriFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileFilterInfoUriFieldInfo = (~) CString
type AttrTransferTypeConstraint FileFilterInfoUriFieldInfo = (~)CString
type AttrTransferType FileFilterInfoUriFieldInfo = CString
type AttrGetType FileFilterInfoUriFieldInfo = Maybe T.Text
type AttrLabel FileFilterInfoUriFieldInfo = "uri"
type AttrOrigin FileFilterInfoUriFieldInfo = FileFilterInfo
attrGet = getFileFilterInfoUri
attrSet = setFileFilterInfoUri
attrConstruct = undefined
attrClear = clearFileFilterInfoUri
attrTransfer _ v = do
return v
fileFilterInfo_uri :: AttrLabelProxy "uri"
fileFilterInfo_uri = AttrLabelProxy
#endif
getFileFilterInfoDisplayName :: MonadIO m => FileFilterInfo -> m (Maybe T.Text)
getFileFilterInfoDisplayName :: FileFilterInfo -> m (Maybe Text)
getFileFilterInfoDisplayName s :: FileFilterInfo
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ FileFilterInfo
-> (Ptr FileFilterInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FileFilterInfo
s ((Ptr FileFilterInfo -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr FileFilterInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr FileFilterInfo
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr FileFilterInfo
ptr Ptr FileFilterInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \val' :: CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setFileFilterInfoDisplayName :: MonadIO m => FileFilterInfo -> CString -> m ()
setFileFilterInfoDisplayName :: FileFilterInfo -> CString -> m ()
setFileFilterInfoDisplayName s :: FileFilterInfo
s val :: CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ FileFilterInfo -> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FileFilterInfo
s ((Ptr FileFilterInfo -> IO ()) -> IO ())
-> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr FileFilterInfo
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FileFilterInfo
ptr Ptr FileFilterInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24) (CString
val :: CString)
clearFileFilterInfoDisplayName :: MonadIO m => FileFilterInfo -> m ()
clearFileFilterInfoDisplayName :: FileFilterInfo -> m ()
clearFileFilterInfoDisplayName s :: FileFilterInfo
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ FileFilterInfo -> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FileFilterInfo
s ((Ptr FileFilterInfo -> IO ()) -> IO ())
-> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr FileFilterInfo
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FileFilterInfo
ptr Ptr FileFilterInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data FileFilterInfoDisplayNameFieldInfo
instance AttrInfo FileFilterInfoDisplayNameFieldInfo where
type AttrBaseTypeConstraint FileFilterInfoDisplayNameFieldInfo = (~) FileFilterInfo
type AttrAllowedOps FileFilterInfoDisplayNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileFilterInfoDisplayNameFieldInfo = (~) CString
type AttrTransferTypeConstraint FileFilterInfoDisplayNameFieldInfo = (~)CString
type AttrTransferType FileFilterInfoDisplayNameFieldInfo = CString
type AttrGetType FileFilterInfoDisplayNameFieldInfo = Maybe T.Text
type AttrLabel FileFilterInfoDisplayNameFieldInfo = "display_name"
type AttrOrigin FileFilterInfoDisplayNameFieldInfo = FileFilterInfo
attrGet = getFileFilterInfoDisplayName
attrSet = setFileFilterInfoDisplayName
attrConstruct = undefined
attrClear = clearFileFilterInfoDisplayName
attrTransfer _ v = do
return v
fileFilterInfo_displayName :: AttrLabelProxy "displayName"
fileFilterInfo_displayName = AttrLabelProxy
#endif
getFileFilterInfoMimeType :: MonadIO m => FileFilterInfo -> m (Maybe T.Text)
getFileFilterInfoMimeType :: FileFilterInfo -> m (Maybe Text)
getFileFilterInfoMimeType s :: FileFilterInfo
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ FileFilterInfo
-> (Ptr FileFilterInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FileFilterInfo
s ((Ptr FileFilterInfo -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr FileFilterInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr FileFilterInfo
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr FileFilterInfo
ptr Ptr FileFilterInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \val' :: CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setFileFilterInfoMimeType :: MonadIO m => FileFilterInfo -> CString -> m ()
setFileFilterInfoMimeType :: FileFilterInfo -> CString -> m ()
setFileFilterInfoMimeType s :: FileFilterInfo
s val :: CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ FileFilterInfo -> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FileFilterInfo
s ((Ptr FileFilterInfo -> IO ()) -> IO ())
-> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr FileFilterInfo
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FileFilterInfo
ptr Ptr FileFilterInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32) (CString
val :: CString)
clearFileFilterInfoMimeType :: MonadIO m => FileFilterInfo -> m ()
clearFileFilterInfoMimeType :: FileFilterInfo -> m ()
clearFileFilterInfoMimeType s :: FileFilterInfo
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ FileFilterInfo -> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FileFilterInfo
s ((Ptr FileFilterInfo -> IO ()) -> IO ())
-> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr FileFilterInfo
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FileFilterInfo
ptr Ptr FileFilterInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data FileFilterInfoMimeTypeFieldInfo
instance AttrInfo FileFilterInfoMimeTypeFieldInfo where
type AttrBaseTypeConstraint FileFilterInfoMimeTypeFieldInfo = (~) FileFilterInfo
type AttrAllowedOps FileFilterInfoMimeTypeFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileFilterInfoMimeTypeFieldInfo = (~) CString
type AttrTransferTypeConstraint FileFilterInfoMimeTypeFieldInfo = (~)CString
type AttrTransferType FileFilterInfoMimeTypeFieldInfo = CString
type AttrGetType FileFilterInfoMimeTypeFieldInfo = Maybe T.Text
type AttrLabel FileFilterInfoMimeTypeFieldInfo = "mime_type"
type AttrOrigin FileFilterInfoMimeTypeFieldInfo = FileFilterInfo
attrGet = getFileFilterInfoMimeType
attrSet = setFileFilterInfoMimeType
attrConstruct = undefined
attrClear = clearFileFilterInfoMimeType
attrTransfer _ v = do
return v
fileFilterInfo_mimeType :: AttrLabelProxy "mimeType"
fileFilterInfo_mimeType = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList FileFilterInfo
type instance O.AttributeList FileFilterInfo = FileFilterInfoAttributeList
type FileFilterInfoAttributeList = ('[ '("contains", FileFilterInfoContainsFieldInfo), '("filename", FileFilterInfoFilenameFieldInfo), '("uri", FileFilterInfoUriFieldInfo), '("displayName", FileFilterInfoDisplayNameFieldInfo), '("mimeType", FileFilterInfoMimeTypeFieldInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveFileFilterInfoMethod (t :: Symbol) (o :: *) :: * where
ResolveFileFilterInfoMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFileFilterInfoMethod t FileFilterInfo, O.MethodInfo info FileFilterInfo p) => OL.IsLabel t (FileFilterInfo -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif