1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/// 事件 Cookie(`AdviseEvents` 返回值)。
pub type EventCookie = i32;
/// Rust 侧建议的事件回调 trait(用户实现,SDK 负责桥接到 COM)
///
/// 对应 `IVGApplicationEvents` 里的方法:
/// ```text
/// 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)
/// ```
// TODO: 由 `windows::Win32::System::Com` 实现 `IDispatch`:
// 在 `Invoke` 里根据 `disp_id` 分发到 `ApplicationEvents` 的方法。
// 然后场 `IvgApplication` 上加:
// pub fn advise_events(&self, sink: &impl ApplicationEvents) -> Option<EventCookie>
// pub fn unadvise_events(&self, cookie: EventCookie) -> bool