IDesignerPreparation

Defines the public contract for the DesignerPreparation class, exposing methods to bind to a designer workbook, run full preparation tasks (import translations, create dropdown lists, hide worksheets, seed HiddenNames flags, apply T_Multi validations), and persist or read ribbon checkbox flags through workbook-level hidden names.

Lifecycle

Configure #

Bind the preparation helper to a designer workbook

Signature:

Public Sub Configure(ByVal hostBook As Workbook)

Sets the internal host workbook reference and resets any previously cached hidden names store. Must be called before any other operation.

Parameters:

  • hostBook: Workbook. The designer workbook to prepare.

Prepare #

Execute all preparation tasks on the designer workbook

Signature:

Public Sub Prepare(ByRef devManager As IDevelopment)

Runs the full preparation sequence: prompts the user to select a translations workbook via OSFiles, imports translation tables into LinelistTranslation and DesignerTranslation sheets, creates a dropdown worksheet with standard dropdown lists (setup languages, interface languages, epiweek start, design values), hides internal worksheets (VeryHidden for __pass/__formatter/__formula/__dropdowns, Hidden for translation sheets), ensures workbook- and worksheet-level HiddenNames flags, applies data validation to the T_Multi table on the GenerateMultiple worksheet, and registers hidden sheets with the development manager.

Parameters:

  • devManager: IDevelopment. ByRef development manager instance, or Nothing.

Settings

SetFlag #

Persist a ribbon checkbox flag as a hidden name

Signature:

Public Sub SetFlag(ByVal nameId As String, ByVal enabled As Boolean)

Stores a boolean value as "Yes" or "No" in the workbook-level hidden names store, identified by the supplied name. Ensures the store and default flags exist before writing.

Parameters:

  • nameId: String. The hidden name identifier for the flag.
  • enabled: Boolean. True to store "Yes", False to store "No".

GetFlag #

Read a ribbon checkbox flag from hidden names

Signature:

Public Function GetFlag(ByVal nameId As String, Optional ByVal defaultValue As Boolean = False) As Boolean

Reads the named value from the hidden names store and returns True when the stored value equals "Yes" (case-insensitive). Falls back to the defaultValue when the name does not exist.

Parameters:

  • nameId: String. The hidden name identifier for the flag.
  • defaultValue: Optional Boolean. Value returned when the flag is missing. Defaults to False.

Returns: Boolean. True when the stored value is "Yes".


State

HostWorkbook #

The configured host workbook

Signature:

Public Property Get HostWorkbook() As Workbook

Returns the designer workbook that was bound via Configure. Raises an error when accessed before configuration.

Returns: Workbook. The host workbook.


HiddenStore #

The hidden names store used for designer settings

Signature:

Public Property Get HiddenStore() As IHiddenNames

Returns the workbook-level IHiddenNames instance used to persist ribbon flags. The store is lazily initialised on first access from the host workbook.

Returns: IHiddenNames. The hidden names manager.


The dropdown manager created during preparation

Signature:

Public Property Get Dropdowns() As IDropdownLists

Returns the IDropdownLists manager bound to the designer dropdown worksheet. Lazily initialises the manager on first access if it was not already created by Prepare.

Returns: IDropdownLists. The dropdown manager instance.