InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Facade::ITableStylesFacade Class Referenceabstract
Inheritance diagram for Facade::ITableStylesFacade:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ITABLESTYLESFACADE }
 

Public Member Functions

virtual UID GetBasicTableStyle (IDataBase *db) const =0
 
virtual ErrorCode CopyStylesToGroup (const UIDRef &whichGroup, const UIDList &whichStyles) const =0
 
virtual UID GetRegionalStyle (const IPMUnknown *tableModelBoss, const GridAddress &address, GridArea *runArea=nil) const =0
 
virtual ErrorCode GetRegionalStylesInArea (const UIDRef &tableModelRef, const GridArea &whichArea, UIDList &out_RegionalStyleSet) const =0
 
virtual ErrorCode GetTableStyleAttrsResolved (const UIDRef &tableStyle, AttributeBossList &out_ResolvedAttrs) const =0
 
virtual UID GetRootTableStyle (IDataBase *db) const =0
 
virtual ICommandCreateEditTableStyleCmd (const UIDRef &tableStyleRef) const =0
 
virtual ErrorCode SetDefaultStyle (const UIDRef &defaultStyle) const =0
 
virtual ErrorCode CreateNewStyleGroup (IWorkspace *workspace, const PMString &groupName, const UID &parentUID, const int32 position, UID *out_NewGroup=nil) const =0
 
virtual ErrorCode RenameTableStyle (const UIDRef &whichStyle, const PMString &newName) const =0
 
virtual ErrorCode DuplicateTableStyles (const UIDList &stylesToDuplicate) const =0
 
virtual bool16 CanBreakLinkWithStyle (const UIDRef &tableModelRef) const =0
 
virtual bool16 CanBreakLinkWithStyle (const ITableModel *tableModel) const =0
 
virtual ErrorCode BreakLinkWithStyle (const UIDRef &tableModel) const =0
 
virtual ErrorCode ApplyTableStyle (const UIDRef &whichStyle, const UIDRef &tableModelRef, const bool16 removeTableOverrides=kFalse, const bool16 removeCellStyle=kFalse) const =0
 
virtual ErrorCode EditTableStyle (const PMString &styleName, const AttributeBossList *attrList, IWorkspace *workspace, const UID &styleUID, const UID &basedOn, const VirtualKey shortcutKey=kVirtualNullKey, const int16 modifiers=0, const GlobalTime *shortcutTime=nil, const bool16 preserveRegionalFormatting=kFalse) const =0
 
virtual ErrorCode CreateTableStyle (IWorkspace *workspace, const IStyleGroupHierarchy *parentHier, const int32 position, const PMString &styleName, UIDRef &out_StyleRef, const UID &basedOnStyle=kInvalidUID, const AttributeBossList *attrList=nil, const VirtualKey shortcut=kVirtualNullKey, const int16 modifiers=0, const GlobalTime *shortcutTime=nil) const =0
 
virtual ErrorCode CreateNewTableStyle (const UIDRef &tableModel, const IStyleGroupHierarchy *parentHier=nil, const int32 stylePosition=-1) const =0
 
virtual ErrorCode DeleteTableStyle (const UIDRef &styleToDelete, const UID &replacementStyle, const bool16 preserveFormatting=kFalse) const =0
 
virtual ErrorCode GetLocalOverrides (const UIDRef &tableModel, AttributeBossList &out_LocalOverrides) const =0
 
virtual ErrorCode ClearLocalOverrides (const UIDRef &tableModel, const bool16 clearCellStyles=kFalse) const =0
 
virtual ErrorCode GetTableStyle (const UIDRef &tableModel, UID &out_TableStyle) const =0
 
virtual bool16 HasLocalOverrides (const UIDRef &tableModel) const =0
 
virtual bool16 CanRedefineTableStyle (const UIDRef &tableModelRef) const =0
 
virtual bool16 CanRedefineTableStyle (const ITableModel *tableModel) const =0
 
virtual ErrorCode RedefineTableStyle (const UIDRef &tableModel) const =0
 
virtual ErrorCode DuplicateStyle (const UIDRef &styleToDup, UIDRef &out_NewStyleRef) const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Member Function Documentation

virtual ErrorCode Facade::ITableStylesFacade::ApplyTableStyle (const UIDRefwhichStyle,
const UIDReftableModelRef,
const bool16 removeTableOverrides = kFalse,
const bool16 removeCellStyle = kFalse 
) const
pure virtual

