InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ITableStyleSuite Class Referenceabstract

#include <ITableStyleSuite.h>

Inheritance diagram for ITableStyleSuite:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ITABLESTYLESUITE }
 

Public Member Functions

virtual bool16 CanApplyTableStyle (const UID &whichStyle) const =0
 
virtual bool16 AreTableStylesEnabled () const =0
 
virtual bool16 CanGetSelectedRegionalCellStyles () const =0
 
virtual ErrorCode GetSelectedRegionalCellStyles (UIDList &out_SelectedStyles) const =0
 
virtual bool16 CanApplyTableStyle () const =0
 
virtual ErrorCode ApplyTableStyle (const UIDRef &tableStyleRef, const bool16 removeOverrides=kFalse, const bool16 removeCellStyle=kFalse) const =0
 
virtual bool16 CanClearOverrides () const =0
 
virtual ErrorCode ClearLocalOverrides (const bool16 clearCellStyles=kFalse) const =0
 
virtual bool16 CanBreakLinkWithStyle () const =0
 
virtual ErrorCode BreakLinkWithTableStyle () const =0
 
virtual bool16 CanGetTableStyle () const =0
 
virtual ErrorCode GetSelectedTableStyle (UID &out_UID) const =0
 
virtual bool16 CanRedefineTableStyle () const =0
 
virtual bool16 CanClearLocalCellStyleFormatting () const =0
 
virtual ErrorCode RedefineStyle () const =0
 
virtual bool16 CanCreateTableStyle () const =0
 
virtual ErrorCode CreateTableStyle (const UID *parentHier=nil, const int32 position=-1, const UID *basedOn=nil)=0
 
virtual bool16 CanGetOverrides () const =0
 
virtual ErrorCode GetLocalOverrides (AttributeBossList &outLocalOverrides) const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Suite for table styles. To obtain an instance of this suite:
ISelectionManager* selMgr = activeContext->GetContextSelection(); InterfacePtr<ITableStyleSuite> stylesSuite(static_cast<ITableStyleSuite*>(selMgr->QueryIntegratorSuite(IID_ITABLESTYLESUITE, ISelectionManager::kEnabledInterface)));

Member Function Documentation

virtual ErrorCode ITableStyleSuite::ApplyTableStyle (const UIDReftableStyleRef,
const bool16 removeOverrides = kFalse,
const bool16 removeCellStyle = kFalse 
) const
pure virtual

Applies the given table style to the current table selection. If local overrides exist on the current table, they will be deleted if removeOverrides is kTrue, otherwise they will be preserved. If there is no selection that a table style can be applied to, this function will simply set the default table style. If removeCellStyle is true, then all the cell styles on the table will be removed.

Precondition
CanApplyTableStyle returns kTrue
Parameters
tableStyleRef[IN] the table style to apply to the table
removeOverrides[IN] optional, kTrue if the local overrides should be removed from the table, kFalse otherwise
removeCellStyle[IN] optional, flag for removing cell styles from the entire table
Returns
kSuccess if the style was successfully applied to the current table selection, kFailure otherwise
virtual bool16 ITableStyleSuite::AreTableStylesEnabled () const
pure virtual

Checks if table/cell styles are active. This will return kFalse only when there is a text selection that is not within a table.

Returns
kTrue if table styles are enabled, kFalse otherwise
virtual ErrorCode ITableStyleSuite::BreakLinkWithTableStyle () const
pure virtual

Break link with style will take all the table style attributes and apply them as local overrides, if any conflicts arise with existing local overrides, the existing local overrides are preserved. The root table style is then applied.

Precondition
CanBreakLinkWithStyle returns kTrue
Returns
kSuccess if the link between the table and style was successfully broken, kFailure otherwise
virtual bool16 ITableStyleSuite::CanApplyTableStyle (const UIDwhichStyle) const
pure virtual

Overloaded version of this function, this will only set the default cell style if whichStyle is not already the default style, or if the style of the current table selection is not already whichStyle

Parameters
whichStyle[IN] the style to try to apply
Returns
kTrue if applying the style will either change the default style, or change the attributes displayed in the table, kFalse otherwise
virtual bool16 ITableStyleSuite::CanApplyTableStyle () const
pure virtual

Tests if a table style can be applied. If there is no table selection, this will still return true, but "applying" a table style means the default style is set.

Returns
kTrue if a table style can be applied, kFalse otherwise
virtual bool16 ITableStyleSuite::CanBreakLinkWithStyle () const
pure virtual

