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

#include <ITableAttrAccessor.h>

Inheritance diagram for ITableAttrAccessor:
IPMUnknown

Classes

class  CellOverridesCallback
 
class  CellStrokeOverridesCallback
 

Public Types

enum  { kDefaultIID = IID_ITABLEATTRACCESSOR }
 kDefaultIID
 

Public Member Functions

Cell Styles.
virtual const AttributeBossListGetAttributesFromCellStyle (const GridAddress &element, GridArea *runArea=nil) const =0
 
virtual const AttributeBossListGetAttributesFromRegionalCellStyle (const GridAddress &element, GridArea *runArea=nil) const =0
 
virtual UID GetCellStyle (const GridAddress &element, int32 *priority=nil, GridArea *runArea=nil) const =0
 
virtual UID GetRegionalCellStyle (const GridAddress &element, GridArea *runArea=nil) const =0
 
virtual const IPMUnknownQueryCellStyleForAttr (const GridAddress &element, const ClassID &whichAttr, const PMIID &iid, GridArea *surroundingRun=nil) const =0
 
Row attributes.
virtual const IPMUnknownQueryRowAttribute (int32 row, ClassID whichAttr, PMIID iid) const =0
 
virtual const IPMUnknownQueryRowOverride (int32 row, ClassID whichAttr, PMIID id) const =0
 
virtual DataWrapper
< AttributeBossList
QueryRowOverrides (int32 row, int32 *runLength=nil) const =0
 
Column attributes.
virtual const IPMUnknownQueryColAttribute (int32 col, ClassID whichAttr, PMIID id) const =0
 
virtual const IPMUnknownQueryColOverride (int32 col, ClassID whichAttr, PMIID id) const =0
 
virtual DataWrapper
< AttributeBossList
QueryColOverrides (int32 col, int32 *runLength=nil) const =0
 
Cell attributes.
virtual const IPMUnknownQueryCellAttribute (const GridAddress &element, ClassID whichAttr, PMIID iid, GridArea *surroundingRun=nil, bool16 isPreserveOverride=kTrue) const =0
 
virtual const IPMUnknownQueryCellOverride (const GridAddress &element, ClassID whichAttr, PMIID iid, GridArea *surroundingRun=nil) const =0
 
virtual DataWrapper
< AttributeBossList
QueryCellOverrides (const GridAddress &element, GridArea *surroundingRun=nil) const =0
 
virtual void IterateCellOverrides (CellOverridesCallback &callBack) const =0
 
virtual void IterateCellStrokeOverrides (Tables::ERowColumn patternType, CellStrokeOverridesCallback &callBack) const =0
 
Table attributes.
virtual UID GetTableStyle (void) const =0
 
virtual const IPMUnknownQueryTableAttribute (ClassID whichAttr, PMIID iid) const =0
 
virtual const AttributeBossListGetTableAttributesResolved (void) const =0
 
virtual const ITableAttributesQueryTableOverrides (void) const =0
 
Cell content type attributes.
virtual CellType GetCellType (const GridAddress &anchor) const =0
 
virtual CellType GetDefaultCellType (void) const =0
 
Caches.
virtual void ClearCaches (void)=0
 
virtual void FirstColLeftStrokeChanged ()=0
 
virtual void LastColRightStrokeChanged ()=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Stroke & fill attributes.

enum  { kLowestPriority = 0 }
 
virtual PMReal GetElementStrokeWeight (const GridAddress &element, Tables::ECellEdge edge, bool16 *isOverride=nil, GridArea *runArea=nil) const =0
 
virtual ITableLineType::SType GetElementStrokeType (const GridAddress &element, Tables::ECellEdge edge, bool16 *isOverride=nil, GridArea *runArea=nil) const =0
 
virtual UID GetElementStrokeColor (const GridAddress &element, Tables::ECellEdge edge, bool16 *isOverride=nil, GridArea *runArea=nil) const =0
 
virtual PMReal GetElementStrokeTint (const GridAddress &element, Tables::ECellEdge edge, bool16 *isOverride=nil, GridArea *runArea=nil) const =0
 