Applies a table style to the given table. The table style must exist on the same database as the table. This function can also optionally remove any table overrides or any cell styles applied to the table.

Parameters
whichStyle[IN] the style to apply
tableModelRef[IN] the table to apply the style to
removeTableOverrides[IN] if local table overrides should be removed
removeCellStyle[IN] flag for removing all cell style information from the table
Returns
kSuccess if the style was applied, kFailure otherwise
virtual ErrorCode Facade::ITableStylesFacade::BreakLinkWithStyle (const UIDReftableModel) const
pure virtual

Takes the given table and applies all its table style attributes as local overrides. The table will then have the root table style applied to it. If there are any conflicts between the style attributes and the local overrides, the local overrides will always win.

Parameters
tableModel[IN] the table to break the style link
Returns
kSucess if the link was severed, kFailure otherwise
virtual bool16 Facade::ITableStylesFacade::CanBreakLinkWithStyle (const UIDReftableModelRef) const
pure virtual

Determines if the break link with style command can be executed for the given table. This will return true if the table has any table style other than the root table style applied to it.

Parameters
tableModelRef[IN] the table model to examine
Returns
kTrue if the break link with style command can be executed on the given table, kFalse otherwise
virtual bool16 Facade::ITableStylesFacade::CanBreakLinkWithStyle (const ITableModeltableModel) const
pure virtual

Determines if the break link with style command can be executed for the given table. This will return true if the table has any table style other than the root table style applied to it.

Precondition
CanBreakLinkWithStyle returns kTrue
Parameters
tableModel[IN] the table model to examine
Returns
kTrue if the break link with style command can be executed on the given table, kFalse otherwise
virtual bool16 Facade::ITableStylesFacade::CanRedefineTableStyle (const UIDReftableModelRef) const
pure virtual

Tests if the redefine table style command can be executed on the given table. To run the redefine style command the table must have overrides and any style other than the root style applied to it.

Parameters
tableModelRef[IN] the table to examine
Returns
kTrue if the applied style can be redefined, kFalse otherwise
virtual bool16 Facade::ITableStylesFacade::CanRedefineTableStyle (const ITableModeltableModel) const
pure virtual

Tests if the redefine table style command can be executed on the given table. To run the redefine style command the table must have overrides and any style other than the root style applied to it.

Parameters
tableModel[IN] the table to examine
Returns
kTrue if the applied style can be redefined, kFalse otherwise
virtual ErrorCode Facade::ITableStylesFacade::ClearLocalOverrides (const UIDReftableModel,
const bool16 clearCellStyles = kFalse 
) const
pure virtual

Clears any local table style overrides on the given table.

See Also
HasLocalOverrides
Parameters
tableModel[IN] the table to clear the overrides from
clearCellStyles[IN] optional, set to kTrue to clear all local cell styles
Returns
kSuccess if the overrides were cleared, kFailure otherwise
virtual ErrorCode Facade::ITableStylesFacade::CopyStylesToGroup (const UIDRefwhichGroup,
const UIDListwhichStyles 
) const
pure virtual

Copies the table styles and groups given in whichStyles into the group given by whichGroup.

Parameters
whichGroup[IN] the group to copy the styles/groups into
whichStyles[IN] a list of table styles and/or table style groups to copy into the other table style group
Returns
kSuccess if the groups were successfully copied, kFailure otherwise
virtual ICommand* Facade::ITableStylesFacade::CreateEditTableStyleCmd (const UIDReftableStyleRef) const
pure virtual

Creates and returns an instance of kEditTableStyleCmdBoss. The command's interfaces will be set to edit the table style given by tableStyleRef. The ICommand returned by this function should be wrapped in an InterfacePtr:
InterfacePtr<ICommand> editCmd(Utils<ITableStylesFacade>()->CreateEditTableStyleCmd(tableStyleRef));

Parameters
tableStyleRef[IN] the UIDRef of a table style
Returns
the command used to edit a table style
virtual ErrorCode Facade::ITableStylesFacade::CreateNewStyleGroup (IWorkspaceworkspace,
const PMStringgroupName,
const UIDparentUID,
const int32 position,
UIDout_NewGroup = nil 
) const
pure virtual

Creates a new table style group.