Tests if we can perform a break link with style. For this to be true, the selection must not use the root table style

Returns
kTrue if a break link with style can be performed, kFalse otherwise
virtual bool16 ITableStyleSuite::CanClearLocalCellStyleFormatting () const
pure virtual

Tests if the selected table has any local cell style formatting anywhere in the table, ie. has a cell style applied other than the root cell style (or kInvalidUID, which is synonymous with the root cell style).

Returns
kTrue if the table has any cell style applied to it other than the root cell style, kFalse otherwise
virtual bool16 ITableStyleSuite::CanClearOverrides () const
pure virtual

Tests if the current table selection has local overrides that can be cleared.

Returns
kTrue if the current table selection has local overrides that can be cleared, kFalse otherwise
virtual bool16 ITableStyleSuite::CanCreateTableStyle () const
pure virtual

Tests if a new table style can be created.

Returns
kTrue if a table style can be created, kFalse otherwise
virtual bool16 ITableStyleSuite::CanGetOverrides () const
pure virtual

Tests if the given table selection has any table overrides.

Returns
kTrue if the current selection has any table overrides, kFalse otherwise
virtual bool16 ITableStyleSuite::CanGetSelectedRegionalCellStyles () const
pure virtual

Checks if there is a table selection such that regional cell styles can be retrieved.

Returns
kTrue if there is a table selection, kFalse otherwise
virtual bool16 ITableStyleSuite::CanGetTableStyle () const
pure virtual

Tests if we can get a table style from the current selection. This function will return kTrue if the current selection is any type of table selection, or if the current selection is a text selection within a table.

Returns
kTrue if a table style can be obtained from the current selection, kFalse otherwise
virtual bool16 ITableStyleSuite::CanRedefineTableStyle () const
pure virtual

Tests the current table style can be redefined. For this to return true, there must be a table selected that has both an editable table style and local overrides.

Returns
kTrue if the "Redefine Table Style" operation is permitted, kFalse otherwise
virtual ErrorCode ITableStyleSuite::ClearLocalOverrides (const bool16 clearCellStyles = kFalse) const
pure virtual

Clears any local table overrides from the current table selection.

Precondition
CanClearOverrides returns kTrue
Parameters
clearCellStyles[IN] optional, set to kTrue to clear all cell style formatting
Returns
kSuccess if the local overrides were cleared, kFailure otherwise
virtual ErrorCode ITableStyleSuite::CreateTableStyle (const UIDparentHier = nil,
const int32 position = -1,
const UIDbasedOn = nil 
)
pure virtual

Creates a new table style.

Precondition
CanCreateTableStyle returns kTrue
Parameters
parentHier[IN] optional, the parent hierarchy for the style
position[IN] optional, the position for the new style within the parent hierarchy
basedOn[IN] optional, the style the new style should be based on, this is only used if there is no table selection
Returns
kSuccess if the table style was created, kFailure otherwise
virtual ErrorCode ITableStyleSuite::GetLocalOverrides (AttributeBossListoutLocalOverrides) const
pure virtual

Gets the local overrides applied to the selected table.

Precondition
CanGetOverrides returns kTrue
Parameters
outLocalOverrides[OUT] the local overrides applied to the selected table
Returns
kSuccess if the overrides were returned, kFailure otherwise
virtual ErrorCode ITableStyleSuite::GetSelectedRegionalCellStyles (UIDListout_SelectedStyles) const
pure virtual

Gets the list of all selected regional cell styles.

Precondition
CanGetSelectedRegionalCellStyles returns kTrue
Parameters
out_SelectedStyles[IN] the cell styles in the selection
Returns
kSuccess if the regional styles were retrieved, kFailure otherwise
virtual ErrorCode ITableStyleSuite::GetSelectedTableStyle (UIDout_UID) const
pure virtual

Gets the table style of the current table selection.

Precondition
CanGetTableStyle returns kTrue
Parameters
out_UID[OUT] the style of the table
Returns
kSuccess if the UID of table's style was successfully placed in out_UID, kFailure otherwise
virtual ErrorCode ITableStyleSuite::RedefineStyle () const
pure virtual

Redefines the table style of the given selection. The style will have the selection's local overrides added to its attributes, with local overrides overwriting any current style attributes.

Precondition
CanRedefineTableStyle returns kTrue
Returns
kSuccess if the table style was redefined, kFailure otherwise