IDesignerEntry

Defines the public contract for the DesignerEntry class, exposing methods to bind to a designer entry worksheet, inject a test double for the translation provider, clear user input ranges, translate the worksheet to a given language, read and write info fields on the Main sheet, and translate message codes.

Lifecycle

Configure #

Bind the entry helper to the worksheet hosting designer inputs

Signature:

Public Sub Configure(ByVal hostSheet As Worksheet)

Sets the internal host worksheet reference. Must be called before any other operation. Raises an error when the worksheet is Nothing.

Parameters:

  • hostSheet: Worksheet. The worksheet hosting designer inputs.

UseTranslator #

Swap in a custom translations provider

Signature:

Public Sub UseTranslator(ByVal translator As IDesignerTranslation)

Replaces the internally resolved IDesignerTranslation translator with the supplied instance. Primarily used in tests to inject a stub or mock.

Parameters:

  • translator: IDesignerTranslation. The translations provider to use.

Operations

Clear #

Clear user entry ranges on the configured worksheet

Signature:

Public Sub Clear()

Clears all input ranges on the configured worksheet by resetting their values to empty and setting backgrounds to white. Also clears any warning messages below the RNG_Warning range.


Translate #

Translate the configured worksheet to the provided language

Signature:

Public Sub Translate(Optional ByVal language As String = vbNullString)

Delegates to the translations provider to apply translated labels, shapes, and dropdowns to the configured worksheet. When a non-empty language string is supplied (e.g. "FRA - Francais"), the translator extracts the language code and persists it.

Parameters:

  • language: Optional String. Language string in "CODE - Label" format. Defaults to vbNullString.

AddInfo #

Write a value to a named info range on the host worksheet

Signature:

Public Sub AddInfo(ByVal value As String, ByVal infoName As String)

Resolves the named range matching infoName on the host worksheet, writes the supplied value, and sets the cell background to white. Silently exits when the named range does not exist. Valid infoName values: "edition", "setuppath", "geopath", "lldir", "llname", "setuplang", "temppath", "lllang", "warning".

Parameters:

  • value: String. The value to write (path, message text, etc.).
  • infoName: String. The logical name identifying the target range.

ValueOf #

Read a value from a named info range on the host worksheet

Signature:

Public Property Get ValueOf(ByVal infoName As String) As String

Resolves the named range matching infoName on the host worksheet and returns its current value. Returns vbNullString when the range does not exist.

Parameters:

  • infoName: String. The logical name identifying the source range.

Returns: String. The current value of the named range.


TranslateMessage #

Translate a message code using the designer translations

Signature:

Public Function TranslateMessage(ByVal msgCode As String) As String

Delegates to the internal translations provider to translate a message code (e.g. "MSG_ChemFich") into the current designer language. Returns the raw msgCode when no translation is available.

Parameters:

  • msgCode: String. The message code to translate.

Returns: String. The translated message text.


State

HostSheet #

The worksheet managed by this helper

Signature:

Public Property Get HostSheet() As Worksheet

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

Returns: Worksheet. The host worksheet.