Parameters
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
Returns
kSuccess if the new style group was created, kFailure otherwise
virtual ErrorCode Facade::ITableStylesFacade::CreateNewTableStyle (const UIDReftableModel,
const IStyleGroupHierarchyparentHier = nil,
const int32 stylePosition = -1 
) const
pure virtual

Creates a new table style using the table style and attributes of the given table. The new style will be based on the style of the given table and contain as attributes any overrides on the table.

Parameters
tableModel[IN] the table whose attributes should be used for the new table style
parentHier[IN] optional, the style hierarchy to place the new style under, if this is not defined the root hierarchy is used
stylePosition[IN] optional, the position under the parent hierarchy
Returns
kSuccess if the table style was created, kFailure otherwise
virtual ErrorCode Facade::ITableStylesFacade::CreateTableStyle (IWorkspaceworkspace,
const IStyleGroupHierarchyparentHier,
const int32 position,
const PMStringstyleName,
UIDRefout_StyleRef,
const UIDbasedOnStyle = kInvalidUID,
const AttributeBossListattrList = nil,
const VirtualKey shortcut = kVirtualNullKey,
const int16 modifiers = 0,
const GlobalTimeshortcutTime = nil 
) const
pure virtual

Creates a table style on the given workspace.

Parameters
workspace[IN] the workspace to create the style on
parentHier[IN] the parent style group
position[IN] the position within the parent
styleName[IN] the name for the style, this name should be unique within the parentHier
out_StyleRef[OUT] the UIDRef of the kTableStyleBoss that corresponds to the new style
basedOnStyle[IN] optional,the UID of the style the new style should be based on, if this parameter is not provided, the style will be based on the root table style
attrList,optionalattributes for the table style
shortcut[IN] optional, the shortcut key
modifiers[IN] optional, the shortcut modifier
shortcutTime[IN] optional, the shortcut timestamp
Returns
kSuccess if the table style was created, kFailure otherwise
virtual ErrorCode Facade::ITableStylesFacade::DeleteTableStyle (const UIDRefstyleToDelete,
const UIDreplacementStyle,
const bool16 preserveFormatting = kFalse 
) const
pure virtual

Deletes a table style.

Parameters
styleToDelete[IN] the style to delete
replacementStyle[IN] the replacement style UID
preserveFormatting[IN] only used if the replacement style is the root style, in which case it will do a break link with style if this is set to kTrue
Returns
kSuccess if the style was deleted, kFailure otherwise
virtual ErrorCode Facade::ITableStylesFacade::DuplicateStyle (const UIDRefstyleToDup,
UIDRefout_NewStyleRef 
) const
pure virtual

Duplicates a single table style, and returns the newly created style.

Parameters
styleToDup[IN] the style to duplicate
out_NewStyleRef[OUT] the duplicate style
Returns
kSuccess if the style was duplicated, kFailure otherwise
virtual ErrorCode Facade::ITableStylesFacade::DuplicateTableStyles (const UIDListstylesToDuplicate) const
pure virtual

Duplicates multiple table styles. The duplicated styles will have the same attributes, but names that end with "copy", or "copy 1", "copy 2", etc.

Parameters
stylesToDuplicate[IN] a list of table styles to duplicate
Returns
kSuccess if the styles were duplicated, kFailure otherwise
virtual ErrorCode Facade::ITableStylesFacade::EditTableStyle (const PMStringstyleName,
const AttributeBossListattrList,
IWorkspaceworkspace,
const UIDstyleUID,
const UIDbasedOn,
const VirtualKey shortcutKey = kVirtualNullKey,
const int16 modifiers = 0,
const GlobalTimeshortcutTime = nil,
const bool16 preserveRegionalFormatting = kFalse 
) const
pure virtual

Edits an existing table style to match the given attributes. If you don't need to update everything, see CreateEditTableStyleCmd in this class.

Parameters
styleName[IN] the new name for the style
attrList[IN] the new table attributes
workspace[IN] the workspace the style lives on
styleUID[IN] the UID of the style being updated
basedOn[IN] the new parent style
shortcutKey[IN] optional, the shortcut for the table style
modifiers[IN] optional, the modifiers for the shortcut
shortcutTime[IN] optional, the shortcut timestamp
preserveRegionalFormatting[IN] optional, if a regional cell style is changed to the root cell style this flag is used to determine if regional cell style formatting should be preserved
Returns
kSuccess if the user was able to edit the style, kFailure otherwise
virtual UID Facade::ITableStylesFacade::GetBasicTableStyle (IDataBasedb) const
pure virtual