virtual bool16 GetElementStrokeOverprint (const GridAddress &element, Tables::ECellEdge edge, bool16 *isOverride=nil, GridArea *runArea=nil) const =0
 
virtual UID GetElementStrokeGapColor (const GridAddress &element, Tables::ECellEdge edge, bool16 *isOverride=nil, GridArea *runArea=nil) const =0
 
virtual PMReal GetElementStrokeGapTint (const GridAddress &element, Tables::ECellEdge edge, bool16 *isOverride=nil, GridArea *runArea=nil) const =0
 
virtual bool16 GetElementStrokeGapOverprint (const GridAddress &element, Tables::ECellEdge edge, bool16 *isOverride=nil, GridArea *runArea=nil) const =0
 
virtual int32 GetElementStrokePriority (const GridAddress &element, Tables::ECellEdge edge) const =0
 
virtual PMReal GetCellMaxStrokeWeight (const GridAddress &anchor, Tables::ECellEdge edge) const =0
 
virtual void GetCellStrokeWeightAndType (const GridAddress &anchor, Tables::ECellEdge edge, TableAttrStrokeWeightAndTypeList *swtList) const =0
 
virtual PMReal GetFirstColMaxLeftStrokeWeight () const =0
 
virtual PMReal GetLastColMaxRightStrokeWeight () const =0
 
virtual UID GetFillColor (const GridAddress &anchor) const =0
 
virtual PMReal GetFillTint (const GridAddress &anchor) const =0
 
virtual bool16 GetFillOverprint (const GridAddress &anchor) const =0
 

Detailed Description

Interface to access attributes in the table model.

Author
Joe Shankar

Member Function Documentation

virtual void ITableAttrAccessor::ClearCaches (void )
pure virtual

For internal use by table model.

Parameters
cols
virtual void ITableAttrAccessor::FirstColLeftStrokeChanged ()
pure virtual

For internal use by table model.

virtual const AttributeBossList* ITableAttrAccessor::GetAttributesFromCellStyle (const GridAddresselement,
GridArearunArea = nil 
) const
pure virtual

Gets the attributes for a given cell that are from the cell style applied to the cell. Its not sufficient to simply get the attributes of the cell style to determine which attributes are actually being shown because for a given cell its cell strokes may come from the cell style applied to the cell, or its neighbor. The attributes returned by this function are not necessarily the attributes used in the cell. To get what is actually used you can call GetAttributesFromRegionalCellStyle, this function, and QueryCellOverrides to get all the cell attributes applied to a single cell.

Parameters
element[IN] the address of the cell to get the cell style attributes from
runArea[OUT] optional, the run area for the cell style attributes
Returns
a list containing the cell style attributes for the given cell, with its stroke attributes resolved with the stroke attributes of cell styles from adjacent cells.
virtual const AttributeBossList* ITableAttrAccessor::GetAttributesFromRegionalCellStyle (const GridAddresselement,
GridArearunArea = nil 
) const
pure virtual

Gets the attributes for a given cell that are from the regional cell style that is applied through the table style. Its not sufficient to simply get the attributes of the regional cell style to determine which attributes are actually being shown because for a given cell its cell strokes may come from the regional cell style applied to the cell, or its neighbor. The attributes returned by this function are not necessarily the attributes used in the cell. To get what is actually used you can call this function, GetAttributesFromCellStyle, and QueryCellOverrides to get all the cell attributes applied to a single cell.

Parameters
element[IN] the address of the cell to get the regional cell style attributes from
runArea[OUT] optional, the run area for the regional cell style attributes
Returns
a list containing the regional cell style attributes for the given cell, with its stroke attributes resolved with the stroke attributes of regional cell styles from adjacent cells.
virtual PMReal ITableAttrAccessor::GetCellMaxStrokeWeight (const GridAddressanchor,
Tables::ECellEdge edge 
) const
pure virtual

