gi-nm-1.0.1: NM bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.NM.Callbacks

Description

 
Synopsis

Signals

KeyfileReadHandler

type C_KeyfileReadHandler = Ptr KeyFile -> Ptr Connection -> CUInt -> Ptr KeyfileHandlerData -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type KeyfileReadHandler Source #

Arguments

 = KeyFile

keyfile: the KeyFile that is currently read

-> Connection

connection: the Connection that is being constructed.

-> KeyfileHandlerType

handlerType: the NMKeyfileHandlerType that indicates which type the request is.

-> KeyfileHandlerData

handlerData: the KeyfileHandlerData. What you can do with it depends on the handlerType.

-> IO Bool

Returns: the callee should return TRUE, if the event was handled and/or recognized. Otherwise, a default action will be performed that depends on the type. For KeyfileHandlerTypeWarn type, the default action is doing nothing.

Hook to keyfileRead.

The callee may abort the reading by setting an error via keyfileHandlerDataFailWithError.

Since: 1.30

type KeyfileReadHandler_WithClosures Source #

Arguments

 = KeyFile

keyfile: the KeyFile that is currently read

-> Connection

connection: the Connection that is being constructed.

-> KeyfileHandlerType

handlerType: the NMKeyfileHandlerType that indicates which type the request is.

-> KeyfileHandlerData

handlerData: the KeyfileHandlerData. What you can do with it depends on the handlerType.

-> Ptr ()

userData: the user-data argument to keyfileRead.

-> IO Bool

Returns: the callee should return TRUE, if the event was handled and/or recognized. Otherwise, a default action will be performed that depends on the type. For KeyfileHandlerTypeWarn type, the default action is doing nothing.

Hook to keyfileRead.

The callee may abort the reading by setting an error via keyfileHandlerDataFailWithError.

Since: 1.30

drop_closures_KeyfileReadHandler :: KeyfileReadHandler -> KeyfileReadHandler_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_KeyfileReadHandler Source #

Arguments

:: (HasCallStack, MonadIO m, IsConnection a) 
=> FunPtr C_KeyfileReadHandler 
-> KeyFile

keyfile: the KeyFile that is currently read

-> a

connection: the Connection that is being constructed.

-> KeyfileHandlerType

handlerType: the NMKeyfileHandlerType that indicates which type the request is.

-> KeyfileHandlerData

handlerData: the KeyfileHandlerData. What you can do with it depends on the handlerType.

-> Ptr ()

userData: the user-data argument to keyfileRead.

-> m Bool

Returns: the callee should return TRUE, if the event was handled and/or recognized. Otherwise, a default action will be performed that depends on the type. For KeyfileHandlerTypeWarn type, the default action is doing nothing.

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_KeyfileReadHandler :: C_KeyfileReadHandler -> IO (FunPtr C_KeyfileReadHandler) Source #

Generate a function pointer callable from C code, from a C_KeyfileReadHandler.

KeyfileWriteHandler

type C_KeyfileWriteHandler = Ptr Connection -> Ptr KeyFile -> CUInt -> Ptr KeyfileHandlerData -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type KeyfileWriteHandler Source #

Arguments

 = Connection

connection: the Connection that is currently written.

-> KeyFile

keyfile: the KeyFile that is currently constructed.

-> KeyfileHandlerType

handlerType: the NMKeyfileHandlerType that indicates which type the request is.

-> KeyfileHandlerData

handlerData: the KeyfileHandlerData. What you can do with it depends on the handlerType.

-> IO Bool

Returns: the callee should return True if the event was handled. If the event was unhandled, a default action will be performed that depends on the handlerType.

This is a hook to tweak the serialization.

Handler for certain properties or events that are not entirely contained within the keyfile or that might be serialized differently. The type and handlerData arguments tell which kind of argument we have at hand.

Currently only the type KeyfileHandlerTypeWriteCert is supported.

The callee may call keyfileHandlerDataFailWithError to abort the writing with error.

Since: 1.30

type KeyfileWriteHandler_WithClosures Source #

Arguments

 = Connection

connection: the Connection that is currently written.

-> KeyFile

keyfile: the KeyFile that is currently constructed.

