App 事件回调函数

用于处理各种应用事件,例如语言界面变化和工具切换。

{
onAppConvertPDF: (clientData, inPath, outPath) => {
console.log('PDF file conversion successful:', inPath, outPath);
}
}
interface AppEventCallbacksType {
    onAppActivate?: (clientData: LPVOIDType, active: boolean) => void;
    onAppChangedTaskPane?: (clientData: LPVOIDType, name: string) => void;
    onAppMainFrameClientSize?: (clientData: LPVOIDType) => void;
    onAppMainFrameSize?: (clientData: LPVOIDType) => void;
    onAppMainFrmLoadFinish?: (clientData: LPVOIDType) => void;
    onAppOpenDocument?: (clientData: LPVOIDType, filePath: string) => boolean;
    onAppPluginLoaded?: (clientData: LPVOIDType, pluginName: string) => void;
    onAppPluginUnLoaded?: (clientData: LPVOIDType, pluginName: string) => void;
    onAppQuit?: (clientData: LPVOIDType) => void;
    onAppRibbonCategoryBeforeChange?: (
        clientData: LPVOIDType,
        categoryName: string,
    ) => void;
    onAppRibbonCategoryChanged?: (
        clientData: LPVOIDType,
        categoryName: string,
    ) => void;
    onAppShowRibbonFilePage?: (clientData: LPVOIDType) => void;
    onAppShowRibbonFilePageFinish?: (clientData: LPVOIDType) => void;
    onAppShowTaskPane?: (clientData: LPVOIDType, isShow: boolean) => void;
}

Properties

onAppActivate?: (clientData: LPVOIDType, active: boolean) => void

每当应用程序将被激活或停用时调用。

Type declaration

    • (clientData: LPVOIDType, active: boolean): void
    • Parameters

      • clientData: LPVOIDType

        用户提供的数据

      • active: boolean

      Returns void

onAppChangedTaskPane?: (clientData: LPVOIDType, name: string) => void

当任务面板发生变化时由 Foxit Reader 调用。

Type declaration

    • (clientData: LPVOIDType, name: string): void
    • Parameters

      • clientData: LPVOIDType

        用户提供的数据

      • name: string

        发生变化的任务面板名称。

      Returns void

onAppMainFrameClientSize?: (clientData: LPVOIDType) => void

当主框架客户区大小发生变化时由 Foxit Reader 调用。

Type declaration

onAppMainFrameSize?: (clientData: LPVOIDType) => void

当主框架大小发生变化时由 Foxit Reader 调用。

Type declaration

onAppMainFrmLoadFinish?: (clientData: LPVOIDType) => void

当主框架加载完成时由 Foxit Reader 调用。

Type declaration

onAppOpenDocument?: (clientData: LPVOIDType, filePath: string) => boolean

当 Foxit Reader 准备打开文档时会调用此函数。返回 TRUE 表示插件将接管该过程,Foxit Reader 将终止自身的打开流程;否则 Foxit Reader 将继续执行打开流程。

Type declaration

    • (clientData: LPVOIDType, filePath: string): boolean
    • Parameters

      • clientData: LPVOIDType

        用户提供的数据

      • filePath: string

        将要打开的文件路径。

      Returns boolean

      返回 TRUE 表示插件将接管该过程,Foxit Reader 将终止自身的打开流程;否则 Foxit Reader 将继续执行打开流程。

onAppPluginLoaded?: (clientData: LPVOIDType, pluginName: string) => void

当插件被加载时由 Foxit Reader 调用。

Type declaration

    • (clientData: LPVOIDType, pluginName: string): void
    • Parameters

      • clientData: LPVOIDType

        用户提供的数据

      • pluginName: string

        插件名称。

      Returns void

onAppPluginUnLoaded?: (clientData: LPVOIDType, pluginName: string) => void

当插件被加载时由 Foxit Reader 调用。

Type declaration

    • (clientData: LPVOIDType, pluginName: string): void
    • Parameters

      • clientData: LPVOIDType

        用户提供的数据

      • pluginName: string

        插件名称。

      Returns void

onAppQuit?: (clientData: LPVOIDType) => void

它会在关闭时被调用。

Type declaration

onAppRibbonCategoryBeforeChange?: (
    clientData: LPVOIDType,
    categoryName: string,
) => void

当功能区类别即将改变时由 Foxit Reader 调用。

Type declaration

    • (clientData: LPVOIDType, categoryName: string): void
    • Parameters

      • clientData: LPVOIDType

        用户提供的数据

      • categoryName: string

        当前激活的功能区类别名称。

      Returns void

onAppRibbonCategoryChanged?: (
    clientData: LPVOIDType,
    categoryName: string,
) => void

当功能区类别发生变化时由 Foxit Reader 调用。

Type declaration

    • (clientData: LPVOIDType, categoryName: string): void
    • Parameters

      • clientData: LPVOIDType

        用户提供的数据

      • categoryName: string

        当前激活的功能区类别名称。

      Returns void

onAppShowRibbonFilePage?: (clientData: LPVOIDType) => void

当功能区文件页面显示时由 Foxit Reader 调用。

Type declaration

onAppShowRibbonFilePageFinish?: (clientData: LPVOIDType) => void

当功能区文件页面显示完成时由 Foxit Reader 调用。

Type declaration

onAppShowTaskPane?: (clientData: LPVOIDType, isShow: boolean) => void

当任务窗格即将显示时由 Foxit Reader 调用。

Type declaration

    • (clientData: LPVOIDType, isShow: boolean): void
    • Parameters

      • clientData: LPVOIDType

        用户提供的数据

      • isShow: boolean

        任务窗格是否将被显示。

      Returns void