Determine the max effective stroke weight for a cell's specified edge. For an edge to have an effective stroke it must have a non-zero stroke weight and a valid stroke type.

Parameters
anchor,anchorlocation of the anchor (top-left of cell) in underlying table grid. see GridAddress for more information on anchors versus elements.
edge,specifieswhether left, top right or bottom edge.
Returns
max stroke weight for edge of cell.
virtual void ITableAttrAccessor::GetCellStrokeWeightAndType (const GridAddressanchor,
Tables::ECellEdge edge,
TableAttrStrokeWeightAndTypeListswtList 
) const
pure virtual

Fills in the swtList with effective stroke weight and line type for all elements along the specified edge of the cell. For an edge to have an effective stroke it must have a non-zero stroke weight and a valid stroke type.

Parameters
anchor,anchorlocation of the anchor (top-left of cell) in underlying table grid. see GridAddress for more information on anchors versus elements.
edge,specifieswhether left, top right or bottom edge.
swtList,thelist to be filled in with Stroke Weight and LineType.
virtual UID ITableAttrAccessor::GetCellStyle (const GridAddresselement,
int32 * priority = nil,
GridArearunArea = nil 
) const
pure virtual

Gets the cell style for the given GridAddress. Because cells do not necessarily have a style, this function can return kInvalidUID, which is treated the same as the root cell style.

Parameters
element[IN] the GridAddress of the cell to retrieve the style from, this should be a valid grid address of the table
priority[OUT] optional, the cell style priority
runArea[OUT] optional, the run area
Returns
the UID of the applied cell style, may be kInvalidUID
virtual CellType ITableAttrAccessor::GetCellType (const GridAddressanchor) const
pure virtual

Might be removed. Returns the CellType associated with anchor.

Parameters
anchorCell whose type is to be returned.
virtual CellType ITableAttrAccessor::GetDefaultCellType (void ) const
pure virtual
Query to determine what the default cell-type

Returns
default type of new cells that are created in this table.
virtual UID ITableAttrAccessor::GetElementStrokeColor (const GridAddresselement,
Tables::ECellEdge edge,
bool16 * isOverride = nil,
GridArearunArea = nil 
) const
pure virtual

Determine the stroke color for the specified element on the given edge.

Parameters
elementspecifies a location within underlying grid
Returns
stroke color as a UID for given edge
Parameters
OUT,:isOverride whether result is an override attribute
OUT,:Only Valid is isOverride is true, it is the runArea area over the attribute if it is an override
virtual UID ITableAttrAccessor::GetElementStrokeGapColor (const GridAddresselement,
Tables::ECellEdge edge,
bool16 * isOverride = nil,
GridArearunArea = nil 
) const
pure virtual

Determine the stroke gap color for the specified element on the given edge.

Parameters
elementspecifies a location within underlying grid
Returns
stroke gap color as a UID for given edge
Parameters
OUT,:isOverride whether result is an override attribute
OUT,:Only Valid is isOverride is true, it is the runArea area over the attribute if it is an override
virtual bool16 ITableAttrAccessor::GetElementStrokeGapOverprint (const GridAddresselement,
Tables::ECellEdge edge,
bool16 * isOverride = nil,
GridArearunArea = nil 
) const
pure virtual

Determine whether the grid-element at the given address has an associated stroke gap overprint. This will use inheritance resolution to take account of any overrides applied.

Parameters
elementco-ordinate of cell of interest
edgespecifies which edge of the cell are to be considered
Returns
kTrue if the stroke associated with given location has gap overprint, kFalse otherwise
Parameters
OUT,:isOverride whether result is an override attribute
OUT,:Only Valid is isOverride is true, it is the runArea area over the attribute if it is an override
virtual PMReal ITableAttrAccessor::GetElementStrokeGapTint (const GridAddresselement,
Tables::ECellEdge edge,
bool16 * isOverride = nil,
GridArearunArea = nil 
) const
pure virtual

Determine for stroke gap tint associated with a grid-element. This will use inheritance resolution to take account of any overrides applied.

