![]() | InDesign SDK 20.5 |
#include <ICellStylesFacade.h>

Public Types | |
| enum | { kDefaultIID = IID_ICELLSTYLESFACADE } |
Public Member Functions | |
| virtual ErrorCode | CopyStylesToGroup (const UIDRef &whichGroup, const UIDList &whichStyles) const =0 |
| virtual const IPMUnknown * | QueryCellStyleHier (IDataBase *db, const UID &startingStyle, const ClassID &whichAttr, const PMIID &iid) const =0 |
| virtual ErrorCode | GetCellStyleAttrsResolved (const UIDRef &cellStyle, AttributeBossList &resolvedAttrs, const PMIID &attributeType) const =0 |
| virtual UID | GetCellStyleParagraphStyle (const UIDRef &styleRef) const =0 |
| virtual ErrorCode | GetOverridingParagraphStyles (const ITableModel *tableModel, const GridAddress &cellAnchor, UIDList &out_OverridingParaStyles, const UIDRef &styleToCheck=UIDRef::gNull) const =0 |
| virtual ErrorCode | GetCellOverrides (const ITableModel *tableModel, const GridAddress &whichCell, AttributeBossList &out_Overrides, const UIDRef &styleToCheck=UIDRef::gNull) const =0 |
| virtual ErrorCode | GetAllCellOverrides (const ITableModel *tableModel, const GridAddress &whichCell, AttributeBossList &out_Overrides) const =0 |
| virtual ErrorCode | CreateNewStyleGroup (IWorkspace *workspace, const PMString &groupName, const UID &parentUID, const int32 position, UID *out_NewGroup=nil) const =0 |
| virtual UID | GetRootCellStyle (IDataBase *db) const =0 |
| virtual ICommand * | CreateEditCellStyleCmd (const UIDRef &cellStyleRef) const =0 |
| virtual ErrorCode | RenameCellStyle (const UIDRef &whichStyle, const PMString &newName) const =0 |
| virtual ErrorCode | DuplicateCellStyle (const UIDRef &whichStyle, UIDRef &out_NewStyle) const =0 |
| virtual ErrorCode | DuplicateCellStyles (const UIDList &stylesToDuplicate) const =0 |
| virtual ErrorCode | SetDefaultStyle (const UIDRef &defaultStyle) const =0 |
| virtual ErrorCode | ApplyCellStyle (const UIDRef &whichStyle, const UIDRef &tableModelRef, const GridArea &whichArea, const bool16 removeOverrides=kFalse, const bool16 applyParaStyle=kTrue) const =0 |
| virtual ErrorCode | ApplyCellStyleAndClearAll (const UIDRef &whichStyle, const UIDRef &tableModelRef, const GridArea &whichArea) const =0 |
| virtual ErrorCode | EditCellStyle (const PMString &styleName, const AttributeBossList *styleAttrList, IWorkspace *workspace, const UID &styleUID, const UID &basedOnStyleUID, const VirtualKey shortcutKey=kVirtualNullKey, const int16 modifiers=0, const GlobalTime *shortcutTime=nil) const =0 |
| virtual ErrorCode | DeleteCellStyle (const UIDRef &styleToDelete, const UID &replacementStyle=kInvalidUID, const bool16 preserveFormatting=kFalse) const =0 |
| virtual ErrorCode | CreateCellStyle (IWorkspace *workspace, const IStyleGroupHierarchy *parentHier, const int32 position, const PMString &syleName, UIDRef &outStyleRef, const UID &basedOnStyle=kInvalidUID, const AttributeBossList *styleAttrs=nil, const VirtualKey shortcutKey=kVirtualNullKey, const int16 modifiers=0, const GlobalTime *shortcutTime=nil) const =0 |
| virtual ErrorCode | CreateCellStyle (const UIDRef &tableModelRef, const GridAddress &selectedAddress, const IStyleGroupHierarchy *parentHier=nil, const int32 stylePosition=-1) const =0 |
| virtual bool16 | CanBreakLinkWithCellStyle (const ITableModel *tableModel, const GridArea &whichArea) const =0 |
| virtual ErrorCode | BreakLinkWithStyle (const UIDRef &tableModelRef, const GridArea &whichArea) const =0 |
| virtual bool16 | CanRedefineCellStyle (const ITableModel *tableModel, const GridAddress &whichAddress) const =0 |
| virtual ErrorCode | RedefineStyle (const UIDRef &tableModelRef, const GridAddress &whichAddress) const =0 |
| virtual ErrorCode | ClearCellStyleOverrides (const UIDRef &tableModelRef, const GridArea &whichArea) const =0 |
| virtual ErrorCode | ClearAllCellOverrides (const UIDRef &tableModelRef, const GridArea &whichArea) const =0 |
| virtual ErrorCode | GetSelectedCellStyles (const UIDRef &tableModelRef, const GridArea &whichArea, UIDList &out_SelectedStyles) const =0 |
| virtual bool16 | ClearParaStyleOverride (const ITableModel *tableModel, const GridAddress &whichCell) const =0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
Utility functions for working with cell styles. To use these functions use the Utils boss:Utils<Facade::ICellStylesFacade>()->CreateCellStyle(...);
| pure virtual |
Applies a cell style to the given area of the table.
| whichStyle | [IN] the cell style to apply |
| tableModelRef | [IN] the UIDRef of the kTableModelBoss to apply the style to |
| whichArea | [IN] the GridArea to apply the style to |
| removeOverrides | [IN] optional, kTrue if cell overrides should be removed, kFalse otherwise |
| applyParaStyle | [IN] optional, kTrue if the cell style should apply its paragraph style, kFalse otherwise. The removeOverrides option is not affected by this flag. does not affect remove overrides. |
kSuccess if the cell style was applied, kFailure otherwise
| pure virtual |
Applies a cell style to the given area of the table and removes any local overrides.
| whichStyle | [IN] the cell style to apply |
| tableModelRef | [IN] the UIDRef of the kTableModelBoss to apply the style to |
| whichArea | [IN] the GridArea to apply the style to |
kSuccess if the cell style was applied, kFailure otherwise
| pure virtual |
Breaks the link with the cell style for the given area. When the break link command is executed, the style for the cells in whichArea will be set to the root cell style, while all style attributes will be applied as local overrides. Any preexisting local overrides will take precedence over the style attributes being applied as local overrides.
CanBreakLinkWithCellStyle returns kTrue| tableModelRef | [IN] the table to examine |
| whichArea | [IN] the grid area to break the link |
kSuccess if the link with the cell style was broken, kFailure otherwise
| pure virtual |
Tests if the break link with cell style command can be executed on the given area of the table. For this to return true, the selected area must have styles other than the root cell style (or kInvalidUID) applied to them.
| tableModel | [IN] the table to examine |
| whichArea | [IN] the area to examine |
kTrue if the break link command can be executed, kFalse otherwise
| pure virtual |
Determines if the redefine cell style command can be executed. For this function to return true, the cell at the given address must have a style other than the root cell style applied to it (or kInvalidUID) and there must be cell overrides, or there is a cell style that does not define a paragraph style, or the cell style's paragraph style is overridden.
| tableModel | [IN] the table model |
| whichAddress | [IN] the address of the cell |
kTrue if the break link command can be executed, kFalse otherwise
| pure virtual |
Clears out all cell attributes from the given cell area.
| tableModelRef | [IN] the table model |
| whichArea | [IN] the GridArea to clear local overrides from |
kSuccess if the local overrides were cleared, kFailure otherwise
| pure virtual |
Clears all cell overrides from the given areathat conflict with the applied cell style. If the root cell style is the applied style, then all overrides will be cleared. This will also clear out any overriding paragraph styles, returning the text within the cell to the style's paragraph style. If there is no cell style applied, or the applied cell style does not define the cell style, then the paragraphs are left alone.
| tableModelRef | [IN] the table model |
| whichArea | [IN] the GridArea to clear conflicting overrides from |
kSuccess if the conflicting cell overrides were cleared, kFailure otherwise
| pure virtual |
Clears out the paragraph style cell attribute from the given cell address.
| tableModel | [IN] the table model |
| whichCell | [IN] the GridAddress to clear local overrides from |
kTrue if there were any local overrides to be were cleared and clearance work done kFalse otherwise
| pure virtual |
Copies the cell styles and groups given in whichStyles into the group given by whichGroup.
| whichGroup | [IN] the group to copy the styles/groups into |
| whichStyles | [IN] a list of cell styles and/or cell style groups to copy into the other cell style group |
kSuccess if the groups were successfully copied, kFailure otherwise
| pure virtual |
Creates a cell style on the given workspace. The style will be named the given name (with a number after the name if a style already exists with the desired name) and if styleAttrs is not nil, with those attributes. If styleAttrs is nil, the style will not have any attributes, so its probably best to get the AttributeBossList of an existing cell style, or any table cell to duplicate.
| workspace | [IN] the workspace to create the cell style on. |
| syleName | [IN] the name for the cell style with a number |
| parentHier | [IN] the hierarchy to place the style under |
| position | [IN] the position within the parent hierarchy |
| outStyleRef | [OUT] the UIDRef of the new style |
| basedOnStyle | [IN] optional the style this style is based on, if this parameter is not provided, the new style will be based on the root style |
| styleAttrs | [IN] optional, an AttributeBossList for the cell style, if this is nil the style will have no attributes |
| shortcutKey | [IN] optional, the shortcut key for the style |
| modifiers | [IN] optioanl, modifiers for the shortcut key |
| shortcutTime | [IN] optional, the shortcut timestamp |
kSuccess if the style was created, kFailure otherwise
| pure virtual |
Creates a cell style that will be based on the cell style at the give address, and whose attributes will be the overrides of the cell at that address.
| tableModelRef | [IN] the table model to examine |
| selectedAddress[IN] | the address of the cell to examine for overrides and the parent style |
| parentHier | [IN] the style hierarchy to place the new style under, if this is not defined the root hierarchy is used |
| stylePosition | [IN] the position under the parent hierarchy |
kSuccess if the style was created, kFailure otherwise
| pure virtual |
Creates and returns an instance of kEditCellStyleCmdBoss. The command's interfaces will be set to edit the cell style given by cellStyleRef. The ICommand returned by this function should be wrapped in an InterfacePtr:InterfacePtr<ICommand> editCmd(Utils<ICellStylesFacade>()->CreateEditCellStyleCmd(cellStyleRef));
| cellStyleRef | [IN] the UIDRef of a cell style |
| pure virtual |
Creates a new cell style group.
| workspace | [IN] the workspace to create the style group on |
| groupName | [IN] the name of the style group, this should be a valid group name and be unique within the style group's parent |
| parentUID | [IN] the parent style group |
| position | [IN] the position within the parent group |
| out_NewGroup | [OUT] optional, use a valid pointer to get the UID of the new style group |
kSuccess if the new style group was created, kFailure otherwise
| pure virtual |
Deletes the given cell style. If the parameter replacementStyle is provided, it will be used to replace all instances of the deleted style. The preserveFormatting parameter is only relevent if the replacement style is the root style (or not provided).
| styleToDelete | [IN] the UIDRef of the style to delete |
| replacementStyle | [IN] optional, the style to use as a replacement, defaults to the root cell style |
| preserveFormatting | [IN] optional, if replacementStyle is the root cell style, or kInvalidUID then if this parameter is kTrue, all cell style formatting will be applied as local overrides on any cell using the style that will be deleted. |
kSuccess if the cell style was deleted, kFailure otherwise
| pure virtual |
Duplicates a single cell style.
| whichStyle | [IN] the cell style to duplicate |
| out_NewStyle | [OUT] the UIDRef of the duplicate style |
kSuccess if the style was duplicated, kFailure otherwise
| pure virtual |
Duplicates multiple cell styles. The duplicated styles will have the same attributes, but names that end with "copy", or "copy 1", "copy 2", etc.
| stylesToDuplicate | [IN] a list of cell styles to duplicate |
kSuccess if the styles were duplicated, kFailure otherwise
| pure virtual |
Edits a cell style with the given parameters.
| styleName | [IN] the style name |
| styleAttrList | [IN] the cell attributes to use for the style |
| workspace | [IN] the workspace the cell style lives on |
| styleUID | [IN] the UID of the cell style |
| basedOnStyleUID | [IN] the cell style that the style should be based on |
| shortcutKey | [IN] optional, the shortcut key |
| modifiers | [IN] optional, the shortcut modifiers |
| shortcutTime | [IN] optional, the shortcut timestamp |
kSuccess if the cell style was applied, kFailure otherwise
| pure virtual |
Gets all the cell overrides applied to the given cell, regardless of the applied style.
| tableModel | [IN] the table to examine |
| whichCell | [IN] the grid address of the cell to get the overrides from |
| out_Overrides | [OUT] container where any local overrides will be placed |
kSuccess if all local overrides were placed into out_Overrides, kFailure otherwise
| pure virtual |
Gets all the cell overrides applied to the given cell that conflict with either the applied cell style or the style passed into the function. If the passed in style is its default and the applied cell style is the root cell style, then all overrides will be returned by this function.
| tableModel | [IN] the table to examine |
| whichCell | [IN] the grid address of the cell to get the overrides from |
| out_Overrides | [OUT] container where any local overrides will be placed |
| styleToCheck | [IN] optional the style that will be checked against when searching for a paragraph style override. If left to its default, this function will check against the style currently applied to the cell. |
kSuccess if all local overrides were placed into out_Overrides, kFailure otherwise
| pure virtual |
Resolves the style hierarchy for the given cell style. All cell styles are descendants of the root cell style, so starting at the root, each style in the branch leading to cellStyle will be queried for their attributes, with any conflicts between nodes resolved by using the value of the style farther down the branch .
| cellStyle | [IN] the table style |
| out_ResolvedAttrs | [OUT] the resolved cell style attributes |
| attributeType | [IN] the type of cell style attributes you want, for the horizontal table version use IID_ITABLEATTRIBUTES, for the vertical table version use IID_IVERTICALCELLSTYLEATTRIBUTES |
kSuccess if the attributes were resolved, kFailure otherwise
| pure virtual |
Gets the paragraph style associated with the given cell style. This function will go up the cell style hierarchy to find the paragraph style.
| styleRef | [IN] the cell style to get the pargraph style from |
UID of the paragraph style associated with the cell style, or kInvalidUID if there is no associated paragraph style
| pure virtual |
Goes through the given cell, checking all the paragraph styles used in that cell. If the used paragraph styles do not match the paragraph style defined by the cell style then those paragraph styles are returned in out_OverridingParaStyles. If the applied cell style does not define a paragraph style, then no applied paragraph style is considered an override.
| tableModel | [IN] the table to examine |
| cellAnchor | [IN] the grid address of the cell to examine |
| out_OverridingParaStyles | [OUT] the list of overriding paragraph styles |
| styleToCheck | [IN] optional the style that will be checked against when searching for overrides. If left to its default, this function will check against the style currently applied to the cell. |
kSuccess if the cell was examined and all overriding paragraph style were returned, kFailure otherwise Returns the root cell style for the given database.
| db | [IN] the IDataBase to get the root style from |
| pure virtual |
Gets all the cell styles used in the selected area. The parameter out_SelectedStyles will be filled with the styles that are being used in whichArea, each style will only appear once.
| tableModelRef | [IN] the table |
| whichArea | [IN] the GridArea to examine |
| out_SelectedStyles | [IN] a list containing all the styles used in the selected area |
kSuccess if the used styles were returned, kFailure otherwise
| pure virtual |
Goes through the cell style hierarchy and looks for the desired attribute. The interface returned by this function must be released by the caller.
| db | [IN] the database |
| startingStyle | [IN] the style to start with |
| whichAttr | [IN] which cell attribute |
| iid | [IN] the PMIID of the attribute, should be something like IID_ITABLEATTRUID, use IID_UNKNOWN if you don't know |
| pure virtual |
Redefines the cell style at the given address to use the style attributes along with any local overrides as the style's new attributes. Local overrides will take precedence whenever any conflicts exist. The paragraph style of the first paragraph in the cell will be used as the cell style's paragraph style.
| tableModelRef | [IN] the table to examine |
| whichAddress | [IN] the GridAddress of a cell anchor whose local overrides will used to redefine the style |
kSuccess if the style was redefined, kFailure otherwise
| pure virtual |
Renames a single cell style.
| whichStyle | [IN] the cell style to rename |
| newName | [IN] a valid, unique (within the style group context) name for the cell style |
kSuccess if the style was renamed, kFailure otherwise
| pure virtual |
Sets the default cell style. Currently the default cell style is not used.
| defaultStyle | [IN] the cell style to use as the default |
kSuccess if the default style was set, kFailure otherwise