Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AdaptationManager

Hierarchy

  • AdaptationManager

Index

Constructors

constructor

Properties

Private currentPolicy

currentPolicy: TargetPolicy

Current target policy.

Private currentStyle

currentStyle: AdaptationStyle

Current adaptation style.

Private dataManager

dataManager: DataManager

Data manager of the library.

Private menuManager

menuManager: MenuManager

Menu manager of the library.

Methods

applyCurrentAdaptation

  • applyCurrentAdaptation(): void

cancelCurrentAdaptation

  • cancelCurrentAdaptation(): void

getCurrentPolicyName

  • getCurrentPolicyName(): string

getCurrentStyleName

  • getCurrentStyleName(): string

Private restoreAdaptationFromDatabaseOrSetDefault

  • restoreAdaptationFromDatabaseOrSetDefault(): void
  • Set the adaptation style and policy to the last ones which has been in use, or to the default ones if no previous ones are found.

    Returns void

Private restorePolicyFromDatabaseOrSetDefault

  • restorePolicyFromDatabaseOrSetDefault(): void
  • Set the target policy to the last one which has been in use, or to the default policy if no previous policy is found.

    Returns void

Private restoreStyleFromDatabaseOrSetDefault

  • restoreStyleFromDatabaseOrSetDefault(): void
  • Set the adaptation style to the last one which has been in use, or to the default style if no previous style is found.

    Returns void

Private setDefaultPolicy

  • setDefaultPolicy(): void

Private setDefaultStyle

  • setDefaultStyle(): void

Private setPolicy

  • setPolicy(name: string): void
  • Set the current target policy. If the name does not match any policy, the policy is not updated.

    Parameters

    • name: string

      The name of the new policy.

    Returns void

Private setStyle

  • setStyle(name: string): void
  • Set the current adaptation style. If the name does not match any style, the style is not updated.

    Parameters

    • name: string

      The name of the new style.

    Returns void

switchToAdaptation

  • switchToAdaptation(styleName: string, policyName: string): void
  • Cancel any existing adaptation, switch to the given style and policy, and update all adapted menus accordingly.

    Parameters

    • styleName: string

      The name of the new style.

    • policyName: string

      The name of the new policy.

    Returns void

switchToPolicy

  • switchToPolicy(name: string): void
  • Cancel any existing adaptation, switch to the given taget policy, and update all adapted menus accordingly.

    Parameters

    • name: string

      The name of the new policy.

    Returns void

switchToStyle

  • switchToStyle(name: string): void
  • Cancel any existing adaptation, switch to the given adaptation style, and update all adapted menus accordingly.

    Parameters

    • name: string

      The name of the new style.

    Returns void

updateCurrentAdaptation

  • updateCurrentAdaptation(): void
  • Successively cancel and re-apply the current adaptation to update it.

    This method can be used for manual update of the adapted menus, e.g. on a single-page website where items only act as anchor links or script triggers.

    Returns void

Generated using TypeDoc