{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.Gio.Interfaces.TlsServerConnection
    ( 

-- * Exported types
    TlsServerConnection(..)                 ,
    noTlsServerConnection                   ,
    TlsServerConnectionK                    ,
    toTlsServerConnection                   ,


 -- * Properties
-- ** AuthenticationMode
    TlsServerConnectionAuthenticationModePropertyInfo,
    constructTlsServerConnectionAuthenticationMode,
    getTlsServerConnectionAuthenticationMode,
    setTlsServerConnectionAuthenticationMode,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.Gio.Types
import GI.Gio.Callbacks
import qualified GI.GObject as GObject

-- interface TlsServerConnection 

newtype TlsServerConnection = TlsServerConnection (ForeignPtr TlsServerConnection)
noTlsServerConnection :: Maybe TlsServerConnection
noTlsServerConnection = Nothing

-- VVV Prop "authentication-mode"
   -- Type: TInterface "Gio" "TlsAuthenticationMode"
   -- Flags: [PropertyReadable,PropertyWritable]

getTlsServerConnectionAuthenticationMode :: (MonadIO m, TlsServerConnectionK o) => o -> m TlsAuthenticationMode
getTlsServerConnectionAuthenticationMode obj = liftIO $ getObjectPropertyEnum obj "authentication-mode"

setTlsServerConnectionAuthenticationMode :: (MonadIO m, TlsServerConnectionK o) => o -> TlsAuthenticationMode -> m ()
setTlsServerConnectionAuthenticationMode obj val = liftIO $ setObjectPropertyEnum obj "authentication-mode" val

constructTlsServerConnectionAuthenticationMode :: TlsAuthenticationMode -> IO ([Char], GValue)
constructTlsServerConnectionAuthenticationMode val = constructObjectPropertyEnum "authentication-mode" val

data TlsServerConnectionAuthenticationModePropertyInfo
instance AttrInfo TlsServerConnectionAuthenticationModePropertyInfo where
    type AttrAllowedOps TlsServerConnectionAuthenticationModePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint TlsServerConnectionAuthenticationModePropertyInfo = (~) TlsAuthenticationMode
    type AttrBaseTypeConstraint TlsServerConnectionAuthenticationModePropertyInfo = TlsServerConnectionK
    type AttrGetType TlsServerConnectionAuthenticationModePropertyInfo = TlsAuthenticationMode
    type AttrLabel TlsServerConnectionAuthenticationModePropertyInfo = "TlsServerConnection::authentication-mode"
    attrGet _ = getTlsServerConnectionAuthenticationMode
    attrSet _ = setTlsServerConnectionAuthenticationMode
    attrConstruct _ = constructTlsServerConnectionAuthenticationMode

type instance AttributeList TlsServerConnection = TlsServerConnectionAttributeList
type TlsServerConnectionAttributeList = ('[ '("authentication-mode", TlsServerConnectionAuthenticationModePropertyInfo), '("base-io-stream", TlsConnectionBaseIoStreamPropertyInfo), '("certificate", TlsConnectionCertificatePropertyInfo), '("closed", IOStreamClosedPropertyInfo), '("database", TlsConnectionDatabasePropertyInfo), '("input-stream", IOStreamInputStreamPropertyInfo), '("interaction", TlsConnectionInteractionPropertyInfo), '("output-stream", IOStreamOutputStreamPropertyInfo), '("peer-certificate", TlsConnectionPeerCertificatePropertyInfo), '("peer-certificate-errors", TlsConnectionPeerCertificateErrorsPropertyInfo), '("rehandshake-mode", TlsConnectionRehandshakeModePropertyInfo), '("require-close-notify", TlsConnectionRequireCloseNotifyPropertyInfo), '("use-system-certdb", TlsConnectionUseSystemCertdbPropertyInfo)] :: [(Symbol, *)])

type instance SignalList TlsServerConnection = TlsServerConnectionSignalList
type TlsServerConnectionSignalList = ('[ '("accept-certificate", TlsConnectionAcceptCertificateSignalInfo), '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])

foreign import ccall "g_tls_server_connection_get_type"
    c_g_tls_server_connection_get_type :: IO GType

type instance ParentTypes TlsServerConnection = TlsServerConnectionParentTypes
type TlsServerConnectionParentTypes = '[TlsConnection, IOStream, GObject.Object]

instance GObject TlsServerConnection where
    gobjectIsInitiallyUnowned _ = False
    gobjectType _ = c_g_tls_server_connection_get_type
    

class GObject o => TlsServerConnectionK o
instance (GObject o, IsDescendantOf TlsServerConnection o) => TlsServerConnectionK o

toTlsServerConnection :: TlsServerConnectionK o => o -> IO TlsServerConnection
toTlsServerConnection = unsafeCastTo TlsServerConnection