{-# 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 ,
#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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
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 Control.Monad.IO.Class as MIO
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 (SP.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 SP.ManagedPtrNewtype FileFilterInfo where
toManagedPtr :: FileFilterInfo -> ManagedPtr FileFilterInfo
toManagedPtr (FileFilterInfo ManagedPtr FileFilterInfo
p) = ManagedPtr FileFilterInfo
p
instance BoxedPtr FileFilterInfo where
boxedPtrCopy :: FileFilterInfo -> IO FileFilterInfo
boxedPtrCopy = \FileFilterInfo
p -> FileFilterInfo
-> (Ptr FileFilterInfo -> IO FileFilterInfo) -> IO FileFilterInfo
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr FileFilterInfo
p (Int -> Ptr FileFilterInfo -> IO (Ptr FileFilterInfo)
forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
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, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr FileFilterInfo -> FileFilterInfo
FileFilterInfo)
boxedPtrFree :: FileFilterInfo -> IO ()
boxedPtrFree = \FileFilterInfo
x -> FileFilterInfo -> (Ptr FileFilterInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr FileFilterInfo
x Ptr FileFilterInfo -> IO ()
forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr FileFilterInfo where
boxedPtrCalloc :: IO (Ptr FileFilterInfo)
boxedPtrCalloc = Int -> IO (Ptr FileFilterInfo)
forall a. Int -> IO (Ptr a)
callocBytes Int
40
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. CallocPtr a => IO (Ptr a)
boxedPtrCalloc 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, BoxedPtr 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 ManagedPtr FileFilterInfo -> FileFilterInfo
_ [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
getFileFilterInfoContains :: MonadIO m => FileFilterInfo -> m [Gtk.Flags.FileFilterFlags]
getFileFilterInfoContains :: FileFilterInfo -> m [FileFilterFlags]
getFileFilterInfoContains 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 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` Int
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 FileFilterInfo
s [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 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` Int
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 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 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` Int
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
$ \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 FileFilterInfo
s 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 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` Int
8) (CString
val :: CString)
clearFileFilterInfoFilename :: MonadIO m => FileFilterInfo -> m ()
clearFileFilterInfoFilename :: FileFilterInfo -> m ()
clearFileFilterInfoFilename 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 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` Int
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 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 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` Int
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
$ \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 FileFilterInfo
s 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 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` Int
16) (CString
val :: CString)
clearFileFilterInfoUri :: MonadIO m => FileFilterInfo -> m ()
clearFileFilterInfoUri :: FileFilterInfo -> m ()
clearFileFilterInfoUri 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 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` Int
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 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 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` Int
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
$ \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 FileFilterInfo
s 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 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` Int
24) (CString
val :: CString)
clearFileFilterInfoDisplayName :: MonadIO m => FileFilterInfo -> m ()
clearFileFilterInfoDisplayName :: FileFilterInfo -> m ()
clearFileFilterInfoDisplayName 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 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` Int
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 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 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` Int
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
$ \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 FileFilterInfo
s 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 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` Int
32) (CString
val :: CString)
clearFileFilterInfoMimeType :: MonadIO m => FileFilterInfo -> m ()
clearFileFilterInfoMimeType :: FileFilterInfo -> m ()
clearFileFilterInfoMimeType 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 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` Int
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