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

#include <ICellStyleSuite.h>

Inheritance diagram for ICellStyleSuite:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ICELLSTYLESUITE }
 

Public Member Functions

virtual bool16 CanCreateCellStyle () const =0
 
virtual ErrorCode CreateCellStyle (const UID *parentHier=nil, const int32 position=-1, const UID *basedOn=nil)=0
 
virtual bool16 CanBreakLinkWithCellStyle () const =0
 
virtual ErrorCode BreakLinkWithCellStyle () const =0
 
virtual bool16 CanApplyCellStyle () const =0
 
virtual bool16 CanApplyCellStyle (const UID &whichStyle) const =0
 
virtual ErrorCode ApplyCellStyle (const UIDRef &cellStyle, const bool16 removeOverrides=kFalse) const =0
 
virtual ErrorCode ApplyCellStyleAndClearAllFormatting (const UIDRef &cellStyle) const =0
 
virtual bool16 CanGetCellStyle () const =0
 
virtual ErrorCode GetSelectedCellStyles (UIDList &out_SelectedStyles) const =0
 
virtual bool16 CanGetOverridingParagraphStyles () const =0
 
virtual ErrorCode GetOverridingParagraphStyles (UIDList &out_OverridingParaStyles) const =0
 
virtual bool16 CanRedefineCellStyle () const =0
 
virtual ErrorCode RedefineCellStyle () const =0
 
virtual bool16 CanClearOverrides (const UIDRef &styleToCheck=UIDRef::gNull) const =0
 
virtual bool16 CanClearAllOverrides () const =0
 
virtual ErrorCode ClearAllOverrides () const =0
 
virtual ErrorCode ClearOverrides () const =0
 
virtual ErrorCode GetLocalOverrides (AttributeBossList &outLocalOverrides, bool16 *out_IsMixed=nil) const =0
 
virtual bool16 CanGetCellStyleOverrides () const =0
 
virtual bool16 CanGetAllOverrides () const =0
 