-> KeyfileHandlerType

handlerType: the NMKeyfileHandlerType that indicates which type the request is.

-> KeyfileHandlerData

handlerData: the KeyfileHandlerData. What you can do with it depends on the handlerType.

-> Ptr ()

userData: the user-data argument to keyfileRead.

-> IO Bool

Returns: the callee should return True if the event was handled. If the event was unhandled, a default action will be performed that depends on the handlerType.

This is a hook to tweak the serialization.

Handler for certain properties or events that are not entirely contained within the keyfile or that might be serialized differently. The type and handlerData arguments tell which kind of argument we have at hand.

Currently only the type KeyfileHandlerTypeWriteCert is supported.

The callee may call keyfileHandlerDataFailWithError to abort the writing with error.

Since: 1.30

drop_closures_KeyfileWriteHandler :: KeyfileWriteHandler -> KeyfileWriteHandler_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_KeyfileWriteHandler Source #

Arguments

:: (HasCallStack, MonadIO m, IsConnection a) 
=> FunPtr C_KeyfileWriteHandler 
-> a

connection: the Connection that is currently written.

-> KeyFile

keyfile: the KeyFile that is currently constructed.

-> KeyfileHandlerType

handlerType: the NMKeyfileHandlerType that indicates which type the request is.

-> KeyfileHandlerData

handlerData: the KeyfileHandlerData. What you can do with it depends on the handlerType.

-> Ptr ()

userData: the user-data argument to keyfileRead.

-> m Bool

Returns: the callee should return True if the event was handled. If the event was unhandled, a default action will be performed that depends on the handlerType.

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_KeyfileWriteHandler :: C_KeyfileWriteHandler -> IO (FunPtr C_KeyfileWriteHandler) Source #

Generate a function pointer callable from C code, from a C_KeyfileWriteHandler.

SecretAgentOldDeleteSecretsFunc

type C_SecretAgentOldDeleteSecretsFunc = Ptr SecretAgentOld -> Ptr Connection -> Ptr GError -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type SecretAgentOldDeleteSecretsFunc Source #

Arguments

 = SecretAgentOld

agent: the secret agent object

-> Connection

connection: the connection for which secrets were to be deleted, note that this object will be unrefed after the callback has returned, use objectRef/objectUnref if you want to use this object after the callback has returned

-> GError

error: if the deleting secrets failed, give a descriptive error here

-> IO () 

Called as a result of a request by NM to delete secrets. When the SecretAgentOld subclass has finished deleting the secrets, this function should be called.

type SecretAgentOldDeleteSecretsFunc_WithClosures Source #

Arguments

 = SecretAgentOld

agent: the secret agent object

-> Connection

connection: the connection for which secrets were to be deleted, note that this object will be unrefed after the callback has returned, use objectRef/objectUnref if you want to use this object after the callback has returned

-> GError

error: if the deleting secrets failed, give a descriptive error here

-> Ptr ()

userData: caller-specific data to be passed to the function

-> IO () 

Called as a result of a request by NM to delete secrets. When the SecretAgentOld subclass has finished deleting the secrets, this function should be called.

dynamic_SecretAgentOldDeleteSecretsFunc Source #

Arguments

:: (HasCallStack, MonadIO m, IsSecretAgentOld a, IsConnection b) 
=> FunPtr C_SecretAgentOldDeleteSecretsFunc 
-> a

agent: the secret agent object

-> b

connection: the connection for which secrets were to be deleted, note that this object will be unrefed after the callback has returned, use objectRef/objectUnref if you want to use this object after the callback has returned

-> GError

error: if the deleting secrets failed, give a descriptive error here

-> Ptr ()

userData: caller-specific data to be passed to the function

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

SecretAgentOldGetSecretsFunc

type C_SecretAgentOldGetSecretsFunc = Ptr SecretAgentOld -> Ptr Connection -> Ptr GVariant -> Ptr GError -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type SecretAgentOldGetSecretsFunc Source #

Arguments

 = SecretAgentOld

agent: the secret agent object

-> Connection

connection: the connection for which secrets were requested, note that this object will be unrefed after the callback has returned, use objectRef/objectUnref if you want to use this object after the callback has returned

