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

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

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

Unique 4 letter identifier for the plug-in.

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

Plug-in's name.

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

Description of the plug-in.

pub 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.

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

Register all custom functions/script steps

Loading content...

Provided methods

pub fn enable_configure_button() -> bool[src]

Defaults to false

pub fn enable_init_and_shutdown() -> bool[src]

Defaults to true

pub fn enable_idle() -> bool[src]

Defaults to false

pub fn enable_file_and_session_shutdown() -> bool[src]

Defaults to false

pub fn session_shutdown(_session_id: fmx_ptrtype)[src]

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

pub fn preferences()[src]

pub fn idle(_session_id: fmx_ptrtype)[src]

pub fn not_idle(_session_id: fmx_ptrtype)[src]

pub fn script_paused(_session_id: fmx_ptrtype)[src]

pub fn script_running(_session_id: fmx_ptrtype)[src]

pub fn un_safe(_session_id: fmx_ptrtype)[src]

Loading content...

Implementors

Loading content...