Parameters
elementspecifies a location within underlying grid
edgespecifies whether left, top right or bottom
Returns
the stroke-gap-tint as real-numbered value
Parameters
OUT,:isOverride whether result is an override attribute
OUT,:Only Valid is isOverride is true, it is the runArea area over the attribute if it is an override
virtual bool16 ITableAttrAccessor::GetElementStrokeOverprint (const GridAddresselement,
Tables::ECellEdge edge,
bool16 * isOverride = nil,
GridArearunArea = nil 
) const
pure virtual

Determine whether the grid-element at the given address has an associated stroke overprint. This will use inheritance resolution to take account of any overrides applied.

Parameters
elementco-ordinate of cell of interest
edgespecifies which edge of the cell are to be considered
Returns
kTrue if the stroke associated with given location has overprint, kFalse otherwise
Parameters
OUT,:isOverride whether result is an override attribute
OUT,:Only Valid is isOverride is true, it is the runArea area over the attribute if it is an override
virtual int32 ITableAttrAccessor::GetElementStrokePriority (const GridAddresselement,
Tables::ECellEdge edge 
) const
pure virtual

Returns the stroke draw priority. Larger number draws on top of smaller ones.

Returns
stroke-draw priority.
virtual PMReal ITableAttrAccessor::GetElementStrokeTint (const GridAddresselement,
Tables::ECellEdge edge,
bool16 * isOverride = nil,
GridArearunArea = nil 
) const
pure virtual

Determine for stroke tint associated with a grid-element. This will use inheritance resolution to take account of any overrides applied.

Parameters
elementspecifies a location within underlying grid
edgespecifies whether left, top right or bottom
Returns
the stroke-tint as real-numbered value
Parameters
OUT,:isOverride whether result is an override attribute
OUT,:Only Valid is isOverride is true, it is the runArea area over the attribute if it is an override
virtual ITableLineType::SType ITableAttrAccessor::GetElementStrokeType (const GridAddresselement,
Tables::ECellEdge edge,
bool16 * isOverride = nil,
GridArearunArea = nil 
) const
pure virtual

Determine the stroke type associated with specified element and given edge.

Parameters
elementspecifies location within underlying grid
edgespecifies whether left, top right or bottom
Returns
line type as one of enumerated values on ITableLineType interface
Parameters
OUT,:isOverride whether result is an override attribute
OUT,:Only Valid is isOverride is true, it is the runArea area over the attribute if it is an override
virtual PMReal ITableAttrAccessor::GetElementStrokeWeight (const GridAddresselement,
Tables::ECellEdge edge,
bool16 * isOverride = nil,
GridArearunArea = nil 
) const
pure virtual

Determine the stroke weight at a given location for specified edge.

Parameters
elementspecifies location within underlying grid
edgespecifies whether left, top right or bottom
OUT,:isOverride whether result is an override attribute
OUT,:Only Valid is isOverride is true, it is the runArea area over the attribute if it is an override
virtual UID ITableAttrAccessor::GetFillColor (const GridAddressanchor) const
pure virtual

Determine the fill of the given anchor; see GridAddress for more information on anchors versus elements.

Parameters
anchorlocation of the anchor (top-left of cell) in underlying table grid
Returns
fill color as UID
virtual bool16 ITableAttrAccessor::GetFillOverprint (const GridAddressanchor) const
pure virtual

Returns the overprint of the fill for anchor.

Parameters
anchorlocation of the anchor (top-left of cell) within the underlying grid
Returns
kTrue if there is an overprint associated with the fill at the given location, kFalse otherwise
virtual PMReal ITableAttrAccessor::GetFillTint (const GridAddressanchor) const
pure virtual
Returns the tint of the fill for anchor.

Parameters
anchorlocation of the anchor (top-left of cell) in underlying table grid
Returns
fill-tint as real-valued number
virtual PMReal ITableAttrAccessor::GetFirstColMaxLeftStrokeWeight () const
pure virtual