-> GVariant

secrets: the GVariant of type NM_VARIANT_TYPE_CONNECTION containing the requested secrets (as created by connectionToDbus for example). Each key in secrets should be the name of a Setting object (like "802-11-wireless-security") and each value should be an NM_VARIANT_TYPE_SETTING variant. The sub-dicts map string:value, where the string is the setting property name (like "psk") and the value is the secret

-> GError

error: if the secrets request failed, give a descriptive error here

-> IO () 

Called as a result of a request by NM to retrieve secrets. When the SecretAgentOld subclass has finished retrieving secrets and is ready to return them, or to return an error, this function should be called with those secrets or the error.

To easily create the dictionary to return the Wi-Fi PSK, you could do something like this: <example> <title>Creating a secrets dictionary</title> <programlisting> NMConnection *secrets; NMSettingWirelessSecurity *s_wsec; GVariant *secrets_dict;

secrets = nm_simple_connection_new (); s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); g_object_set (G_OBJECT (s_wsec), NM_SETTING_WIRELESS_SECURITY_PSK, "my really cool PSK", NULL); nm_connection_add_setting (secrets, NM_SETTING (s_wsec)); secrets_dict = nm_connection_to_dbus (secrets, NM_CONNECTION_SERIALIZE_ALL);

(call the NMSecretAgentOldGetSecretsFunc with secrets_dict)

g_object_unref (secrets); g_variant_unref (secrets_dict); </programlisting> </example>

type SecretAgentOldGetSecretsFunc_WithClosures Source #

Arguments

 = SecretAgentOld

agent: the secret agent object

-> Connection

connection: the connection for which secrets were requested, note that this object will be unrefed after the callback has returned, use objectRef/objectUnref if you want to use this object after the callback has returned

-> GVariant

secrets: the GVariant of type NM_VARIANT_TYPE_CONNECTION containing the requested secrets (as created by connectionToDbus for example). Each key in secrets should be the name of a Setting object (like "802-11-wireless-security") and each value should be an NM_VARIANT_TYPE_SETTING variant. The sub-dicts map string:value, where the string is the setting property name (like "psk") and the value is the secret

-> GError

error: if the secrets request failed, give a descriptive error here

-> Ptr ()

userData: caller-specific data to be passed to the function

-> IO () 

Called as a result of a request by NM to retrieve secrets. When the SecretAgentOld subclass has finished retrieving secrets and is ready to return them, or to return an error, this function should be called with those secrets or the error.

To easily create the dictionary to return the Wi-Fi PSK, you could do something like this: <example> <title>Creating a secrets dictionary</title> <programlisting> NMConnection *secrets; NMSettingWirelessSecurity *s_wsec; GVariant *secrets_dict;

secrets = nm_simple_connection_new (); s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); g_object_set (G_OBJECT (s_wsec), NM_SETTING_WIRELESS_SECURITY_PSK, "my really cool PSK", NULL); nm_connection_add_setting (secrets, NM_SETTING (s_wsec)); secrets_dict = nm_connection_to_dbus (secrets, NM_CONNECTION_SERIALIZE_ALL);

(call the NMSecretAgentOldGetSecretsFunc with secrets_dict)

g_object_unref (secrets); g_variant_unref (secrets_dict); </programlisting> </example>

dynamic_SecretAgentOldGetSecretsFunc Source #

Arguments

:: (HasCallStack, MonadIO m, IsSecretAgentOld a, IsConnection b) 
=> FunPtr C_SecretAgentOldGetSecretsFunc 
-> a

agent: the secret agent object

-> b

connection: the connection for which secrets were requested, note that this object will be unrefed after the callback has returned, use objectRef/objectUnref if you want to use this object after the callback has returned

-> GVariant

secrets: the GVariant of type NM_VARIANT_TYPE_CONNECTION containing the requested secrets (as created by connectionToDbus for example). Each key in secrets should be the name of a Setting object (like "802-11-wireless-security") and each value should be an NM_VARIANT_TYPE_SETTING variant. The sub-dicts map string:value, where the string is the setting property name (like "psk") and the value is the secret