Gets the [Basic Table] style for the given database.

Parameters
db[IN] the database of the workspace to get the basic table style from
Returns
the basic table style
virtual ErrorCode Facade::ITableStylesFacade::GetLocalOverrides (const UIDReftableModel,
AttributeBossListout_LocalOverrides 
) const
pure virtual

Gets the local table overrides from the given table model.

Parameters
tableModel[IN] the table to examine
out_LocalOverrides[OUT] any local overrides on the table
Returns
kSuccess if the local overrides were retrieved, kFailure otherwise
virtual UID Facade::ITableStylesFacade::GetRegionalStyle (const IPMUnknowntableModelBoss,
const GridAddressaddress,
GridArearunArea = nil 
) const
pure virtual

Gets the regional cell style for the given cell. The regional style is dependent on where address lies in the table.

Parameters
tableModelBoss[IN] any interface on kTableModelBoss
address[IN] the cell to get the regional style for
runArea[OUT] optional, the regional style area
Returns
the regional cell style
virtual ErrorCode Facade::ITableStylesFacade::GetRegionalStylesInArea (const UIDReftableModelRef,
const GridAreawhichArea,
UIDListout_RegionalStyleSet 
) const
pure virtual

Gets a set of regional styles used for the given GridArea.

Parameters
tableModelRef[IN] the table to examine
whichArea[IN] the grid area to get regional styles from
out_RegionalStyleSet[OUT] a list which has the set property of regional styles used in the given grid area
Returns
kSuccess if the regional styles (if any) were returned, kFailure otherwise
virtual UID Facade::ITableStylesFacade::GetRootTableStyle (IDataBasedb) const
pure virtual

Returns the root table style for the given database.

Parameters
db[IN] the IDataBase to get the root style
Returns
the root table style
virtual ErrorCode Facade::ITableStylesFacade::GetTableStyle (const UIDReftableModel,
UIDout_TableStyle 
) const
pure virtual

Returns the table style for the table.

Parameters
tableModel[IN] the table to clear the overrides from
out_TableStyle[OUT] the table style of the given table
Returns
kSuccess if the table style was retrieved, kFailure otherwise
virtual ErrorCode Facade::ITableStylesFacade::GetTableStyleAttrsResolved (const UIDReftableStyle,
AttributeBossListout_ResolvedAttrs 
) const
pure virtual

Resolves the style hierarchy for the given table style. All table styles are descendants of the root table style, so starting at the root, each style in the branch leading to tableStyle will be queried for their attributes, with any conflicts between nodes resolved by using the value of the style farther down the branch.

Parameters
tableStyle[IN] the table style
out_ResolvedAttrs[OUT] the resolved table style attributes
Returns
kSuccess if the attributes were resolved, kFailure otherwise
virtual bool16 Facade::ITableStylesFacade::HasLocalOverrides (const UIDReftableModel) const
pure virtual

Tests if the given table has any local table overrides.

Parameters
tableModel[IN] the table model to examine
Returns
kTrue if the table has local table overrides, kFalse otherwise.
virtual ErrorCode Facade::ITableStylesFacade::RedefineTableStyle (const UIDReftableModel) const
pure virtual

Redefines the table style of the given table to contain its present attributes, along with any table overrides currently applied on the table. If there are conflicts between the style attributes and its overrides, the overrides will always take precedence.

Parameters
tableModel[IN] the table to examine
Returns
kSuccess if the style was redefined, kFailure otherwise
virtual ErrorCode Facade::ITableStylesFacade::RenameTableStyle (const UIDRefwhichStyle,
const PMStringnewName 
) const
pure virtual

Renames a single table style.

Parameters
whichStyle[IN] the table style to rename
newName[IN] a valid, unique (within the style group context) name for the cell style
Returns
kSuccess if the style was renamed, kFailure otherwise
virtual ErrorCode Facade::ITableStylesFacade::SetDefaultStyle (const UIDRefdefaultStyle) const
pure virtual

Sets the default table style. The default table style in the insert table dialog.

Parameters
defaultStyle[IN] the UIDRef pointing to the table style to be used as the default.
Returns
kSuccess if the default table style was set, kFailure otherwise