Determine the max effective stroke weight for the left edge of the table. For an edge to have an effective stroke it must have a non-zero stroke weight and a valid stroke type.

Returns
maximum stroke weight for the left edge of the first column
virtual PMReal ITableAttrAccessor::GetLastColMaxRightStrokeWeight () const
pure virtual

Determine the max effective stroke weight for the right edge of the table. For an edge to have an effective stroke it must have a non-zero stroke weight and a valid stroke type.

Returns
maximum stroke weight for the right edge of the last column
virtual UID ITableAttrAccessor::GetRegionalCellStyle (const GridAddresselement,
GridArearunArea = nil 
) const
pure virtual

Gets the regional cell style for the given GridAddress.

Parameters
element[IN] the address of the cell
runArea[OUT] optional, the regional style's area
Returns
the regional cell style for the given cell
virtual const AttributeBossList* ITableAttrAccessor::GetTableAttributesResolved (void ) const
pure virtual

Acquire the list of table attributes after resolving table style and overrides. Caller does not own the storage here and should not attempt to release as this is not a reference-bumped ptr that would be returned from a query.

Returns
reference to list of table attributes fully resolved.
virtual UID ITableAttrAccessor::GetTableStyle (void ) const
pure virtual

Returns the table style of this table

virtual void ITableAttrAccessor::IterateCellOverrides (CellOverridesCallbackcallBack) const
pure virtual

Function to walk all cell overrides efficiently.

Parameters
callBackCallback for iterating cell overrides. callBack.VisitRun is called for each run area See CellOverridesCallback for more info.
virtual void ITableAttrAccessor::IterateCellStrokeOverrides (Tables::ERowColumn patternType,
CellStrokeOverridesCallbackcallBack 
) const
pure virtual

Function to walk all cell stroke overrides efficiently.

Parameters
patternTypeWhether we are searching or a row or a column override
callBackCallback for iterating cell overrides. callBack.VisitRun is called for each run area See CellOverridesCallback for more info.
virtual const IPMUnknown* ITableAttrAccessor::QueryCellAttribute (const GridAddresselement,
ClassID whichAttr,
PMIID iid,
GridAreasurroundingRun = nil,
bool16 isPreserveOverride = kTrue 
) const
pure virtual

Returns cell attribute fully resolving inheritance of table style, table attribute overrides.

Parameters
elementGrid element for which attribute is to be returned.
whicAttrClassID of the attribute boss.
iidInterface ID of interface on attribute boss to be returned. The result may be cast to the 'type' identified by iid.
surroundingRunValue will be returned if non nil. Return value is the absolute value of the run that the element is in. All elements in this range have the same value for whichAttr. This can be used for optimizations.
isPreserveOverridePreserve local overrides ON or OFF. This is used to govern whether cell overrides are to be taken into consideration or not (required in EPUB/HTML export.)
virtual const IPMUnknown* ITableAttrAccessor::QueryCellOverride (const GridAddresselement,
ClassID whichAttr,
PMIID iid,
GridAreasurroundingRun = nil 
) const
pure virtual

Returns cell override WITHOUT any inheritance resolution. Returns nil if the attribute is not overriden.

Parameters
elementGrid element for which attribute is to be returned.
whicAttrClassID of the attribute boss.
iidInterface ID of interface on attribute boss to be returned. The result may be cast to the 'type' identified by iid.
surroundingRunWill be set if non nil. Is the absolute value of the run that the element is in. All elements in this range have the same value for whichAttr. This can be used for optimizations.
virtual DataWrapper<AttributeBossList> ITableAttrAccessor::QueryCellOverrides (const GridAddresselement,
GridAreasurroundingRun = nil 
) const
pure virtual

Returns all cell overrides WITHOUT any inheritance resolution.

Parameters
elementGrid element for which attribute is to be returned.
surroundingRunValue will be returned if non nil. Return value is the absolute value of the run that the element is in. All elements in this range have the same value for whichAttr. This can be used for optimizations.
virtual const IPMUnknown* ITableAttrAccessor::QueryCellStyleForAttr (const GridAddresselement,
const ClassIDwhichAttr,
const PMIIDiid,
GridAreasurroundingRun = nil 
) const
pure virtual

