module GI.Gio.Objects.NetworkService
(
NetworkService(..) ,
IsNetworkService ,
toNetworkService ,
noNetworkService ,
NetworkServiceGetDomainMethodInfo ,
networkServiceGetDomain ,
NetworkServiceGetProtocolMethodInfo ,
networkServiceGetProtocol ,
NetworkServiceGetSchemeMethodInfo ,
networkServiceGetScheme ,
NetworkServiceGetServiceMethodInfo ,
networkServiceGetService ,
networkServiceNew ,
NetworkServiceSetSchemeMethodInfo ,
networkServiceSetScheme ,
NetworkServiceDomainPropertyInfo ,
constructNetworkServiceDomain ,
getNetworkServiceDomain ,
networkServiceDomain ,
NetworkServiceProtocolPropertyInfo ,
constructNetworkServiceProtocol ,
getNetworkServiceProtocol ,
networkServiceProtocol ,
NetworkServiceSchemePropertyInfo ,
constructNetworkServiceScheme ,
getNetworkServiceScheme ,
networkServiceScheme ,
setNetworkServiceScheme ,
NetworkServiceServicePropertyInfo ,
constructNetworkServiceService ,
getNetworkServiceService ,
networkServiceService ,
) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Interfaces.SocketConnectable as Gio.SocketConnectable
newtype NetworkService = NetworkService (ManagedPtr NetworkService)
foreign import ccall "g_network_service_get_type"
c_g_network_service_get_type :: IO GType
instance GObject NetworkService where
gobjectType _ = c_g_network_service_get_type
class GObject o => IsNetworkService o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError NetworkService a) =>
IsNetworkService a
#endif
instance IsNetworkService NetworkService
instance GObject.Object.IsObject NetworkService
instance Gio.SocketConnectable.IsSocketConnectable NetworkService
toNetworkService :: IsNetworkService o => o -> IO NetworkService
toNetworkService = unsafeCastTo NetworkService
noNetworkService :: Maybe NetworkService
noNetworkService = Nothing
type family ResolveNetworkServiceMethod (t :: Symbol) (o :: *) :: * where
ResolveNetworkServiceMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveNetworkServiceMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveNetworkServiceMethod "enumerate" o = Gio.SocketConnectable.SocketConnectableEnumerateMethodInfo
ResolveNetworkServiceMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveNetworkServiceMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveNetworkServiceMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveNetworkServiceMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveNetworkServiceMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveNetworkServiceMethod "proxyEnumerate" o = Gio.SocketConnectable.SocketConnectableProxyEnumerateMethodInfo
ResolveNetworkServiceMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveNetworkServiceMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveNetworkServiceMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveNetworkServiceMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
ResolveNetworkServiceMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveNetworkServiceMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveNetworkServiceMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveNetworkServiceMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveNetworkServiceMethod "toString" o = Gio.SocketConnectable.SocketConnectableToStringMethodInfo
ResolveNetworkServiceMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveNetworkServiceMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveNetworkServiceMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveNetworkServiceMethod "getDomain" o = NetworkServiceGetDomainMethodInfo
ResolveNetworkServiceMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveNetworkServiceMethod "getProtocol" o = NetworkServiceGetProtocolMethodInfo
ResolveNetworkServiceMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveNetworkServiceMethod "getScheme" o = NetworkServiceGetSchemeMethodInfo
ResolveNetworkServiceMethod "getService" o = NetworkServiceGetServiceMethodInfo
ResolveNetworkServiceMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveNetworkServiceMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveNetworkServiceMethod "setScheme" o = NetworkServiceSetSchemeMethodInfo
ResolveNetworkServiceMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveNetworkServiceMethod t NetworkService, O.MethodInfo info NetworkService p) => O.IsLabelProxy t (NetworkService -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveNetworkServiceMethod t NetworkService, O.MethodInfo info NetworkService p) => O.IsLabel t (NetworkService -> p) where
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
getNetworkServiceDomain :: (MonadIO m, IsNetworkService o) => o -> m T.Text
getNetworkServiceDomain obj = liftIO $ checkUnexpectedNothing "getNetworkServiceDomain" $ getObjectPropertyString obj "domain"
constructNetworkServiceDomain :: (IsNetworkService o) => T.Text -> IO (GValueConstruct o)
constructNetworkServiceDomain val = constructObjectPropertyString "domain" (Just val)
data NetworkServiceDomainPropertyInfo
instance AttrInfo NetworkServiceDomainPropertyInfo where
type AttrAllowedOps NetworkServiceDomainPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint NetworkServiceDomainPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint NetworkServiceDomainPropertyInfo = IsNetworkService
type AttrGetType NetworkServiceDomainPropertyInfo = T.Text
type AttrLabel NetworkServiceDomainPropertyInfo = "domain"
type AttrOrigin NetworkServiceDomainPropertyInfo = NetworkService
attrGet _ = getNetworkServiceDomain
attrSet _ = undefined
attrConstruct _ = constructNetworkServiceDomain
attrClear _ = undefined
getNetworkServiceProtocol :: (MonadIO m, IsNetworkService o) => o -> m T.Text
getNetworkServiceProtocol obj = liftIO $ checkUnexpectedNothing "getNetworkServiceProtocol" $ getObjectPropertyString obj "protocol"
constructNetworkServiceProtocol :: (IsNetworkService o) => T.Text -> IO (GValueConstruct o)
constructNetworkServiceProtocol val = constructObjectPropertyString "protocol" (Just val)
data NetworkServiceProtocolPropertyInfo
instance AttrInfo NetworkServiceProtocolPropertyInfo where
type AttrAllowedOps NetworkServiceProtocolPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint NetworkServiceProtocolPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint NetworkServiceProtocolPropertyInfo = IsNetworkService
type AttrGetType NetworkServiceProtocolPropertyInfo = T.Text
type AttrLabel NetworkServiceProtocolPropertyInfo = "protocol"
type AttrOrigin NetworkServiceProtocolPropertyInfo = NetworkService
attrGet _ = getNetworkServiceProtocol
attrSet _ = undefined
attrConstruct _ = constructNetworkServiceProtocol
attrClear _ = undefined
getNetworkServiceScheme :: (MonadIO m, IsNetworkService o) => o -> m T.Text
getNetworkServiceScheme obj = liftIO $ checkUnexpectedNothing "getNetworkServiceScheme" $ getObjectPropertyString obj "scheme"
setNetworkServiceScheme :: (MonadIO m, IsNetworkService o) => o -> T.Text -> m ()
setNetworkServiceScheme obj val = liftIO $ setObjectPropertyString obj "scheme" (Just val)
constructNetworkServiceScheme :: (IsNetworkService o) => T.Text -> IO (GValueConstruct o)
constructNetworkServiceScheme val = constructObjectPropertyString "scheme" (Just val)
data NetworkServiceSchemePropertyInfo
instance AttrInfo NetworkServiceSchemePropertyInfo where
type AttrAllowedOps NetworkServiceSchemePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint NetworkServiceSchemePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint NetworkServiceSchemePropertyInfo = IsNetworkService
type AttrGetType NetworkServiceSchemePropertyInfo = T.Text
type AttrLabel NetworkServiceSchemePropertyInfo = "scheme"
type AttrOrigin NetworkServiceSchemePropertyInfo = NetworkService
attrGet _ = getNetworkServiceScheme
attrSet _ = setNetworkServiceScheme
attrConstruct _ = constructNetworkServiceScheme
attrClear _ = undefined
getNetworkServiceService :: (MonadIO m, IsNetworkService o) => o -> m T.Text
getNetworkServiceService obj = liftIO $ checkUnexpectedNothing "getNetworkServiceService" $ getObjectPropertyString obj "service"
constructNetworkServiceService :: (IsNetworkService o) => T.Text -> IO (GValueConstruct o)
constructNetworkServiceService val = constructObjectPropertyString "service" (Just val)
data NetworkServiceServicePropertyInfo
instance AttrInfo NetworkServiceServicePropertyInfo where
type AttrAllowedOps NetworkServiceServicePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint NetworkServiceServicePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint NetworkServiceServicePropertyInfo = IsNetworkService
type AttrGetType NetworkServiceServicePropertyInfo = T.Text
type AttrLabel NetworkServiceServicePropertyInfo = "service"
type AttrOrigin NetworkServiceServicePropertyInfo = NetworkService
attrGet _ = getNetworkServiceService
attrSet _ = undefined
attrConstruct _ = constructNetworkServiceService
attrClear _ = undefined
instance O.HasAttributeList NetworkService
type instance O.AttributeList NetworkService = NetworkServiceAttributeList
type NetworkServiceAttributeList = ('[ '("domain", NetworkServiceDomainPropertyInfo), '("protocol", NetworkServiceProtocolPropertyInfo), '("scheme", NetworkServiceSchemePropertyInfo), '("service", NetworkServiceServicePropertyInfo)] :: [(Symbol, *)])
networkServiceDomain :: AttrLabelProxy "domain"
networkServiceDomain = AttrLabelProxy
networkServiceProtocol :: AttrLabelProxy "protocol"
networkServiceProtocol = AttrLabelProxy
networkServiceScheme :: AttrLabelProxy "scheme"
networkServiceScheme = AttrLabelProxy
networkServiceService :: AttrLabelProxy "service"
networkServiceService = AttrLabelProxy
type instance O.SignalList NetworkService = NetworkServiceSignalList
type NetworkServiceSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "g_network_service_new" g_network_service_new ::
CString ->
CString ->
CString ->
IO (Ptr NetworkService)
networkServiceNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> T.Text
-> T.Text
-> m NetworkService
networkServiceNew service protocol domain = liftIO $ do
service' <- textToCString service
protocol' <- textToCString protocol
domain' <- textToCString domain
result <- g_network_service_new service' protocol' domain'
checkUnexpectedReturnNULL "networkServiceNew" result
result' <- (wrapObject NetworkService) result
freeMem service'
freeMem protocol'
freeMem domain'
return result'
foreign import ccall "g_network_service_get_domain" g_network_service_get_domain ::
Ptr NetworkService ->
IO CString
networkServiceGetDomain ::
(B.CallStack.HasCallStack, MonadIO m, IsNetworkService a) =>
a
-> m T.Text
networkServiceGetDomain srv = liftIO $ do
srv' <- unsafeManagedPtrCastPtr srv
result <- g_network_service_get_domain srv'
checkUnexpectedReturnNULL "networkServiceGetDomain" result
result' <- cstringToText result
touchManagedPtr srv
return result'
data NetworkServiceGetDomainMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsNetworkService a) => O.MethodInfo NetworkServiceGetDomainMethodInfo a signature where
overloadedMethod _ = networkServiceGetDomain
foreign import ccall "g_network_service_get_protocol" g_network_service_get_protocol ::
Ptr NetworkService ->
IO CString
networkServiceGetProtocol ::
(B.CallStack.HasCallStack, MonadIO m, IsNetworkService a) =>
a
-> m T.Text
networkServiceGetProtocol srv = liftIO $ do
srv' <- unsafeManagedPtrCastPtr srv
result <- g_network_service_get_protocol srv'
checkUnexpectedReturnNULL "networkServiceGetProtocol" result
result' <- cstringToText result
touchManagedPtr srv
return result'
data NetworkServiceGetProtocolMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsNetworkService a) => O.MethodInfo NetworkServiceGetProtocolMethodInfo a signature where
overloadedMethod _ = networkServiceGetProtocol
foreign import ccall "g_network_service_get_scheme" g_network_service_get_scheme ::
Ptr NetworkService ->
IO CString
networkServiceGetScheme ::
(B.CallStack.HasCallStack, MonadIO m, IsNetworkService a) =>
a
-> m T.Text
networkServiceGetScheme srv = liftIO $ do
srv' <- unsafeManagedPtrCastPtr srv
result <- g_network_service_get_scheme srv'
checkUnexpectedReturnNULL "networkServiceGetScheme" result
result' <- cstringToText result
touchManagedPtr srv
return result'
data NetworkServiceGetSchemeMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsNetworkService a) => O.MethodInfo NetworkServiceGetSchemeMethodInfo a signature where
overloadedMethod _ = networkServiceGetScheme
foreign import ccall "g_network_service_get_service" g_network_service_get_service ::
Ptr NetworkService ->
IO CString
networkServiceGetService ::
(B.CallStack.HasCallStack, MonadIO m, IsNetworkService a) =>
a
-> m T.Text
networkServiceGetService srv = liftIO $ do
srv' <- unsafeManagedPtrCastPtr srv
result <- g_network_service_get_service srv'
checkUnexpectedReturnNULL "networkServiceGetService" result
result' <- cstringToText result
touchManagedPtr srv
return result'
data NetworkServiceGetServiceMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsNetworkService a) => O.MethodInfo NetworkServiceGetServiceMethodInfo a signature where
overloadedMethod _ = networkServiceGetService
foreign import ccall "g_network_service_set_scheme" g_network_service_set_scheme ::
Ptr NetworkService ->
CString ->
IO ()
networkServiceSetScheme ::
(B.CallStack.HasCallStack, MonadIO m, IsNetworkService a) =>
a
-> T.Text
-> m ()
networkServiceSetScheme srv scheme = liftIO $ do
srv' <- unsafeManagedPtrCastPtr srv
scheme' <- textToCString scheme
g_network_service_set_scheme srv' scheme'
touchManagedPtr srv
freeMem scheme'
return ()
data NetworkServiceSetSchemeMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsNetworkService a) => O.MethodInfo NetworkServiceSetSchemeMethodInfo a signature where
overloadedMethod _ = networkServiceSetScheme