XLL+ Class Library (7.0)

xlpfunctionfilter.h

Overview

xlpfunctionfilter.h contains classes which allow the developer to control which add-in functions are made available to users and which are not. Filtering can be managed on an opt-in basis or an opt-out basis. Filtering can be controlled at development-time (by using a function extension to make entries in the source code) or at run-time (by supplying a configuration file that is loaded by the add-in).

Opt-in
Only functions that have been registered to be published will be made available to the user; all other functions will be suppressed. Adding this option to an existing add-in will suppress all it's add-in functions; the developer must then add some code to register some or all of the functions in the add-in.
Opt-out
All functions will be made available except those which have been chosen to be suppressed. Adding this option to an existing add-in will have no impact. The developer must then add some code to suppress some or all of the functions in the add-in.

The main class, CXllFunctionFilter, maintains a list of functions and a flag which determines whether or not they are to be published.

A pair of simple helper classes, CXllFunctionFilterOptIn and CXllFunctionFilterOptOut, can be used to statically register functions to be published (under an opt-out policy) or suppressed (under an opt-in policy). These classes are used by the code generator of the function extension.

Two function extensions are supplied: FunctionFilterOptIn and FunctionFilterOptOut. These can be used to include and exclude functions via the XLL+ Function Wizard, either singly or en-masse.

A utility class CXllFunctionFilterLoader is used to load and read the configuration file, if a run-time strategy is used.

Finally, three event handling classes provide the wiring that lets all this processing happen without the use of any additional developer-supplied code.

Classes

The table below lists the classes declared in the header file.

Class Description
CXllFunctionFilter A registry of add-in functions, and instructions as to whether they should be published or suppressed.
CXllFunctionFilterOptIn Statically registers a single function to be published.
CXllFunctionFilterOptOut Statically registers a single function to be suppressed.
CXllFunctionFilterLoader Loads a configuration file, and applies the contents to the registry.
CXllFunctionFilterEventHandlerOptIn A static event handler which implements an opt-in policy by running CXllFunctionFilter::Apply(true) during the RegisterFunctions event.
CXllFunctionFilterEventHandlerOptOut A static event handler which implements an opt-out policy by running CXllFunctionFilter::Apply(false) during the RegisterFunctions event.
CXllFunctionFilterEventHandlerFromFile A static event handler that loads and intereprets a configuration file at run-time and applies it during the RegisterFunctions event.

See Also

Publishing and suppressing add-in functions (User Guide)