#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gtk.Structs.FileFilterInfo
(
FileFilterInfo(..) ,
newZeroFileFilterInfo ,
noFileFilterInfo ,
#if ENABLE_OVERLOADING
fileFilterInfo_contains ,
#endif
getFileFilterInfoContains ,
setFileFilterInfoContains ,
clearFileFilterInfoDisplayName ,
#if ENABLE_OVERLOADING
fileFilterInfo_displayName ,
#endif
getFileFilterInfoDisplayName ,
setFileFilterInfoDisplayName ,
clearFileFilterInfoFilename ,
#if ENABLE_OVERLOADING
fileFilterInfo_filename ,
#endif
getFileFilterInfoFilename ,
setFileFilterInfoFilename ,
clearFileFilterInfoMimeType ,
#if ENABLE_OVERLOADING
fileFilterInfo_mimeType ,
#endif
getFileFilterInfoMimeType ,
setFileFilterInfoMimeType ,
clearFileFilterInfoUri ,
#if 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.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)
instance WrappedPtr FileFilterInfo where
wrappedPtrCalloc = callocBytes 40
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 40 >=> wrapPtr FileFilterInfo)
wrappedPtrFree = Just ptr_to_g_free
newZeroFileFilterInfo :: MonadIO m => m FileFilterInfo
newZeroFileFilterInfo = liftIO $ wrappedPtrCalloc >>= wrapPtr FileFilterInfo
instance tag ~ 'AttrSet => Constructible FileFilterInfo tag where
new _ attrs = do
o <- newZeroFileFilterInfo
GI.Attributes.set o attrs
return o
noFileFilterInfo :: Maybe FileFilterInfo
noFileFilterInfo = Nothing
getFileFilterInfoContains :: MonadIO m => FileFilterInfo -> m [Gtk.Flags.FileFilterFlags]
getFileFilterInfoContains s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CUInt
let val' = wordToGFlags val
return val'
setFileFilterInfoContains :: MonadIO m => FileFilterInfo -> [Gtk.Flags.FileFilterFlags] -> m ()
setFileFilterInfoContains s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = gflagsToWord val
poke (ptr `plusPtr` 0) (val' :: CUInt)
#if ENABLE_OVERLOADING
data FileFilterInfoContainsFieldInfo
instance AttrInfo FileFilterInfoContainsFieldInfo where
type AttrAllowedOps FileFilterInfoContainsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint FileFilterInfoContainsFieldInfo = (~) [Gtk.Flags.FileFilterFlags]
type AttrBaseTypeConstraint FileFilterInfoContainsFieldInfo = (~) FileFilterInfo
type AttrGetType FileFilterInfoContainsFieldInfo = [Gtk.Flags.FileFilterFlags]
type AttrLabel FileFilterInfoContainsFieldInfo = "contains"
type AttrOrigin FileFilterInfoContainsFieldInfo = FileFilterInfo
attrGet _ = getFileFilterInfoContains
attrSet _ = setFileFilterInfoContains
attrConstruct = undefined
attrClear _ = undefined
fileFilterInfo_contains :: AttrLabelProxy "contains"
fileFilterInfo_contains = AttrLabelProxy
#endif
getFileFilterInfoFilename :: MonadIO m => FileFilterInfo -> m (Maybe T.Text)
getFileFilterInfoFilename s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setFileFilterInfoFilename :: MonadIO m => FileFilterInfo -> CString -> m ()
setFileFilterInfoFilename s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: CString)
clearFileFilterInfoFilename :: MonadIO m => FileFilterInfo -> m ()
clearFileFilterInfoFilename s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data FileFilterInfoFilenameFieldInfo
instance AttrInfo FileFilterInfoFilenameFieldInfo where
type AttrAllowedOps FileFilterInfoFilenameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileFilterInfoFilenameFieldInfo = (~) CString
type AttrBaseTypeConstraint FileFilterInfoFilenameFieldInfo = (~) FileFilterInfo
type AttrGetType FileFilterInfoFilenameFieldInfo = Maybe T.Text
type AttrLabel FileFilterInfoFilenameFieldInfo = "filename"
type AttrOrigin FileFilterInfoFilenameFieldInfo = FileFilterInfo
attrGet _ = getFileFilterInfoFilename
attrSet _ = setFileFilterInfoFilename
attrConstruct = undefined
attrClear _ = clearFileFilterInfoFilename
fileFilterInfo_filename :: AttrLabelProxy "filename"
fileFilterInfo_filename = AttrLabelProxy
#endif
getFileFilterInfoUri :: MonadIO m => FileFilterInfo -> m (Maybe T.Text)
getFileFilterInfoUri s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setFileFilterInfoUri :: MonadIO m => FileFilterInfo -> CString -> m ()
setFileFilterInfoUri s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: CString)
clearFileFilterInfoUri :: MonadIO m => FileFilterInfo -> m ()
clearFileFilterInfoUri s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data FileFilterInfoUriFieldInfo
instance AttrInfo FileFilterInfoUriFieldInfo where
type AttrAllowedOps FileFilterInfoUriFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileFilterInfoUriFieldInfo = (~) CString
type AttrBaseTypeConstraint FileFilterInfoUriFieldInfo = (~) FileFilterInfo
type AttrGetType FileFilterInfoUriFieldInfo = Maybe T.Text
type AttrLabel FileFilterInfoUriFieldInfo = "uri"
type AttrOrigin FileFilterInfoUriFieldInfo = FileFilterInfo
attrGet _ = getFileFilterInfoUri
attrSet _ = setFileFilterInfoUri
attrConstruct = undefined
attrClear _ = clearFileFilterInfoUri
fileFilterInfo_uri :: AttrLabelProxy "uri"
fileFilterInfo_uri = AttrLabelProxy
#endif
getFileFilterInfoDisplayName :: MonadIO m => FileFilterInfo -> m (Maybe T.Text)
getFileFilterInfoDisplayName s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setFileFilterInfoDisplayName :: MonadIO m => FileFilterInfo -> CString -> m ()
setFileFilterInfoDisplayName s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: CString)
clearFileFilterInfoDisplayName :: MonadIO m => FileFilterInfo -> m ()
clearFileFilterInfoDisplayName s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data FileFilterInfoDisplayNameFieldInfo
instance AttrInfo FileFilterInfoDisplayNameFieldInfo where
type AttrAllowedOps FileFilterInfoDisplayNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileFilterInfoDisplayNameFieldInfo = (~) CString
type AttrBaseTypeConstraint FileFilterInfoDisplayNameFieldInfo = (~) FileFilterInfo
type AttrGetType FileFilterInfoDisplayNameFieldInfo = Maybe T.Text
type AttrLabel FileFilterInfoDisplayNameFieldInfo = "display_name"
type AttrOrigin FileFilterInfoDisplayNameFieldInfo = FileFilterInfo
attrGet _ = getFileFilterInfoDisplayName
attrSet _ = setFileFilterInfoDisplayName
attrConstruct = undefined
attrClear _ = clearFileFilterInfoDisplayName
fileFilterInfo_displayName :: AttrLabelProxy "displayName"
fileFilterInfo_displayName = AttrLabelProxy
#endif
getFileFilterInfoMimeType :: MonadIO m => FileFilterInfo -> m (Maybe T.Text)
getFileFilterInfoMimeType s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setFileFilterInfoMimeType :: MonadIO m => FileFilterInfo -> CString -> m ()
setFileFilterInfoMimeType s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (val :: CString)
clearFileFilterInfoMimeType :: MonadIO m => FileFilterInfo -> m ()
clearFileFilterInfoMimeType s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data FileFilterInfoMimeTypeFieldInfo
instance AttrInfo FileFilterInfoMimeTypeFieldInfo where
type AttrAllowedOps FileFilterInfoMimeTypeFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileFilterInfoMimeTypeFieldInfo = (~) CString
type AttrBaseTypeConstraint FileFilterInfoMimeTypeFieldInfo = (~) FileFilterInfo
type AttrGetType FileFilterInfoMimeTypeFieldInfo = Maybe T.Text
type AttrLabel FileFilterInfoMimeTypeFieldInfo = "mime_type"
type AttrOrigin FileFilterInfoMimeTypeFieldInfo = FileFilterInfo
attrGet _ = getFileFilterInfoMimeType
attrSet _ = setFileFilterInfoMimeType
attrConstruct = undefined
attrClear _ = clearFileFilterInfoMimeType
fileFilterInfo_mimeType :: AttrLabelProxy "mimeType"
fileFilterInfo_mimeType = AttrLabelProxy
#endif
#if 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 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 (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif