[−][src]Enum fm_plugin::plugin::Registration
Register ScriptSteps
and Functions
for your plugin.
Function Registration
Registration enables the function so that it appears in the calculation dialog in the application.
id
is the unique id that you can use to represent which function was called, it will be passed back to the registered function as the first parameter (see the parameter of the same name infmx_ExtPluginType
).name
is the name of the function as it should appear in the calculation formula.definition
is the suggested syntax that will appear in the list of functions in the calculation dialog.description
is the text that will display when auto-entered into the calculation dialog. The format is "type ahead word list|description text".min_args
is the number of required parameters for the function.0
is the smallest valid value.max_args
is the maximum number of parameters that they user should be able to specify in the calculation dialog and still have correct syntax usage for the function. Use-1
to allow a variable number of parameters up to the number supported by calculation formulas in the application.compatible_flags
see bit flags above.function_ptr
is the pointer to the function that must match the signature defined byfmx_ExtPluginType
. If you implementFileMakerFunction
for your function, then you can just referenceMyFunction.extern_func
here.
Script Step Registration
Registration::ScriptStep::definition
must contain XML defining the script step options. Up to ten script parameters can be specified in addition to the optional target parameter. All the parameters are defined with <Parameter>
tags in a <PluginStep>
grouping.
The attributes for a <Parameter>
tag include:
-
Type
- if not one of the following four types, the parameter is ignoredCalc
- a standard Specify button that brings up the calculation dialog. When the script step is executed, the calculation will be evaluated and its results passed to the plug-inBool
- simple check box that returns the value of0
or1
List
- a static drop-down or pop-up list in which the id of the item selected is returned. The size limit of this list is limited by the capabilities of the UI widgets used to display it. AList
type parameter expects to contain<Value>
tags as specified belowTarget
- will include a specify button that uses the newInsert From Target
field targeting dialog that allows a developer to put the results of a script step into a field (whether or not it is on a layout), into a variable, or insert into the current active field on a layout. If noTarget
is defined then the resultData
object is ignored. If there are multipleTarget
definitions, only the first one will be honored.
-
ID
- A value in the range of0
to9
which is used as an index into theDataVect
parms object for the plug-in to retrieve the value of the parameter. Indexes that are not in range or duplicated will cause the parameter to be ignored. A parameter of typeTarget
ignores this attribute if specified -
Label
- The name of parameter or control that is displayed in the UI -
DataType
- only used by theCalc
andTarget
parameter types. If not specified or not one of the six data types, the typeText
will be usedText
Number
Date
Time
Timestamp
Container
-
ShowInline
- value is either true or false. If defined and true, will cause the parameter to show up inlined with the script step in the Scripting Workspace -
Default
- either the numeric index of the default list item or the true/false value for a bool item. Ignored for calc and target parameters
Parameters of type List
are expected to contain <Value>
tags whose values are used to construct the drop-down or pop-up list. The id of a value starts at zero but specific id can be given to a value by defining an ID
attribute. If later values do not have an ID
attributes the id will be set to the previous values id plus one.
Sample XML description:
<PluginStep>
<Parameter ID="0" Type="Calc" DataType="text" ShowInline="true" Label="Mood"/>
<Parameter ID="1" Type="List" ShowInline="true" Label="Color">
<Value ID="0">Red</Value>
<Value ID="1">Green</Value>
<Value ID="2">Blue</Value>
</Parameter>
<Parameter ID="2" Type="Bool" Label="Beep when happy"/>
</PluginStep>
Variants
Fields of Function
id: i16
name: &'static str
definition: &'static str
description: &'static str
min_args: i16
max_args: i16
display_in_dialogs: bool
compatibility_flags: u32
min_ext_version: ExternVersion
min_fm_version: &'static str
allowed_versions: AllowedVersions
function_ptr: fmx_ExtPluginType
Fields of ScriptStep
id: i16
name: &'static str
definition: &'static str
description: &'static str
display_in_dialogs: bool
compatibility_flags: u32
min_ext_version: ExternVersion
min_fm_version: &'static str
allowed_versions: AllowedVersions
function_ptr: fmx_ExtPluginType
Implementations
impl Registration
[src]
pub fn register(&self, plugin_id: &QuadChar) -> FMError
[src]
Called automatically by register_plugin!
.
pub fn min_ext_version(&self) -> ExternVersion
[src]
Returns minimum allowed sdk version for a function/script step.
pub fn min_fm_version(&self) -> &str
[src]
Returns minimum allowed FileMaker version for a function/script step.
pub fn is_fm_version_allowed(&self, version: &ApplicationVersion) -> bool
[src]
pub fn unregister(&self, plugin_id: &QuadChar)
[src]
Called automatically by register_plugin!
.
Auto Trait Implementations
impl RefUnwindSafe for Registration
[src]
impl Send for Registration
[src]
impl Sync for Registration
[src]
impl Unpin for Registration
[src]
impl UnwindSafe for Registration
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,