{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Interfaces.TlsFileDatabase
(
TlsFileDatabase(..) ,
noTlsFileDatabase ,
IsTlsFileDatabase ,
toTlsFileDatabase ,
#if defined(ENABLE_OVERLOADING)
ResolveTlsFileDatabaseMethod ,
#endif
tlsFileDatabaseNew ,
#if defined(ENABLE_OVERLOADING)
TlsFileDatabaseAnchorsPropertyInfo ,
#endif
clearTlsFileDatabaseAnchors ,
constructTlsFileDatabaseAnchors ,
getTlsFileDatabaseAnchors ,
setTlsFileDatabaseAnchors ,
#if defined(ENABLE_OVERLOADING)
tlsFileDatabaseAnchors ,
#endif
) 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 qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Objects.TlsDatabase as Gio.TlsDatabase
newtype TlsFileDatabase = TlsFileDatabase (ManagedPtr TlsFileDatabase)
deriving (TlsFileDatabase -> TlsFileDatabase -> Bool
(TlsFileDatabase -> TlsFileDatabase -> Bool)
-> (TlsFileDatabase -> TlsFileDatabase -> Bool)
-> Eq TlsFileDatabase
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TlsFileDatabase -> TlsFileDatabase -> Bool
$c/= :: TlsFileDatabase -> TlsFileDatabase -> Bool
== :: TlsFileDatabase -> TlsFileDatabase -> Bool
$c== :: TlsFileDatabase -> TlsFileDatabase -> Bool
Eq)
noTlsFileDatabase :: Maybe TlsFileDatabase
noTlsFileDatabase :: Maybe TlsFileDatabase
noTlsFileDatabase = Maybe TlsFileDatabase
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList TlsFileDatabase = TlsFileDatabaseSignalList
type TlsFileDatabaseSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_tls_file_database_get_type"
c_g_tls_file_database_get_type :: IO GType
instance GObject TlsFileDatabase where
gobjectType :: IO GType
gobjectType = IO GType
c_g_tls_file_database_get_type
instance B.GValue.IsGValue TlsFileDatabase where
toGValue :: TlsFileDatabase -> IO GValue
toGValue o :: TlsFileDatabase
o = do
GType
gtype <- IO GType
c_g_tls_file_database_get_type
TlsFileDatabase -> (Ptr TlsFileDatabase -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr TlsFileDatabase
o (GType
-> (GValue -> Ptr TlsFileDatabase -> IO ())
-> Ptr TlsFileDatabase
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr TlsFileDatabase -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO TlsFileDatabase
fromGValue gv :: GValue
gv = do
Ptr TlsFileDatabase
ptr <- GValue -> IO (Ptr TlsFileDatabase)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr TlsFileDatabase)
(ManagedPtr TlsFileDatabase -> TlsFileDatabase)
-> Ptr TlsFileDatabase -> IO TlsFileDatabase
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr TlsFileDatabase -> TlsFileDatabase
TlsFileDatabase Ptr TlsFileDatabase
ptr
class (GObject o, O.IsDescendantOf TlsFileDatabase o) => IsTlsFileDatabase o
instance (GObject o, O.IsDescendantOf TlsFileDatabase o) => IsTlsFileDatabase o
instance O.HasParentTypes TlsFileDatabase
type instance O.ParentTypes TlsFileDatabase = '[GObject.Object.Object, Gio.TlsDatabase.TlsDatabase]
toTlsFileDatabase :: (MonadIO m, IsTlsFileDatabase o) => o -> m TlsFileDatabase
toTlsFileDatabase :: o -> m TlsFileDatabase
toTlsFileDatabase = IO TlsFileDatabase -> m TlsFileDatabase
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TlsFileDatabase -> m TlsFileDatabase)
-> (o -> IO TlsFileDatabase) -> o -> m TlsFileDatabase
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr TlsFileDatabase -> TlsFileDatabase)
-> o -> IO TlsFileDatabase
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr TlsFileDatabase -> TlsFileDatabase
TlsFileDatabase
getTlsFileDatabaseAnchors :: (MonadIO m, IsTlsFileDatabase o) => o -> m (Maybe T.Text)
getTlsFileDatabaseAnchors :: o -> m (Maybe Text)
getTlsFileDatabaseAnchors obj :: o
obj = 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
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj "anchors"
setTlsFileDatabaseAnchors :: (MonadIO m, IsTlsFileDatabase o) => o -> T.Text -> m ()
setTlsFileDatabaseAnchors :: o -> Text -> m ()
setTlsFileDatabaseAnchors obj :: o
obj val :: Text
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj "anchors" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
constructTlsFileDatabaseAnchors :: (IsTlsFileDatabase o) => T.Text -> IO (GValueConstruct o)
constructTlsFileDatabaseAnchors :: Text -> IO (GValueConstruct o)
constructTlsFileDatabaseAnchors val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString "anchors" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
clearTlsFileDatabaseAnchors :: (MonadIO m, IsTlsFileDatabase o) => o -> m ()
clearTlsFileDatabaseAnchors :: o -> m ()
clearTlsFileDatabaseAnchors obj :: o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj "anchors" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)
#if defined(ENABLE_OVERLOADING)
data TlsFileDatabaseAnchorsPropertyInfo
instance AttrInfo TlsFileDatabaseAnchorsPropertyInfo where
type AttrAllowedOps TlsFileDatabaseAnchorsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint TlsFileDatabaseAnchorsPropertyInfo = IsTlsFileDatabase
type AttrSetTypeConstraint TlsFileDatabaseAnchorsPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint TlsFileDatabaseAnchorsPropertyInfo = (~) T.Text
type AttrTransferType TlsFileDatabaseAnchorsPropertyInfo = T.Text
type AttrGetType TlsFileDatabaseAnchorsPropertyInfo = (Maybe T.Text)
type AttrLabel TlsFileDatabaseAnchorsPropertyInfo = "anchors"
type AttrOrigin TlsFileDatabaseAnchorsPropertyInfo = TlsFileDatabase
attrGet = getTlsFileDatabaseAnchors
attrSet = setTlsFileDatabaseAnchors
attrTransfer _ v = do
return v
attrConstruct = constructTlsFileDatabaseAnchors
attrClear = clearTlsFileDatabaseAnchors
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList TlsFileDatabase
type instance O.AttributeList TlsFileDatabase = TlsFileDatabaseAttributeList
type TlsFileDatabaseAttributeList = ('[ '("anchors", TlsFileDatabaseAnchorsPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
tlsFileDatabaseAnchors :: AttrLabelProxy "anchors"
tlsFileDatabaseAnchors = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveTlsFileDatabaseMethod (t :: Symbol) (o :: *) :: * where
ResolveTlsFileDatabaseMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveTlsFileDatabaseMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveTlsFileDatabaseMethod "createCertificateHandle" o = Gio.TlsDatabase.TlsDatabaseCreateCertificateHandleMethodInfo
ResolveTlsFileDatabaseMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveTlsFileDatabaseMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveTlsFileDatabaseMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveTlsFileDatabaseMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveTlsFileDatabaseMethod "lookupCertificateForHandle" o = Gio.TlsDatabase.TlsDatabaseLookupCertificateForHandleMethodInfo
ResolveTlsFileDatabaseMethod "lookupCertificateForHandleAsync" o = Gio.TlsDatabase.TlsDatabaseLookupCertificateForHandleAsyncMethodInfo
ResolveTlsFileDatabaseMethod "lookupCertificateForHandleFinish" o = Gio.TlsDatabase.TlsDatabaseLookupCertificateForHandleFinishMethodInfo
ResolveTlsFileDatabaseMethod "lookupCertificateIssuer" o = Gio.TlsDatabase.TlsDatabaseLookupCertificateIssuerMethodInfo
ResolveTlsFileDatabaseMethod "lookupCertificateIssuerAsync" o = Gio.TlsDatabase.TlsDatabaseLookupCertificateIssuerAsyncMethodInfo
ResolveTlsFileDatabaseMethod "lookupCertificateIssuerFinish" o = Gio.TlsDatabase.TlsDatabaseLookupCertificateIssuerFinishMethodInfo
ResolveTlsFileDatabaseMethod "lookupCertificatesIssuedBy" o = Gio.TlsDatabase.TlsDatabaseLookupCertificatesIssuedByMethodInfo
ResolveTlsFileDatabaseMethod "lookupCertificatesIssuedByAsync" o = Gio.TlsDatabase.TlsDatabaseLookupCertificatesIssuedByAsyncMethodInfo
ResolveTlsFileDatabaseMethod "lookupCertificatesIssuedByFinish" o = Gio.TlsDatabase.TlsDatabaseLookupCertificatesIssuedByFinishMethodInfo
ResolveTlsFileDatabaseMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveTlsFileDatabaseMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveTlsFileDatabaseMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveTlsFileDatabaseMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveTlsFileDatabaseMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveTlsFileDatabaseMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveTlsFileDatabaseMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveTlsFileDatabaseMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveTlsFileDatabaseMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveTlsFileDatabaseMethod "verifyChain" o = Gio.TlsDatabase.TlsDatabaseVerifyChainMethodInfo
ResolveTlsFileDatabaseMethod "verifyChainAsync" o = Gio.TlsDatabase.TlsDatabaseVerifyChainAsyncMethodInfo
ResolveTlsFileDatabaseMethod "verifyChainFinish" o = Gio.TlsDatabase.TlsDatabaseVerifyChainFinishMethodInfo
ResolveTlsFileDatabaseMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveTlsFileDatabaseMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveTlsFileDatabaseMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveTlsFileDatabaseMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveTlsFileDatabaseMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveTlsFileDatabaseMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveTlsFileDatabaseMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveTlsFileDatabaseMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTlsFileDatabaseMethod t TlsFileDatabase, O.MethodInfo info TlsFileDatabase p) => OL.IsLabel t (TlsFileDatabase -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
foreign import ccall "g_tls_file_database_new" g_tls_file_database_new ::
CString ->
Ptr (Ptr GError) ->
IO (Ptr TlsFileDatabase)
tlsFileDatabaseNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Char]
-> m TlsFileDatabase
tlsFileDatabaseNew :: String -> m TlsFileDatabase
tlsFileDatabaseNew anchors :: String
anchors = IO TlsFileDatabase -> m TlsFileDatabase
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TlsFileDatabase -> m TlsFileDatabase)
-> IO TlsFileDatabase -> m TlsFileDatabase
forall a b. (a -> b) -> a -> b
$ do
CString
anchors' <- String -> IO CString
stringToCString String
anchors
IO TlsFileDatabase -> IO () -> IO TlsFileDatabase
forall a b. IO a -> IO b -> IO a
onException (do
Ptr TlsFileDatabase
result <- (Ptr (Ptr GError) -> IO (Ptr TlsFileDatabase))
-> IO (Ptr TlsFileDatabase)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr TlsFileDatabase))
-> IO (Ptr TlsFileDatabase))
-> (Ptr (Ptr GError) -> IO (Ptr TlsFileDatabase))
-> IO (Ptr TlsFileDatabase)
forall a b. (a -> b) -> a -> b
$ CString -> Ptr (Ptr GError) -> IO (Ptr TlsFileDatabase)
g_tls_file_database_new CString
anchors'
Text -> Ptr TlsFileDatabase -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "tlsFileDatabaseNew" Ptr TlsFileDatabase
result
TlsFileDatabase
result' <- ((ManagedPtr TlsFileDatabase -> TlsFileDatabase)
-> Ptr TlsFileDatabase -> IO TlsFileDatabase
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr TlsFileDatabase -> TlsFileDatabase
TlsFileDatabase) Ptr TlsFileDatabase
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
anchors'
TlsFileDatabase -> IO TlsFileDatabase
forall (m :: * -> *) a. Monad m => a -> m a
return TlsFileDatabase
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
anchors'
)
#if defined(ENABLE_OVERLOADING)
#endif