Queries the cell style and regional cell style for a particular attribute. The attriubte returned by this function may not be the attribute that is visible, an override may be applied to the cell.

Parameters
[IN]the cell to get the attribute for
whichAttr[IN] the cell attribute to retrieve
iid[IN] the attribute's PMIID
surroundingRun[IN] optional, the surrounding run
Returns
the attribute for the cell after resolving the cell and regional cell style hierarchies, may be nil if the attribute is not defined
virtual const IPMUnknown* ITableAttrAccessor::QueryColAttribute (int32 col,
ClassID whichAttr,
PMIID id 
) const
pure virtual

Query for column attribute, fully resolving inheritance of table style, table attribute overrides and rules. Returns interface ptr that has reference count incremented.

Parameters
colColumn for which attribute is to be returned.
whicAttrClassID of the attribute boss of interest
iidInterface ID of interface on attribute boss to be returned. The result may be cast to the 'type' identified by iid.
virtual const IPMUnknown* ITableAttrAccessor::QueryColOverride (int32 col,
ClassID whichAttr,
PMIID id 
) const
pure virtual

Query for a column override WITHOUT any inheritance resolution. Returns interface ptr that has reference count incremented

Parameters
colColumn for which attribute is to be returned.
whicAttrClassID of the attribute boss.
iidInterface ID of interface on attribute boss to be returned. The result may be cast to the 'type' identified by iid.
virtual DataWrapper<AttributeBossList> ITableAttrAccessor::QueryColOverrides (int32 col,
int32 * runLength = nil 
) const
pure virtual

Returns all column overrides WITHOUT any inheritance resolution.

Parameters
colColumn for which attribute is to be returned.
runLengthValue will be returned if non nil. Return value is the count of the columns starting with 'col' that have the same attribute. This can be used for optimizations.
Returns
collection of attribute boss ClassIDs
virtual const IPMUnknown* ITableAttrAccessor::QueryRowAttribute (int32 row,
ClassID whichAttr,
PMIID iid 
) const
pure virtual

Returns row attribute fully resolving inheritance of table style, table attribute overrides and rules.

Parameters
rowRow for which attribute is to be returned.
whicAttrClassID of the attribute boss of interest
iidInterface ID of interface on attribute boss to be returned. The result may be cast to the 'type' identified by iid.
virtual const IPMUnknown* ITableAttrAccessor::QueryRowOverride (int32 row,
ClassID whichAttr,
PMIID id 
) const
pure virtual

Query for a row override WITHOUT any inheritance resolution. Returns interface ptr that has reference count incremented.

Parameters
rowrow for which attribute is to be returned.
whicAttrClassID of the attribute boss.
iidInterface ID of interface on attribute boss to be returned. The result may be cast to the 'type' identified by iid.
virtual DataWrapper<AttributeBossList> ITableAttrAccessor::QueryRowOverrides (int32 row,
int32 * runLength = nil 
) const
pure virtual

Returns all row overrides WITHOUT any inheritance resolution.

Parameters
rowRow for which attribute is to be returned.
runLengthValue will be returned if non nil. Return value is the count of the rows starting with 'row' that have the same attribute. This can be used for optimizations.
virtual const IPMUnknown* ITableAttrAccessor::QueryTableAttribute (ClassID whichAttr,
PMIID iid 
) const
pure virtual

Query for table attribute fully resolving inheritance of table style and table attribute overrides. Get back interface ptr which has reference count incremented.

Parameters
whicAttrClassID of the attribute boss.
iidInterface ID of interface on attribute boss to be returned. The result may be cast to the 'type' identified by iid.
Returns
reference-count incremented interface ptr
virtual const ITableAttributes* ITableAttrAccessor::QueryTableOverrides (void ) const
pure virtual

Query for the list of table attribute overrides. Caller should call release.

Returns
reference-count incremented pointer.