-> GError

error: if the secrets request failed, give a descriptive error here

-> Ptr ()

userData: caller-specific data to be passed to the function

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

SecretAgentOldSaveSecretsFunc

type C_SecretAgentOldSaveSecretsFunc = Ptr SecretAgentOld -> Ptr Connection -> Ptr GError -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type SecretAgentOldSaveSecretsFunc Source #

Arguments

 = SecretAgentOld

agent: the secret agent object

-> Connection

connection: the connection for which secrets were to be saved, note that this object will be unrefed after the callback has returned, use objectRef/objectUnref if you want to use this object after the callback has returned

-> GError

error: if the saving secrets failed, give a descriptive error here

-> IO () 

Called as a result of a request by NM to save secrets. When the SecretAgentOld subclass has finished saving the secrets, this function should be called.

type SecretAgentOldSaveSecretsFunc_WithClosures Source #

Arguments

 = SecretAgentOld

agent: the secret agent object

-> Connection

connection: the connection for which secrets were to be saved, note that this object will be unrefed after the callback has returned, use objectRef/objectUnref if you want to use this object after the callback has returned

-> GError

error: if the saving secrets failed, give a descriptive error here

-> Ptr ()

userData: caller-specific data to be passed to the function

-> IO () 

Called as a result of a request by NM to save secrets. When the SecretAgentOld subclass has finished saving the secrets, this function should be called.

dynamic_SecretAgentOldSaveSecretsFunc Source #

Arguments

:: (HasCallStack, MonadIO m, IsSecretAgentOld a, IsConnection b) 
=> FunPtr C_SecretAgentOldSaveSecretsFunc 
-> a

agent: the secret agent object

-> b

connection: the connection for which secrets were to be saved, note that this object will be unrefed after the callback has returned, use objectRef/objectUnref if you want to use this object after the callback has returned

-> GError

error: if the saving secrets failed, give a descriptive error here

-> Ptr ()

userData: caller-specific data to be passed to the function

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

SettingClearSecretsWithFlagsFn

type C_SettingClearSecretsWithFlagsFn = Ptr Setting -> CString -> CUInt -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type SettingClearSecretsWithFlagsFn Source #

Arguments

 = Setting

setting: The setting for which secrets are being iterated

-> Text

secret: The secret's name

-> [SettingSecretFlags]

flags: The secret's flags, eg SettingSecretFlagsAgentOwned

-> IO Bool

Returns: True to clear the secret, False to not clear the secret

No description available in the introspection data.

type SettingClearSecretsWithFlagsFn_WithClosures Source #

Arguments

 = Setting

setting: The setting for which secrets are being iterated

-> Text

secret: The secret's name

-> [SettingSecretFlags]

flags: The secret's flags, eg SettingSecretFlagsAgentOwned

-> Ptr ()

userData: User data passed to connectionClearSecretsWithFlags

-> IO Bool

Returns: True to clear the secret, False to not clear the secret

No description available in the introspection data.

dynamic_SettingClearSecretsWithFlagsFn Source #

Arguments

:: (HasCallStack, MonadIO m, IsSetting a) 
=> FunPtr C_SettingClearSecretsWithFlagsFn 
-> a

setting: The setting for which secrets are being iterated

-> Text

secret: The secret's name

-> [SettingSecretFlags]

flags: The secret's flags, eg SettingSecretFlagsAgentOwned

-> Ptr ()

userData: User data passed to connectionClearSecretsWithFlags

-> m Bool

Returns: True to clear the secret, False to not clear the secret

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

SettingValueIterFn

type C_SettingValueIterFn = Ptr Setting -> CString -> Ptr GValue -> CUInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type SettingValueIterFn Source #

Arguments

 = Setting

setting: The setting for which properties are being iterated, given to settingEnumerateValues

-> Text

key: The value/property name

-> GValue

value: The property's value

-> [ParamFlags]

flags: The property's flags, like SETTING_PARAM_SECRET

-> IO () 

No description available in the introspection data.

type SettingValueIterFn_WithClosures Source #

Arguments

 = Setting

setting: The setting for which properties are being iterated, given to settingEnumerateValues

