You are on page 1of 1

CHAPTER 3: Tables Getting started 101

 ICellStyleSuite

 Facade::ICellStylesFacade

 ITableAttrAccessor

 ITableAttributes

 ITableAttrReport

 ITableCommands

 ITableFrame

 ITableFrameList

 ITableLayout

 ITableModel

 ITableSuite

 ITableStyleSuite

 Facade::ITableStylesFacade

Editing table and cell options with ITableSuite


A starting point for writing a plug-in that modifies a table through an active selection is to become familiar
with the ITableSuite interface.

You can obtain the ITableSuite interface for the active selection from the ISelectionUtils interface
aggregated on kUtilsBoss with code like the following:
InterfacePtr<ITableSuite> iTableSuite(static_cast<ITableSuite*>(
Utils<ISelectionUtils>()->QuerySuite(ITableSuite::kDefaultIID)));

Obtaining this interface pointer does not necessarily mean you can exercise the capabilities. Always test
the ITableSuite::Can<DoSomething> method to determine a particular capability is available in the target,
before calling ITableSuite::<DoSomething>.

If there are capabilities that cannot be obtained through this interface—like adding text to a table
cell—but you still want to work with an active selection, use the suite pattern to implement your own
suite. To implement your own suite, you need to write add-ins for the integrator suite boss class and at
least the table suite and text suite boss classes (if modifying an existing table) or the text suite boss class (if
creating a new table in an existing story). Suite implementation code can obtain an ITableModel interface
pointer (effectively, a reference to a kTableModelBoss object) in a straightforward way through
ITableTarget. You can then use the core APIs (like ITableCommands) in addition to ITableModel, to
manipulate the table properties.

If client code needs to work with tables that are chosen programmatically (rather than with tables for
which the end user varies the active selection), you need to program using the APIs exposed on
kTableModelBoss. Your task then is to find a table model (see “Acquiring a table model reference”).

You might also like