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

Classes | |
| class | CellChunk |
Public Types | |
| enum | { kDefaultIID = IID_ITABLEUTILS } |
| enum | ESetTextSelection { eNoSelection, eSetSelectionInFirstCell } |
Public Member Functions | |
| virtual UIDRef | ConvertTextToTable (ITextModel *textModel, const Text::StoryRange &textRange, const PMString colSeparator="\t", const PMString rowSeparator="\r", const int32 userNumCols=1, const UID &tableStyleUID=kInvalidUID) const =0 |
| virtual UIDRef | ConvertTextToTable (ITextModel *textModel, const Text::StoryRange &textRange, const K2Vector< PMString > &colSeparators, const K2Vector< PMString > &rowSeparators, const int32 userNumCols=1, const UID &tableStyleUID=kInvalidUID) const =0 |
| virtual void | InsertTable (ITextModel *textModel, TextIndex index, int32 len, int32 numRows, int32 numCols, const PMReal &rowHeight, const PMReal &colWidth, CellType cellType, const ESetTextSelection setSelection, const UID &tableStyle=kInvalidUID) const =0 |
| virtual void | InsertTable (ITextModel *textModel, TextIndex index, int32 len, int32 numRows, int32 numCols, int32 numHeaderRows, int32 numFooterRows, const PMReal &rowHeight, const PMReal &colWidth, CellType cellType, const ESetTextSelection setSelection, const UID &tableStyle=kInvalidUID, Tables::EDirection direction=Tables::eLTR) const =0 |
| virtual UIDRef | GetTableModel (ITextModel *text, TextIndex index) const =0 |
| virtual UID | GetRootTableStyle (IDataBase *db) const =0 |
| virtual K2Vector< CellChunk > * | GetCellChunks (const GridArea selection, const ITableModel *tableModel) const =0 |
| virtual void | CalculateDefaultCellBounds (const ITextModel *textModel, TextIndex insertLocation, int32 numRows, int32 numCols, PMReal &rowHeight, PMReal &colWidth) const =0 |
| virtual Tables::ESelectionSides | CalculateSides (const ITableTarget *tableTarget) const =0 |
| virtual ErrorCode | CreateCellScriptObject (const RequestContext &context, const GridArea &area, const ITableModel *tableModel, ScriptList *objectList)=0 |
| virtual ErrorCode | CreateCellScriptObject (const RequestContext &context, const GridArea &area, const ITableModel *tableModel, ScriptList *objectList, IScript *parent)=0 |
| virtual ErrorCode | CreateRowScriptObject (const RequestContext &context, GridCoord row, const ITableModel *tableModel, ScriptList *objectList, IScript *parent)=0 |
| virtual ErrorCode | CreateColumnScriptObject (const RequestContext &context, GridCoord col, const ITableModel *tableModel, ScriptList *objectList, IScript *parent)=0 |
| virtual ErrorCode | CreateTableScriptObject (const RequestContext &context, const ITableModel *tableModel, ScriptList *objectList)=0 |
| virtual IScript * | CreateTableScriptObject (const RequestContext &context, const ITableModel *tableModel)=0 |
| virtual ErrorCode | ProcessCreateTableStyle (const PMString &styleName, const AttributeBossList *styleAttributes, IDataBase *dbOfStyleNameTable, UID &outNewStyleUID) const =0 |
| virtual bool16 | IsStyleNamePresent (const PMString &styleName, IDataBase *dbOfStyleNameTable) const =0 |
| virtual PMPoint | ConvertToLocalPoint (const ITableFrame *tableFrame, const PBPMPoint &pt) const =0 |
| virtual bool16 | InsideTable (const ITextModel *textModel, TextIndex at) const =0 |
| virtual TextIndex | TableToPrimaryTextIndex (const ITextModel *textModel, TextIndex withinTableTextIndex) const =0 |
| virtual RangeData | TableToPrimaryTextRange (const ITextModel *textModel, RangeData tableRange) const =0 |
| virtual bool16 | DictGetIsComposable (const ITextStoryThreadDict *dict, uint32 dictKey) const =0 |
| virtual ParcelKey | DictGetParcelKeyOfControllingAnchor (const ITextStoryThreadDict *dict, uint32 dictKey, ParcelKey keyInChildThread) const =0 |
| virtual GridArea | FixUpTableSelection (const GridArea selection, const ITableModel *model) const =0 |
| virtual bool16 | CanInsertTableAt (const ITextModel *textModel, TextIndex at) const =0 |
| virtual ParcelKey | GetHFProxyParcelKey (const ICellContent *cell, ParcelKey key) const =0 |
| virtual bool16 | GetHFTextRangeContext (const ITextModel *textModel, TextIndex at, RangeData *pFrameBodyRange, RangeData *pTableBodyRange) const =0 |
| virtual IPlaceBehavior * | QueryPageItemCellPlaceBehavior (const ITableModel *tableModel, GridAddress cellAddress)=0 |
| virtual IPlaceBehavior * | QueryPageItemCellPlaceBehavior (UIDRef tableModel, GridAddress cellAddress)=0 |
| virtual bool16 | IsTableCellContent (const UIDRef &item, UID &pageItemAdapter) const =0 |
| virtual bool16 | IsTableCellContent (const UIDRef &item, UID *pageItemAdapter=nil)=0 |
| virtual void | ValidateContent (UIDList &items) const =0 |
| virtual CellType | GetCellContentType (UIDRef tableModel, GridAddress cellAddress) const =0 |
| virtual ICellContent * | QueryCellContentfromPlacedItem (UIDRef placedItem) const =0 |
| virtual bool16 | CanConvertToGraphicCell (UIDRef tableModel, const GridAddress &cellAddress) const =0 |
| virtual bool16 | CanConvertInlineCellToImageCell (const ITableModel *table, const GridAddress &cell) const =0 |
| virtual bool16 | HasAnyTextCell (ITableModel *tableModel, const GridArea &area) const =0 |
| virtual bool16 | HasAnyGraphicCell (ITableModel *tableModel, const GridArea &area) const =0 |
| virtual bool16 | CanPlaceInGraphicCell (UIDRef item, ErrorCode *err=NULL) const =0 |
| virtual ErrorCode | ResizeTableFrame (ITableFrame *tableFrame, const PMReal &horizonProp, const PMReal &verticalProp)=0 |
| virtual ErrorCode | ResizeTableFrame (ITableFrame *tableFrame, PMRect tableArea, const int32 numRowsInFrame, const int32 numColumnsInFrame, ColRange columnsInFrame, const PMReal &horizonProp, const PMReal &verticalProp)=0 |
| virtual void | SetMinRowHeight (ITableModel *table, int32 row, int32 howMany, const PMReal &height)=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
Table related utility functions. Some of these are not new selection-architecture compliant and should be approached with caution.
Used to specify whether text caret should be placed in first cell when a new table is created.
| pure virtual |
Calculate default sizes for cells in a table to be created. Attempts to calculate a reasonable sized bounding box for a table that might be placed in a textflow.
| textModel | refers to the text model into which this table might later be placed. |
| insertLocation | specifies the index within the text model where a table might be placed. |
| numRows | count of rows in prospective table |
| numCols | count of columns in prospective table |
| rowHeight,out-parameter,holds | the calculated row-height given the input |
| colWidth,out-parameter,holds | the calculated column-width given the input |
| pure virtual |
Determine how many sides in the selection are selected. This method attempts to calculate how many sides are selected, e.g. when applying strokes to the selection. Returns the sides which can be active in the selection Returns a Tables::ESelectionSides which represents the sides the selection contains
| tableTarget | refers to the table selection |
| pure virtual |
Check if a text cell with inline, can be converted into a graphic cell with inline object placed inside it
| tableModel | table to query from |
| cellAddress | cell to query for |
| pure virtual |
Check if any cell can be converted into graohic cell
| tableModel | table to query from |
| cellAddress | cell to query for |
| pure virtual |
Not all TextStoryThreads can properly host a Table. This method will tell the caller if the specified TextIndex and do so.
| textModel | |
| TextIndex |
| pure virtual |
Method to convert tab-delimited text into a table. Wrapper around execution of the kTextToTableCmdBoss command which simplifies process of converting delimited text into a table.
| textModel | specifies the text model containing text to convert to table |
| textRange | delimits the range of text characters to transform into table |
| colSeparator | specifies delimiter for columns |
| rowSeparator | specifies delimiter for rows |
| userNumCols | specifies number of columns in table if colSeparator equals rowSeparator, otherwise ignored |
| tableStyleUID | [IN] optional, the table style to use for the new table, if this is kInvalidUID, the root table style is used |
| pure virtual |
Same as above method except params 3 and 4 are vectors of seperators instead of individual strings
| colSeparators | vector of strings that can be used interchangably as seperators for the columns |
| rowSeparators | vector of strings that can be used interchangably as seperators for the rows |
| pure virtual |
Convert pasteboard points to table frames' local points. Used for hit testing so it has some small adjustments to the rect of table frame. Will constrain to table frame if within 3 units of table frame stroke bounding box. Currently used in TableFrameEventAction and TableFrameOwnedItemIBeamData
| tableFrame | pointer of the table frame |
| pt | Pasteboard coordinates |
| pure virtual |
Creates an instance of an object (e.g. of class kScriptCellRefBoss) that can be used to manipulate a region of a table.
| context | is the request context |
| area | delimits the area of interest within the table |
| tableModel | table of interest that this object will manipulate |
| objectList | effectively holds the [out] parameter, an interface ptr (of type IScript) is appended to this list |
| parent | the parent of the script DIFFERENCE IN TWO VERSIONS OF FUNCTION, one has this one doesn't |
| pure virtual |
| pure virtual |
| pure virtual |
| pure virtual |
| pure virtual |
| pure virtual |
Adobe internal use only. Do not use. Will be removed.
| pure virtual |
This is the code which cleans up a selection area into a selection which best represents the selection which is drawn It does 2 things, the first is to Shrink the selection to the first anchor and the last anchor selected, the second is to fix up the selection so it contains as many whole cells as possible (if you select 2 adjacent anchors of congruent anchors it will extend the selection to contain both whole cells)
| pure virtual |
Takes the given GridArea and turns it into chunks of complete cells.
| selection | specifies the area of the table that is to be turned into cell-chunks. |
| tableModel | refers to the table model from which the cells are going to be chunked. |
| pure virtual |
Get the cell type of any specific cell
| tableModel | tbale to query from |
| cellAddress | cell to query for |
| pure virtual |
| cell | Pointer to TextCell boss. |
| key | Of the Parcel containing the text content |
| pure virtual |
This method provides context information for a TextIndex which is in a Header or Footer cell. If it returns kTrue, then pFrameBodyRange will be set to the Text Range of the drawing TableFrame.
| textModel | |
| at | |
| pFrameBodyRange | Pointer to RangeData that will be filled in with drawing TableFrames body rows. |
| pTableBodyRange | Pointer to RangeData that will be filled in with Table's Text range. |
Query for root table style by UID.
| pure virtual |
Acquire a table model ref given a text model and a starting point in the text model.
Attempts to return a persistent reference (UIDRef) for a table model, given a text model and an index within the model that is located within a story thread for a cell in the table. Will find a table model if the index is inside of a cell. Will find a table model if index points to a frame anchor or points to an anchor character embedded inside a frame anchor.
| text | reference to text model that contains a table |
| index | should be an index in the text model that is text within a cell |
ownedItemStrand = text.QueryInterface(IID_IITEMSTRAND)
result <> UIDRef::gNull implies
indices->exists(i | ownedItemStrand.GetOwnedUID(i, kFrameAnchorBoss) <> kInvalidUID
result = UIDRef::gNull implies
ownedItemStrand.GetOwnedUID(index, kFrameAnchorBoss) = kInvalidUID
| pure virtual |
Returns kTrue if there is any graphic cell in the grid area specified, kFalse otherwise
| tableModel | tableModel to query from |
| area | GridArea of cells to query for |
| pure virtual |
Returns kTrue if there is any text cell in the grid area specified, kFalse otherwise
| tableModel | tableModel to query from |
| area | GridArea of cells to query for |
| pure virtual |
Method to insert a table into a text flow. Height is measured in points. If rowHeight = 0.0 then the row height is determined by the size of the content because auto-grow is on for all rows. A non zero value of height will result in all rows having that minimum height.
| textModel | refers to the text model into which this table might later be placed. |
| index | index within the text model for the start of the span to be replaced |
| len | span of characters in the model to be replaced by the table |
| numRows | specifies number of rows in the new table |
| numCols | specifies number of columns in the new tables |
| rowHeight | specifies the desired row height in points |
| colWidth | specifies the desired row height in points |
| cellType | specifies type of cell, e.g. kTextCellContentType |
| setSelection | specifies whether caret is going to be in first cell or not |
| tableStyle | [IN], optional the table style to use for the new table, if this is kInvalidUID the root table style will be used |
| pure virtual |
Same as above, only this takes three addition parameters. Two after the number of rows and columns – the number of headers and footers One after tableStyle-
| direction | specifies direction of table |
| pure virtual |
Return whether the given text index is within a table or not.
| textModel | specifies the text model containing the table |
| at | the TextIndex in question. |
| pure virtual |
Returns kTrue if a table style with styleName exists in ITableStyleNameTable on the workspace associated with the database dbOfStyleNameTable.
| styleName | Name of style to check for |
| dbOfStyleNameTable | Database whose associated workspace should be checked |
| pure virtual |
This method checks is item is inside any table cell.
| item | which we want |
| pure virtual |
This method checks is item is inside any table cell.
| item | which we want |
| pure virtual |
Creates a new table style and adds it to the table style name table.
| styleName | Name of the style. Should be non empty. Style name strings are not tranlsated. Pre: self.IsStyleNamePresent(styleName) == kFalse |
| styleAttributes | Attributes of the table style. All attributes in the list should an ITableAttrReport implementaion. |
| dbOfStyleNameTable | The style is owned by the style name table that's on the workspace boss of this database. |
| outNewStyleUID | Out argument. If return is kSuccess this is the tUID of the table style created. |
| pure virtual |
This method first checks if placed item is placed in a cell. If yes, then it will return pointer to it's ICellContent.
| Ref | of item placed in cell. |
| pure virtual |
This method first triggers the conversion of cell to a graphic cell, if it is not a graphic cell. Then, it finds out the object inside page item cell & returns it place behavior. This API is use to directly place an object inside text cell
| tableModel | whose place behavior we wish to know |
| pure virtual |
This method first triggers the conversion of cell to a graphic cell, if it is not a graphic cell. Then, it finds out the object inside page item cell & returns it place behavior. This API is use to directly place an object inside text cell
| tableModel | whose place behavior we wish to know |
| pure virtual |
Return the text index (in the primary story thread) of the anchor representing the table which contains the given text index. If the text index parameter is not in a table, the unchanged parameter is the return value.
| textModel | specifies the text model containing the table |
| withinTableTextIndex | the TextIndex in question - must be within a table. |
| pure virtual |
Return the text range (in the primary story thread) of the anchor representing the table which contains the given text range. If the range parameter is not in a table, the unchanged parameter is the return value.
| textModel | specifies the text model containing the table |
| tableRange | the range in question - must be within a table. |
| pure virtual |
This method performs validation on content of page item cells. i.e if they have valid bounds or not. And if not, then it will ask cell to have minimum size bounds.
| items | list of items to validate |