Skip to main content

ApplicationEvents

Trait ApplicationEvents 

Source
pub trait ApplicationEvents {
    // Provided methods
    fn on_start(&self) { ... }
    fn on_quit(&self) { ... }
    fn on_selection_change(&self) { ... }
    fn on_plugin_command(&self, _command_id: &str) { ... }
    fn on_application_event(&self, _event_name: &str) { ... }
}
Expand description

Rust 侧建议的事件回调 trait(用户实现,SDK 负责桥接到 COM)

对应 IVGApplicationEvents 里的方法:

DocumentOpen(Doc, FileName)
DocumentNew(Doc, FromTemplate, Template, IncludeGraphics)
DocumentClose(Doc)
DocumentBeforeSave(Doc, SaveAs, FileName)
DocumentAfterSave(Doc, SaveAs, FileName)
DocumentBeforePrint(Doc)
DocumentAfterPrint(Doc)
DocumentBeforeExport(Doc, FileName, Filter, SaveBitmap)
DocumentAfterExport(Doc, FileName, Filter, SaveBitmap)
WindowActivate(Doc, Window)
WindowDeactivate(Doc, Window)
SelectionChange()
Start()
Quit()
OnPluginCommand(CommandID)
OnUpdatePluginCommand(CommandID, Enabled, Checked)
OnApplicationEvent(EventName, Parameters)

Provided Methods§

Source

fn on_start(&self)

Source

fn on_quit(&self)

Source

fn on_selection_change(&self)

Source

fn on_plugin_command(&self, _command_id: &str)

Source

fn on_application_event(&self, _event_name: &str)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§