virtual ErrorCode GetAllOverrides (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 cell styles. To obtain an instance of this suite:
ISelectionManager* selMgr = activeContext->GetContextSelection();
InterfacePtr<ICellStyleSuite> stylesSuite(static_cast<ICellStyleSuite*>(selMgr->QueryIntegratorSuite(IID_ICELLSTYLESUITE, ISelectionManager::kEnabledInterface)));

Member Function Documentation

virtual ErrorCode ICellStyleSuite::ApplyCellStyle (const UIDRefcellStyle,
const bool16 removeOverrides = kFalse 
) const
pure virtual

Applies the given cell style to the current cell selection. If local overrides exist on any of the cells in the selection they will be removed if removeOverrides is kTrue. If there is no table selection, the default style is set to cellStyle and the removeOverrides parameter is ignored.

Precondition
CanApplyCellStyle returns kTrue
Parameters
cellStyle[IN] the cell style to apply to the cell selection
removeOverrides[IN] optional, kTrue if the local overrides should be removed from the cell, kFalse otherwise
Returns
kSuccess if the style was successfully applied, kFailure otherwise
virtual ErrorCode ICellStyleSuite::ApplyCellStyleAndClearAllFormatting (const UIDRefcellStyle) const
pure virtual

Applies the given cell style and clears out any overrides in the selected area.

Precondition
CanApplyCellStyle returns kTrue
CanGetAllOverrides returns kTrue
Parameters
cellStyle[IN] the cell style to apply to the cell selection
Returns
kSuccess if the style was successfully applied, kFailure otherwise
virtual ErrorCode ICellStyleSuite::BreakLinkWithCellStyle () const
pure virtual

Breaks the link with the cell style for the currently selected cell area. Any cell style attributes are applied as local overrides. If there are any conflicts between the style attributes and local overrides, the local overrides always win. The root style is applied to all selected cells.

Precondition
CanBreakLinkWithCellStyle returns kTrue
Returns
kSuccess if the link between the cells and style was successfully broken, kFailure otherwise
virtual bool16 ICellStyleSuite::CanApplyCellStyle () const
pure virtual

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

Returns
kTrue if a cell style can be applied, kFalse otherwise
virtual bool16 ICellStyleSuite::CanApplyCellStyle (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 applying the cell style will change the appearance of the selection.

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 ICellStyleSuite::CanBreakLinkWithCellStyle () const
pure virtual

Tests if the current selection supports the "Break Link with Style" action. For this to be true, there must be a table selection, or a text selection within a table, and the style of that cell selection must not be the root cell style.

Returns
kTrue if the break link with style command is available, kFalse otherwise
virtual bool16 ICellStyleSuite::CanClearAllOverrides () const
pure virtual

Tests if there are any cell overrides that can be cleared on the given selection.

Returns
kTrue if there are any cell overrides on the current selection
virtual bool16 ICellStyleSuite::CanClearOverrides (const UIDRefstyleToCheck = UIDRef::gNull) const
pure virtual

Tests if we can clear overrides. For this to return kTrue, a cell or cells must be selected that have local overrides that conflict with the style's definition or any override when the style is the root cell style.

Parameters
styleToCheck[IN] optional if we apply this style, are there overrides of this style on the selected style that can be cleared? If set to its default, UIDRef::gNull, we check against the style currently applied to the selection.
Returns
kTrue if the "Clear Cell Overrides" operation is permitted, kFalse otherwise
virtual bool16 ICellStyleSuite::CanCreateCellStyle () const
pure virtual

Tests if a new cell style can be created.

Returns
kTrue if a cell style can be created, kFalse otherwise
virtual bool16 ICellStyleSuite::CanGetAllOverrides () const
pure virtual

Tests if the current selection has any overrides.

Returns
kTrue if the selection contains any overrides
virtual bool16 ICellStyleSuite::CanGetCellStyle () const
pure virtual

Tests if there exists a table selection.

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

Tests if the current selection has any overrides that intersects with the style's definition.

Returns
kTrue if the selection contains any overrides that intersects with the style's definition
virtual bool16 ICellStyleSuite::CanGetOverridingParagraphStyles () const
pure virtual

Tests if the table selection is in exactly one cell that contains paragraph styles other than the one defined in the given cell style. If the cell style is the root cell style, or if the cell style's paragraph style is undefined, this function will return kFalse.

Returns
kTrue if there is a single cell selected with paragraph overrides, kFalse otherwise
virtual bool16 ICellStyleSuite::CanRedefineCellStyle () const
pure virtual

Tests if we can redefine the current cell style. For this to return true, there must be a single cell selected that has both an editable cell style and local cell overrides. This will also be enabled if either the cell style defines a paragraph style that is overridden, or the cell style does not define a paragraph style at all.

Returns
kTrue if the "Redefine Cell Style" operation is permitted, kFalse otherwise
virtual ErrorCode ICellStyleSuite::ClearAllOverrides () const
pure virtual

Clears out all cell overrides from the given selection.

Returns
kSuccess if the overrides were cleared, kFailure otherwise
virtual ErrorCode ICellStyleSuite::ClearOverrides () const
pure virtual

Clears cell overrides from the given selection that conflict with the applied style's definition. If the applied style is the root cell style, then all overrides will be cleared.

Precondition
CanClearOverrides returns kTrue
Returns
kSuccess if the cell overrides were cleared, kFailure otherwise
virtual ErrorCode ICellStyleSuite::CreateCellStyle (const UIDparentHier = nil,
const int32 position = -1,
const UIDbasedOn = nil 
)
pure virtual

Creates a new cell style. If there is an active table selection and a single cell style is selected, then the new style will be based on that single cell style and its attributes will be the overrides of the top left cell of the selection. If there is no table selection the basedOn parameter will be used as the parent.

Precondition
CanCreateCellStyle returns kTrue
Parameters
parentHier[IN] optional, the parent hierarchy for the style, if this is not provided, the parent becomes the root hierarchy
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 a new cell style was created, kFailure otherwise
virtual ErrorCode ICellStyleSuite::GetAllOverrides (AttributeBossListoutLocalOverrides) const
pure virtual

Gets all cell overrides from the first cell selected in the table.

Precondition
CanGetAllOverrides returns kTrue
Parameters
outLocalOverrides[OUT] the local overrides applied to the first cell of the selected table
Returns
kSuccess if the overrides were returned, kFailure otherwise
virtual ErrorCode ICellStyleSuite::GetLocalOverrides (AttributeBossListoutLocalOverrides,
bool16 * out_IsMixed = nil 
) const
pure virtual

Gets the local cell overrides applied on the selected table. Since there can be multiple cells selected, each with different overrides, the parameter out_IsMixed can be used to determine if there are mixed overrides on the selection. This function will always return the overrides applied to the first cell of the selection.

Precondition
CanGetCellStyleOverrides returns kTrue
Parameters
outLocalOverrides[OUT] the local overrides applied to the selected table
out_IsMixed[OUT] optional, if this is not nil, then entire selected area will be examined to see if all the overrides are equivalent
Returns
kSuccess if the overrides were returned, kFailure otherwise
virtual ErrorCode ICellStyleSuite::GetOverridingParagraphStyles (UIDListout_OverridingParaStyles) const
pure virtual

Returns a list of all paragraph styles used within a cell that does not match the paragraph style defined in the cell style.

Precondition
CanGetOverridingParagraphStyles returns kTrue
Parameters
out_OverridingParaStyles[OUT] a UIDList for storing the paragraph style overrides
Returns
kSuccess if the paragraph overrides were retrieved, kFailure otherwise
virtual ErrorCode ICellStyleSuite::GetSelectedCellStyles (UIDListout_SelectedStyles) const
pure virtual

Gets the cell styles of the selection. The selection may contain multiple cell styles, so we return all of them. The parameter out_SelectedStyles will contain each cell style used in the selection exactly once.

Precondition
CanGetCellStyle returns kTrue
Parameters
out_SelectedStyles[OUT] a list containing all the styles used in the selection
Returns
kSuccess if the UIDs of selected cells style(s) were returned in out_SelectedStyles, kFailure otherwise
virtual ErrorCode ICellStyleSuite::RedefineCellStyle () const
pure virtual

Redefines the cell 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. Additionally, the first paragraph style used in the cell will be used as the paragraph style for the cell style.

Precondition
CanRedefineCellStyle returns kTrue
Returns
kSuccess if the cell style was redefined, kFailure otherwise