-> Text

key: The value/property name

-> GValue

value: The property's value

-> [ParamFlags]

flags: The property's flags, like SETTING_PARAM_SECRET

-> Ptr ()

userData: User data passed to settingEnumerateValues

-> IO () 

No description available in the introspection data.

drop_closures_SettingValueIterFn :: SettingValueIterFn -> SettingValueIterFn_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_SettingValueIterFn Source #

Arguments

:: (HasCallStack, MonadIO m, IsSetting a) 
=> FunPtr C_SettingValueIterFn 
-> a

setting: The setting for which properties are being iterated, given to settingEnumerateValues

-> Text

key: The value/property name

-> GValue

value: The property's value

-> [ParamFlags]

flags: The property's flags, like SETTING_PARAM_SECRET

-> Ptr ()

userData: User data passed to settingEnumerateValues

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_SettingValueIterFn :: C_SettingValueIterFn -> IO (FunPtr C_SettingValueIterFn) Source #

Generate a function pointer callable from C code, from a C_SettingValueIterFn.

UtilsCheckFilePredicate

type C_UtilsCheckFilePredicate = CString -> Ptr () -> Ptr () -> Ptr (Ptr GError) -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type UtilsCheckFilePredicate Source #

Arguments

 = Text 
-> Ptr () 
-> IO ()

(Can throw GError)

No description available in the introspection data.

type UtilsCheckFilePredicate_WithClosures Source #

Arguments

 = Text 
-> Ptr () 
-> Ptr () 
-> IO ()

(Can throw GError)

No description available in the introspection data.

dynamic_UtilsCheckFilePredicate Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_UtilsCheckFilePredicate 
-> Text 
-> Ptr () 
-> Ptr () 
-> m ()

(Can throw GError)

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

UtilsFileSearchInPathsPredicate

type C_UtilsFileSearchInPathsPredicate = CString -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type UtilsFileSearchInPathsPredicate = Text -> IO Bool Source #

No description available in the introspection data.

type UtilsFileSearchInPathsPredicate_WithClosures = Text -> Ptr () -> IO Bool Source #

No description available in the introspection data.

dynamic_UtilsFileSearchInPathsPredicate :: (HasCallStack, MonadIO m) => FunPtr C_UtilsFileSearchInPathsPredicate -> Text -> Ptr () -> m Bool Source #

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

UtilsPredicateStr

type C_UtilsPredicateStr = CString -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type UtilsPredicateStr Source #

Arguments

 = Text

str: the name to check.

-> IO Bool

Returns: True if the predicate function matches.

This function takes a string argument and returns either True or False. It is a general purpose predicate, for example used by settingOptionClearByName.

Since: 1.26

dynamic_UtilsPredicateStr Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_UtilsPredicateStr 
-> Text

str: the name to check.

-> m Bool

Returns: True if the predicate function matches.

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_UtilsPredicateStr :: C_UtilsPredicateStr -> IO (FunPtr C_UtilsPredicateStr) Source #

Generate a function pointer callable from C code, from a C_UtilsPredicateStr.

VpnIterFunc

type C_VpnIterFunc = CString -> CString -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type VpnIterFunc Source #

Arguments

 = Text

key: the name of the data or secret item

-> Text

value: the value of the data or secret item

-> IO () 

No description available in the introspection data.

type VpnIterFunc_WithClosures Source #

Arguments

 = Text

key: the name of the data or secret item

-> Text

value: the value of the data or secret item

-> Ptr ()

userData: User data passed to settingVpnForeachDataItem or settingVpnForeachSecret

-> IO () 

No description available in the introspection data.

drop_closures_VpnIterFunc :: VpnIterFunc -> VpnIterFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_VpnIterFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_VpnIterFunc 
-> Text

key: the name of the data or secret item

-> Text

value: the value of the data or secret item

-> Ptr ()

userData: User data passed to settingVpnForeachDataItem or settingVpnForeachSecret

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

mk_VpnIterFunc :: C_VpnIterFunc -> IO (FunPtr C_VpnIterFunc) Source #

Generate a function pointer callable from C code, from a C_VpnIterFunc.