Trait fm_plugin::plugin::Plugin[][src]

pub trait Plugin {
    fn id() -> &'static [u8; 4];
fn name() -> &'static str;
fn description() -> &'static str;
fn url() -> &'static str;
fn register_functions() -> Vec<Registration>; fn enable_configure_button() -> bool { ... }
fn enable_init_and_shutdown() -> bool { ... }
fn enable_idle() -> bool { ... }
fn enable_file_and_session_shutdown() -> bool { ... }
fn session_shutdown(_session_id: fmx_ptrtype) { ... }
fn file_shutdown(_session_id: fmx_ptrtype, _file_id: fmx_ptrtype) { ... }
fn preferences() { ... }
fn idle(_session_id: fmx_ptrtype) { ... }
fn not_idle(_session_id: fmx_ptrtype) { ... }
fn script_paused(_session_id: fmx_ptrtype) { ... }
fn script_running(_session_id: fmx_ptrtype) { ... }
fn un_safe(_session_id: fmx_ptrtype) { ... } }

Implement this trait for your plugin struct. The different functions are used to give FileMaker information about the plugin. You also need to register all your functions/script steps in the trait implementation.

Example

struct MyPlugin;

impl Plugin for MyPlugin {
    fn id() -> &'static [u8; 4] { &b"MyPl" }
    fn name() -> &'static str { "MY PLUGIN" }
    fn description() -> &'static str { "Does all sorts of great things." }
    fn url() -> &'static str { "http://myplugin.com" }

    fn register_functions() -> Vec<Registration> {
        vec![Registration::Function {
            id: 100,
            name: "MyPlugin_MyFunction",
            definition: "MyPlugin_MyFunction( arg1 ; arg2 )",
            description: "Does some really great stuff.",
            min_args: 2,
            max_args: 2,
            display_in_dialogs: true,
            compatibility_flags: Compatibility::Future as u32,
            min_ext_version: ExternVersion::V160,
            min_fm_version: "18.0.2",
            allowed_versions: AllowedVersions {developer: true, pro: true, web: true, sase: true, runtime: true},
            function_ptr: Some(MyFunction::extern_func),
            }
        ]
    }
}

Required methods

fn id() -> &'static [u8; 4][src]

Unique 4 letter identifier for the plug-in.

fn name() -> &'static str[src]

Plug-in’s name.

fn description() -> &'static str[src]

Description of the plug-in.

fn url() -> &'static str[src]

Url to send users to from the help in FileMaker. The function’s name that the user will be appended to the url when clicked.

fn register_functions() -> Vec<Registration>[src]

Register all custom functions/script steps

Loading content...

Provided methods

fn enable_configure_button() -> bool[src]

Defaults to false

fn enable_init_and_shutdown() -> bool[src]

Defaults to true

fn enable_idle() -> bool[src]

Defaults to false

fn enable_file_and_session_shutdown() -> bool[src]

Defaults to false

fn session_shutdown(_session_id: fmx_ptrtype)[src]

fn file_shutdown(_session_id: fmx_ptrtype, _file_id: fmx_ptrtype)[src]

fn preferences()[src]

fn idle(_session_id: fmx_ptrtype)[src]

fn not_idle(_session_id: fmx_ptrtype)[src]

fn script_paused(_session_id: fmx_ptrtype)[src]

fn script_running(_session_id: fmx_ptrtype)[src]

fn un_safe(_session_id: fmx_ptrtype)[src]

Loading content...

Implementors

Loading content...