pCon.basket - Plugin Development
    Preparing search index...

    Interface ProjectEditor

    The ProjectEditor is the container for all project based plugins like ProjectDataPlugin and ItemListPlugin etc.

    • Plugin category = ProjectEditor
    interface ProjectEditor {
        baseRestrictions: ReadonlySet<UserRestriction>;
        basket: Basket;
        clipboardData: Readonly<ClipboardData> | null;
        editorMode: ProjectEditorMode;
        effectiveRestrictions: ReadonlySet<UserRestriction>;
        eventBaseRestrictionsChanged: ListenableEvent<void, ProjectEditor>;
        eventBeforeSaveProject: AsyncListenableEvent<void, ProjectEditor>;
        eventClipboardDataChanged: ListenableEvent<void, ProjectEditor>;
        eventEffectiveRestrictionsChanged: ListenableEvent<void, ProjectEditor>;
        eventPointOfSaleModeChanged: ListenableEvent<void, ProjectEditor>;
        eventProjectMetaDataChanged: ListenableEvent<void, ProjectEditor>;
        isActive?: boolean;
        itemList: ItemList | null;
        itemLockManager: ItemLockManager;
        itemStatusProvider: ItemStatusProvider | null;
        itemTree: ItemTree | null;
        pointOfSaleMode: boolean;
        projectMetaData: Readonly<ProjectMetaData>;
        userInputHandler: UserInputHandler | null;
        workflow: ProjectWorkflow | null;
        dispose(): Promise<void>;
        getMainMenuActions(): readonly MenuAction[] | null;
        prepareProjectForSaving(): Promise<void>;
        setActive?(pActive: boolean): Promise<void>;
        setClipboardData(pData: ClipboardData | null): void;
        setPointOfSaleMode(pEnabled: boolean): void;
        setProjectMetaData(pData: ProjectMetaData): void;
        showCatalog(): void;
    }

    Hierarchy (View Summary)

    Index
    baseRestrictions: ReadonlySet<UserRestriction>

    Set of base user restrictions of this project editor. The base restrictions are defined by the application and the host of this project editor. Should not be used directly by most plugins. Use effectiveRestrictions instead.

    basket: Basket
    clipboardData: Readonly<ClipboardData> | null

    Current content of the clipboard.

    editorMode: ProjectEditorMode

    Current mode of the editor.

    effectiveRestrictions: ReadonlySet<UserRestriction>

    Set of currently effective restrictions for the current user. The effective restictions are a combination of the baseRestrictions and the current restrictions of the workflow. These restrictions may change during life time of this project editor. Plugins should react to the eventEffectiveRestrictionsChanged event.

    eventBaseRestrictionsChanged: ListenableEvent<void, ProjectEditor>

    Will be triggered every time the baseRestrictions have changed. Should not be used directly by most plugins. Use eventEffectiveRestrictionsChanged instead.

    eventBeforeSaveProject: AsyncListenableEvent<void, ProjectEditor>

    Event which will be called before the project/session will be saved.

    eventClipboardDataChanged: ListenableEvent<void, ProjectEditor>

    Will be triggered every time the clipboardData has changed.

    eventEffectiveRestrictionsChanged: ListenableEvent<void, ProjectEditor>

    Will be triggered every time the effectiveRestrictions have changed.

    eventPointOfSaleModeChanged: ListenableEvent<void, ProjectEditor>

    Will be triggered every time the pointOfSaleMode has changed.

    eventProjectMetaDataChanged: ListenableEvent<void, ProjectEditor>

    Will be triggered every time the projectMetaData has changed.

    isActive?: boolean

    Optional activity state of this component. Initial component state should be inactive (false or undefined).

    itemList: ItemList | null
    itemLockManager: ItemLockManager

    The ItemLockManager is used to lock certain item related operations.

    itemStatusProvider: ItemStatusProvider | null
    itemTree: ItemTree | null
    pointOfSaleMode: boolean

    If true the editor is used at point of sale. Critical information like discounts should be hidden in this case.

    projectMetaData: Readonly<ProjectMetaData>

    Project related meta data which may be used by certain operations (e.g. ordering)

    userInputHandler: UserInputHandler | null

    Instance of the UserInputHandler plugin, if available.

    workflow: ProjectWorkflow | null
    • Called if this instance is no longer in use. Should be used to clean-up resources.

      Returns Promise<void>

    • Will be called everytime the main menu gets opened.

      Returns readonly MenuAction[] | null

    • Should be called before saving the project/session to ensure that all data will be persistet and all pending tasks have been finished. Note: This function calls Application.finishPendingOperations() and therefore should not be called inside a busy section.

      Returns Promise<void>

    • Optional activity state handling for this component. E.g. can be used to disable/enable event handling. Will be set from the component host to activate or deactivate the component. Initial component state should be inactive (false or undefined).

      Parameters

      • pActive: boolean

      Returns Promise<void>

    • Used to fill the clipboard of the editor. Note: null can be used to clear the clipboard.

      Parameters

      Returns void

    • Used to enable/disable point of sale mode

      Parameters

      • pEnabled: boolean

      Returns void

    • Shows the catalog if not already shown.

      Returns void