Callbacks are objects that hold a function, a list of arguments and a trigger event. Callbacks are used to execute GAP code from a remote client using the Trigger Operation.
Callbacks can be added directly to Menus and/or Shapes.
Please see Francy-JS for client implementation.
In this section we show all Francy Callback Categories.
‣ IsCallback( arg ) | ( filter ) |
Returns: true or false
Identifies Callback objects.
‣ IsRequiredArg( arg ) | ( filter ) |
Returns: true or false
Identifies RequiredArg objects.
‣ IsArgType( arg ) | ( filter ) |
Returns: true or false
Identifies ArgType objects.
‣ IsTriggerType( arg ) | ( filter ) |
Returns: true or false
Identifies TriggerType objects.
In this section we show all Francy Callback Families.
In this section we show all Francy Callback Representations.
‣ IsCallbackRep( arg ) | ( filter ) |
Returns: true or false
Checks whether an Object has a Callback internal representation.
‣ IsRequiredArgRep( arg ) | ( filter ) |
Returns: true or false
Checks whether an Object has a RequiredArg internal representation.
‣ IsArgTypeRep( arg ) | ( filter ) |
Returns: true or false
Checks whether an Object has a ArgType internal representation.
‣ IsTriggerTypeRep( arg ) | ( filter ) |
Returns: true or false
Checks whether an Object has a TriggerType internal representation.
In this section we show all Francy Callback Operations.
‣ Callback( IsTriggerType, IsFunction, IsList(object) ) | ( operation ) |
Returns: Callback
Creates a Callback object that holds a function and args to be executed by a trigger based on a trigger type.
Please note, the Function must Return!
Examples:
Create a simple Callback with no arguments:
gap> MyFunction := function() return "Hello World!"; end; gap> callback := Callback(MyFunction); gap> Id(callback);
Create a Callback with one required argument of type string:
gap> MyFunction := function(str) return Concatenation("Hello", " ", str); end; gap> callback := Callback(MyFunction); gap> arg := RequiredArg(ArgType.STRING, "Your Name"); gap> Add(callback, arg);
Create a Callback with one known argument of type string:
gap> MyFunction := function(args) return args; end; gap> callback := Callback(MyFunction, ["Hello World"]);
Create a Callback with one known argument and one required argument of type string:
gap> MyFunction := function(a,b) return Concatenation(a, b); end; gap> callback := Callback(MyFunction, ["Hello "]); gap> arg := RequiredArg(ArgType.STRING, "Your Name"); gap> Add(callback, arg);
Create a Callback with one known argument and one required argument of type string and double click trigger Type:
gap> MyFunction := function(a,b) return Concatenation(a, b); end; gap> callback := Callback(TriggerType.DOUBLE_CLICK, MyFunction, ["Hello "]); gap> arg := RequiredArg(ArgType.STRING, "Your Name"); gap> Add(callback, arg);
In order to see the output of the previous examples, we have to simulate the external call to Trigger operation:
gap> MyFunction := function(a,b) return Concatenation(a, b); end; gap> callback := Callback(TriggerType.DOUBLE_CLICK, MyFunction, ["Hello "]); gap> arg := RequiredArg(ArgType.STRING, "Your Name"); gap> SetTitle(arg, "Enter your name"); gap> Title(arg); gap> Add(callback, arg); gap> SetValue(arg, "Manuel"); # simulate the user input gap> Value(arg); gap> Trigger(GapToJsonString(Sanitize(callback))); # simulate the external trigger
Create a Noop Callback, useful for Menu holders, where no function is required:
gap> callback := NoopCallback();
‣ NoopCallback( ) | ( operation ) |
Returns: Callback
Creates an empty Callback object that does nothing. Useful to create menu holders.
‣ RequiredArg( IsArgType, IsString(title) ) | ( operation ) |
Returns: RequiredArg
Creates a Callback RequiredArg. RequiredArg is user input driven and required for the execution of a Callback This value will be provided by the user.
‣ Trigger( IsString(JSON) ) | ( operation ) |
Returns: the result of the execution of the Callback defined Function
Triggers a callback function in GAP. Gets a JSON String object representation of the callback to execute.
‣ Add( IsCallback[, IsRequiredArg, List(IsRequiredArg)] ) | ( operation ) |
Returns: Callback
Adds a RequiredArg to a specific Callback.
‣ Remove( IsCallback[, IsRequiredArg, List(IsRequiredArg)] ) | ( operation ) |
Returns: Callback
Removes a RequiredArg from a specific callback.
In this section we show the Global Callback Francy Records for multi purpose.
In this section we show the Francy Callback Attributes
‣ Title( arg ) | ( attribute ) |
Returns: IsString with the title of the object
A title on a required arg is used to ask the user what is expected from his input.
‣ Title( arg1 ) | ( operation ) |
‣ SetTitle( IsRequiredArg, IsString ) | ( operation ) |
Sets the title of the required arg.
‣ Value( arg ) | ( attribute ) |
Returns: IsString with the value of the object
A value on a required arg is the actual input to be passed to gap. These values are stored as String for convenience, even if the ArgType specified for the RequiredArg is another. Explicit conversion is required within the Callbackfunction.
‣ Value( arg1 ) | ( operation ) |
‣ SetValue( IsRequiredArg, IsString ) | ( operation ) |
Sets the value of the required arg.
‣ ConfirmMessage( arg ) | ( attribute ) |
Returns: IsString with the message oto be shown to the user prior to the callback execution
This will display a confirmation message before any callback is executed.
‣ ConfirmMessage( arg1 ) | ( operation ) |
‣ SetConfirmMessage( IsRequiredArg, IsString ) | ( operation ) |
Sets the value of the message to display to the user.
generated by GAPDoc2HTML