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

Public Types | |
| enum | { kDefaultIID = IID_ITABLEMODEL } |
| kDefaultIID | |
Public Member Functions | |
Table Dimensions | |
| virtual RowRange | GetHeaderRows () const =0 |
| virtual GridArea | GetHeaderArea () const =0 |
| virtual RowRange | GetBodyRows () const =0 |
| virtual GridArea | GetBodyArea () const =0 |
| virtual RowRange | GetFooterRows () const =0 |
| virtual GridArea | GetFooterArea () const =0 |
| virtual RowRange | GetTotalRows () const =0 |
| virtual ColRange | GetTotalCols () const =0 |
| virtual GridArea | GetTotalArea () const =0 |
Cell spans | |
| virtual bool16 | IsAnchor (const GridAddress &element) const =0 |
| virtual GridSpan | GetCellSpan (const GridAddress &anchor) const =0 |
| virtual GridArea | GetCellArea (const GridAddress &anchor) const =0 |
| virtual GridAddress | FindCellAnchor (const GridAddress &element) const =0 |
Validators | |
| virtual bool16 | IsValid (const GridAddress &element) const =0 |
| virtual bool16 | IsValidRow (int32 row) const =0 |
| virtual bool16 | IsValidColumn (int32 col) const =0 |
| virtual bool16 | ContainsCompleteCells (const GridArea &cells) const =0 |
GridID to GridAddress conversion | |
Every element in a table has a unique GridID associated with it that does not change for the lifetime of the table. | |
| virtual GridID | GetGridID (const GridAddress &element) const =0 |
| virtual GridAddress | GetGridAddress (GridID gridID) const =0 |
Cell Content | |
| virtual boost::shared_ptr < ContentBossAccessor > | CreateContentBossAccessor (void) const =0 |
| virtual ICellContent * | QueryCellContentBoss (const GridAddress &anchor) const =0 |
| virtual ICellContentMgr * | QueryContentMgr (CellType type) const =0 |
Create segments | |
| virtual void | CreateRowSegment (const PMReal &distanceFromTableTopEdge, const ColRange &segmentCols)=0 |
| virtual void | CreateRowSegment (const PMReal &distanceFromTableTopEdge, const K2Vector< ColRange > &segmentCols)=0 |
| virtual void | CreateColSegment (const PMReal &distanceFromTableLeftEdge, const RowRange &segmentRows)=0 |
Convert to header & footer | |
| virtual void | ConvertToHeaderRows (const RowRange &rows)=0 |
| virtual bool16 | CanConvertToHeaderRows (const RowRange &rows) const =0 |
| virtual void | ConvertToFooterRows (const RowRange &rows)=0 |
| virtual bool16 | CanConvertToFooterRows (const RowRange &rows) const =0 |
| virtual void | ConvertToBodyRows (const RowRange &rows)=0 |
| virtual bool16 | CanConvertToBodyRows (const RowRange &rows) const =0 |
| virtual void | ConvertToHeaderRowsButNoAnchors (const RowRange &rows)=0 |
| virtual void | ConvertToFooterRowsButNoAnchors (const RowRange &rows)=0 |
| virtual Tables::EDirection | GetTableDirection () const =0 |
| virtual void | ChangeTableDirection (const Tables::EDirection directionRTL)=0 |
| virtual void | ConvertCellsType (const GridArea &cells, const CellType destType, bool16 tryToPreserveData=kFalse)=0 |
| virtual bool16 | CanConvertCellsType (const GridArea &cells, const CellType destType) const =0 |
| virtual CellType | GetCellType (const GridAddress &cell) 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 |
Grid and span modifiers. | |
| enum | ESplitDirection { eVerticalSplit, eHorizontalSplit } |
| enum | EDeleteState { eNotDeleting, eTableInitiatedDelete, eTextInitiatedDelete } |
| enum | EInsertState { eNotInserting, eTableInitiatedInsert, eTextInitiatedInsert } |
| virtual void | InsertRows (const RowRange &rows, const Tables::ERelativePosition pos, const PMReal &height, const Tables::EContinuation continuation=Tables::eStructureAllAttrs)=0 |
| virtual void | InsertRowsButNotAnchors (const RowRange &rows, const Tables::ERelativePosition pos, const PMReal &height, const Tables::EContinuation continuation=Tables::eStructureAllAttrs)=0 |
| virtual void | InsertColumns (const ColRange &cols, const Tables::ERelativePosition pos, const PMReal &width, const Tables::EContinuation continuation=Tables::eStructureAllAttrs)=0 |
| virtual void | DeleteRows (const RowRange &rows)=0 |
| virtual void | DeleteRowsButNotAnchors (const RowRange &rows)=0 |
| virtual void | DeleteColumns (const ColRange &cols)=0 |
| virtual void | MergeCells (const GridArea &area)=0 |
| virtual bool16 | CanMergeCells (const GridArea &area) const =0 |
| virtual void | UnmergeCell (const GridAddress &anchor)=0 |
| virtual void | SplitCells (const GridArea &cells, ESplitDirection direction)=0 |
| virtual bool16 | CanSplitCells (const GridArea &cells, ESplitDirection direction) const =0 |
| virtual EDeleteState | DeleteState () const =0 |
| virtual EInsertState | InsertState () const =0 |
Iteration | |
| typedef CellIterator< ITableModel > | const_iterator |
| typedef CellIterator< ITableModel > | iterator |
| typedef ReverseCellIterator < ITableModel > | reverse_iterator |
| typedef ReverseCellIterator < ITableModel > | const_reverse_iterator |
| virtual const_iterator | begin () const =0 |
| virtual const_iterator | begin (const GridArea &area) const =0 |
| virtual const_iterator | end () const =0 |
| virtual const_iterator | end (const GridArea &area) const =0 |
| virtual const_iterator | make_iterator (const GridAddress &gridRef) const =0 |
| virtual const_reverse_iterator | rbegin () const =0 |
| virtual const_reverse_iterator | rbegin (const GridArea &area) const =0 |
| virtual const_reverse_iterator | rend () const =0 |
| virtual const_reverse_iterator | rend (const GridArea &area) const =0 |
| virtual const_reverse_iterator | rmake_iterator (const GridAddress &gridRef) const =0 |
Copy-paste | |
| enum | EWhatState { eTableAttrsStyle = 0x01, eRowAttrs = 0x02, eColAttrs = 0x04, eCellAttrs = 0x08, eCellContent = 0x10, eCells = 0x18, eAll = 0x1f } |
| virtual bool16 | CanCopy (const GridArea &cells) const =0 |
| virtual TableMemento * | Copy (const GridArea &cells) const =0 |
| virtual bool16 | CanClear (const GridArea &cells) const =0 |
| virtual void | Clear (const GridArea &cells)=0 |
| virtual void | Paste (const GridAddress &atAnchor, EWhatState what, TableMemento *toAdopt)=0 |
| virtual void | Paste (const GridAddress &atAnchor, EWhatState what, TableMemento *toAdopt, bool16 clearRedundantRows)=0 |
| virtual bool16 | CanPaste (const GridAddress &atAnchor, const GridSpan &mementoSpan, const ITableModel *sourceTable, const GridAddress &fromAnchor) const =0 |
Public interface exposing the table model.
The table model allows content to be arranged into rows and columns of cells. The rows and columns in the table form a grid which is used for addressing. Each element in the grid is addressed by a GridAddress(row, column).
For instance, a GridAddress (1, 2) refers to the grid element in row 1, column 2. A table has a set of header, body and footer rows. The rows in a table are grouped in this order. Header rows, then body rows followed by footer rows. There should be at least one body rows. Header and footer rows may have a count of zero. Valid row values are in the row range represented by GetTotalRows. Valid column values are in the column range represented by GetTotalCols.
One or more elements can be grouped together to form a "cell". Cells have content and may span multiple rows and columns, i.e. multiple elements in the grid. The extent of a cell is represented by its GridSpan.
A "trivial cell" has a (row, column) span of (1, 1). Every element in the grid maps to at most one cell. The topLeft element of a cell is called an anchor. A cell is addressed by the GridAddress of it's anchor.
Also see ITableAttrModifier and ITableAttrAccessor.
Used to traverse through the GridAddress locations within a table model
Used to traverse (in reverse direction) through the GridAddress locations within a table model
| typedef CellIterator<ITableModel> ITableModel::iterator |
Used to traverse through the GridAddress locations within a table model
Used to traverse (in reverse direction) through the GridAddress locations within a table model
Used to specify different states relating to table deletion.
Used to specify different states relating to table insertion.
| pure virtual |
Use to acquire an iterator that refers to the cell at the start of the table structure, i.e. GridAddress(0,0).
| pure virtual |
Use to acquire an iterator that refers to cell at the start of the GridArea specified.
| area | specifies dimension of grid-elements covered of interest |
| pure virtual |
Precondition for self.Clear
| cells |
| pure virtual |
Returns kTrue if ConvertCellsType() can be called, kFalse otherwise.
| cells | GridArea of cells to be converted |
| destType | cell type to be converted into |
| pure virtual |
Determine if the given rows can be converted to body rows. All body rows are maintained in one contiguous range after all header rows and before all footer rows.
| rows | specifies the header or footer rows to be converted to body rows. |
| pure virtual |
Determine if the given rows can be converted to footer rows. All footer rows are maintained in a contiguous range after all body rows.
| rows | specifies the body rows to be converted to footer rows. |
| pure virtual |
Determine if the given rows can be converted to header rows. All header rows are maintained in a contiguous range before all body rows.
| rows | specifies the body rows to be converted to header rows. |
| pure virtual |
Determine if a given area within the table can be copied.
| cells | specifies the dimension of the area containing cells of interest |
| pure virtual |
Determine if the given area is appropriate for a merge-cells operation.
| area | specifies dimension of area containing cells of interest |
| pure virtual |
Determine if a memento of mementoSpan can be pasted location specified by atAnchor.
| atAnchor | specifies location of interest |
| mementoSpan | gives the dimension (height,width) of cell to be pasted |
| memento | give the structure to ensure complete cells in sets to paste into |
| pure virtual |
This method is obsolete. Please use CanSplitCells. Determine whether a particular cell can be split.
| anchor | location of the cell |
| direction | specify whether vertical or horizontal split of interest |
| cells | area of cells to split, does not need to contain complete cells |
| direction | specify whether vertical or horizontal split of interest |
| pure virtual |
Changes the table direction.
| directionRTL | Direction to change table. |
| pure virtual |
Clears the content in cells.
| cells |
| pure virtual |
Determine if the specified area can be decomposed into a set of complete cells. The cells will be complete iff all the grid-elements that compose a cell are contained within the area. See the documentation for GridAddress for more material on distinction between grid-elements and cells.
| pure virtual |
Method to convert the type of cells
| cells | GridArea of cells to be converted |
| destType | cell type to be converted into |
| tryToPreserveData | if true, the data is preserved into the cell after converion, if possible. |
| pure virtual |
Converts header or footer rows to body rows.
| rows | to convert to body rows. |
| pure virtual |
Converts body rows to footer rows.
| pure virtual |
For Internal use.
| pure virtual |
Converts body rows to header rows.
| rows | to be converted to headers. |
| pure virtual |
For Internal use.
| pure virtual |
Returns a TableMemento representing the internal state of the cells.
This may be restored with a corresponding Paste call. Caller is responsible for deleting storage of the returned memento.
| cells | specifies the dimension of the area containing cells to copy |
| pure virtual |
Creates col segment.
| distanceFromTableLeftEdge | specifies segment pos, relative to left edge of the table |
| segmentRows | specifies the range of rows within the table for the new segment |
| pure virtual |
Efficient access to content bosses. Typical usage:
<pre>
boost::shared_ptr<ContentBossAccessor> cbAccessor(table->CreateContentBossAccessor()); cbAccessor->QueryCellContentBoss(anchor); The returned ContentBossAccessor cannot be used across structure changes specifically row and column insertion or deletion. The following sequence would be illegal.
| pure virtual |
Creates row segment.
| distanceFromTableTopEdge | specifies segment pos, relative to top edge of the table |
| segmentCols | specifies the range of columns within the table for the new segment |
| pure virtual |
Creates row segment.
| distanceFromTableTopEdge | specifies segment pos, relative to top edge of the table |
| segmentCols | specifies the vector of the range of columns within the table for the new segment(s) |
| pure virtual |
Delete (cols.count) columns starting from the column at (cols.start).
| cols | gives range of columns to remove from table |
| pure virtual |
Delete the number (rows.count) rows starting from the position (rows.start).
| rows | specifies the range of rows to remove from this table |
| pure virtual |
Delete the number (rows.count) rows starting from the row given by (rows.start), leaving the anchor characters behind.
This is meant to be called when deleting a table via a text deletion. In this case it is undesirable for the table to delete the anchor characters.
| rows | specifies the range of rows to remove from the table |
| pure virtual |
Find out if who intitiated the delete of the table. Might be in states such as: not-deleting, text-deleting or table-deletnig.
| pure virtual |
Use to acquire an iterator that refers to cell just off the end of the whole table. Use this when the iteration should end at the last cell.
| pure virtual |
Use to acquire an iterator that refers to the last cell for traversal through specified GridArea.
| area | specifies dimension of grid-elements covered of interest |
| pure virtual |
Returns the anchor (top-left location) of the cell this element is in.
| element | specifies the grid-element for this query |
| pure virtual |
| pure virtual |
| pure virtual |
Returns the absolute location of the elements the cell consists of. i.e.
GridArea(anchor, this->GetCellSpan())
| anchor | specifies the location for the cell query is about |
| pure virtual |
| pure virtual |
Get the type of cell (kTextContentType, kPageItemContentType etc.)
| cells | GridArea of cells to be converted |
| pure virtual |
| pure virtual |
| pure virtual |
The gridID should have been obtained by a previous call to GetGridID.
| pure virtual |
| pure virtual |
| pure virtual |
| pure virtual |
Accessor for the table direction.
| pure virtual |
| pure virtual |
| pure virtual |
| pure virtual |
Inserts cols.count columns before or after cols.start depending on pos.
Width is in points. If colWidth is 0.0 then the new width is determined from the column relative to which the insertion is being made. A non zero value of width will result in all inserted columns having that width.
[Documentation note for width semantics: Update ITableSuite.h & ITableCommands.h to reflect changes.]
| cols | specifies the range of columns within the table for the insertion, if this is not an empty range then the rows will be replaced |
| pos | Specifies the relative position, before or after the given range in the table |
| height | desired column height in points |
| continuation | one of enumerated constants specifying how existing table properties should apply to these new rows |
| pure virtual |
Inserts rows.count rows before or after rows.start depending on pos.
Height is in points. If rowHeight is 0.0 then the row height is determined by the auto-grow and minimum row height attribute of the row relative to which the insertion is being made. A non zero value of height will result in all inserted rows having that minimum height.
[Documentation note for height semantics: Update ITableSuite.h & ITableCommands.h and ITableUtils.h to reflect changes.]
| rows | specifies the range of rows within table for the insertion, if this is not an empty range then the rows will be replaced |
| pos | Specifies the relative position, before or after the given range in the table |
| height | desired row height in points |
| continuation | one of enumerated constants specifying how existing table properties should apply to these new rows |
| pure virtual |
Inserts rows.count rows before or after rows.start depending on pos.
This is meant to be called when we already have anchors for the rows we are adding, such as the case where we are coping a text frame containing part of a table
| rows | specifies the range of rows within table for the insertion, if this is not an empty range then the rows will be replaced |
| pos | Specifies the relative position, before or after the given range in the table |
| height | desired row height in points |
| continuation | one of enumerated constants specifying how existing table properties should apply to these new rows |
| pure virtual |
Whether we should insert anchors with these rows or not
| pure virtual |
Accessor to determine if a given location is an anchor cell.
| element | Identifies the grid element to be tested. |
| pure virtual |
Determine if element at the given location is within the range of elements in the underlying table grid.
| pure virtual |
Determine if given column lies within columns spanned by this table.
| pure virtual |
Determine if a given row lies within the range of rows spanned by this table.
| pure virtual |
Acquire a forward iterator.
| pure virtual |
Merges the elements specified by area. This function makes the anchor identified by (area.TopLeft) span all elements in 'area'.
| area | Specifies a rectangle of elements in the grid to be merged. |
| pure virtual |
Accepts the TableMemento created by a previous call to Copy and applies into the model at atAnchor.
Ownership of storage is transferred from the caller to the implementation of Paste.
| atAnchor | location at which to paste |
| what | specifies what properties to transfer |
| toAdopt |
| pure virtual |
Use ContentBossAccessor for accessing a range of cells. QueryCellContentBoss is not as efficient as the ContentBossAccessor.
| anchor | refers to location of cell for which content boss object is sought |
| pure virtual |
Access to content managers.
| type | The type of cell you wish the manager for |
| pure virtual |
Acquire a (reverse) iterator that can be used for a traversal of cells in reverse order via ++ starting at the specified location.
| pure virtual |
Acquire a (reverse) iterator for delimiting end of traversal of cells in reverse order (via ++). This will normally be the beginning of the collection.
| pure virtual |
Acquire a (reverse) iterator for delimiting end of traversal of cells in reverse order (via ++). This will normally be the beginning of the collection.
| pure virtual |
Acquire a (reverse) iterator for delimiting the end of an iteration that ends at the given location.
| pure virtual |
Acquire a (reverse) iterator.
| pure virtual |
This method is obsolete. Please use SplitCells. Split the cell in half vertically or horizontally.
| pure virtual |
Anchor specifies a non-trivial cell to be unmerged. This function will make all elements spanned by the anchor trivial cells.