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

#include <ICellContentMgr.h>

Inheritance diagram for ICellContentMgr:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ICELLCONTENTMGR }
 
enum  ECreateRelative {
  eNone, eLeft, eRight, eTop,
  eBottom
}
 

Public Member Functions

Main API
virtual void Create (const GridArea &area, const ECreateRelative relative)=0
 
virtual void Destroy (const GridArea &area)=0
 
virtual PMString GetName () const =0
 
virtual CellType GetType () const =0
 
Table model specific API
virtual ImplementationID GetKey () const =0
 
virtual void AttachingToTableModel (UID modelUID)=0
 
virtual TableMementoPiece * Copy (const GridArea &cells) const =0
 
virtual TableMementoPiece * Cut (const GridArea &cells)=0
 
virtual bool16 CanClear (const GridArea &cells) const =0
 
virtual void Clear (const GridArea &cells)=0
 
virtual void PrePaste (const GridAddress &atAnchor, TableMementoPiece *piece)=0
 
virtual void Paste (const GridAddress &atAnchor, TableMementoPiece *piece, TableMementoPiece *notificationPiece=nil)=0
 
virtual ITableModelQueryTableModel (void) const =0
 
virtual void ConcatenateContentForMerge (const GridArea &cells)=0
 
virtual ErrorCode Scale (const PMReal &xScale, const PMReal &yScale)=0
 
virtual void PreConcatenateContentForMerge (const GridArea &cells, const CellType &mergedCellType)=0
 
virtual UID PreConvertExtractData (GridAddress cell, const CellType destType)=0
 
virtual void PostConvertPushData (GridAddress cell, UID data)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Abstract interface, exposes API for creating and destroying cell bosses. See ITableStrand and ITableModel for more information on the table-model specific API.

Member Function Documentation

virtual bool16 ICellContentMgr::CanClear (const GridAreacells) const
pure virtual

Pre-condition to calling self.Clear

Parameters
cellsoperate on cells contained wholly within this area
virtual void ICellContentMgr::Clear (const GridAreacells)
pure virtual

Remove underlying content associated with given area. Pre: self.CanClear

Parameters
cellsoperate on cells contained wholly within this area
virtual void ICellContentMgr::ConcatenateContentForMerge (const GridAreacells)
pure virtual

Called to concatenate the content of cells to be merged.

Precondition
self.GetModel()->GetCellType(cells.GetTopLeft) == self.GetType())
Postcondition
If possible the content manager makes cells.GetTopLeft contain concatenated content of all anchors in cells that have a CellType of self.GetType. This is primarily used for merge cells behavior.
virtual TableMementoPiece* ICellContentMgr::Copy (const GridAreacells) const
pure virtual

Take copy of underlying content associated with given cells.

Parameters
cellsoperate on cells contained wholly within this area
Returns
memento that can be used in subsequent Paste operation
virtual void ICellContentMgr::Create (const GridAreaarea,
const ECreateRelative relative 
)
pure virtual

Called by core when cell-content boss objects should be created.

For instance, in a 4x4 table a call to ITableModel::InsertRows(RowRange(2,3), eAfter) will result in a call to ICellContentManager::Create(GridArea(3,0,6,4), eTop). The text content manager might use this info to propagate text attributes of row 2 to the newly created text content for row 3 through 6.

Parameters
area
relativeenum is used to indicate which edge of the GridArea the creation is relative to. The content manager may use this to decide how to propagate attributes of the content.
Precondition
area.forall(anchors | area.Contains(self.GetModel()->GetCellArea(anchor))
area.forall(anchors | self.GetModel()->GetCellType(anchor) == self.GetType())
Postcondition
Content bosses and other resource associated with content are created.
virtual TableMementoPiece* ICellContentMgr::Cut (const GridAreacells)
pure virtual

Remove underlying content associated with given area, returning a memento for pasting. Final state is as if a Destroy() was performed.

Parameters
cellsoperate on cells contained wholly within this area
Returns
memento that can be used in subsequent Paste operation
virtual void ICellContentMgr::Destroy (const GridAreaarea)
pure virtual
Precondition
area.forall(anchors | area.Contains(self.GetModel()->GetCellArea(anchor))
area.forall(anchors | self.GetModel()->GetCellType(anchor) == self.GetType())
Postcondition
All content and content bosses of cells managed by this cell content manager are destroyed.
virtual ImplementationID ICellContentMgr::GetKey () const
pure virtual
Returns
the ImplementationID of the implementing class, e.g. kTextICellContentMgrImpl for existing text cell content type
virtual PMString ICellContentMgr::GetName () const
pure virtual

Returns a user readable description of the content type, eg "Text", "Image", etc.

virtual CellType ICellContentMgr::GetType () const
pure virtual

Returns type described cell-content type. Existing possibilities are e.g. kNoContentType, kTextContentType. Note: CellType is effectively alias of ClassID.

virtual void ICellContentMgr::Paste (const GridAddressatAnchor,
TableMementoPiece * piece,
TableMementoPiece * notificationPiece = nil 
)
pure virtual

Add underlying content mapping to given location in table. PrePaste should be called before calling paste

Parameters
atAnchorspecifying location in table where content to be pasted
piecememento from previous cut or copy operation
notificationPiecenotification memento from previous cut or copy operation
virtual void ICellContentMgr::PostConvertPushData (GridAddress cell,
UID data 
)
pure virtual
Called after converting the type of cell

The content managers can preserve data with appropriate conversion, if possible. After converting cell type, the preserved object need to be push into the cell.

Parameters
cell,:cell which is going to be converted
UID,:UID of object that needs to be inserted in the cell, if possible, after cell type conversion.
virtual void ICellContentMgr::PreConcatenateContentForMerge (const GridAreacells,
const CellTypemergedCellType 
)
pure virtual

Called before calling concatenating the content of cells to be merged. The content managers can preserve data with appropriate conversion, if possible.

Parameters
cells,:cells which are going to be merged
celltype: cell type of the final merged cell
virtual UID ICellContentMgr::PreConvertExtractData (GridAddress cell,
const CellType destType 
)
pure virtual
Called before converting the type of cell

It will return the UID of object to be preserved during conversion

Parameters
cell,:cell which is going to be converted
destType,:cell type to which cell will be converted
Returns
UID: UID of object that is present in the cell, and needs to be preserved during conversion.
virtual void ICellContentMgr::PrePaste (const GridAddressatAnchor,
TableMementoPiece * piece 
)
pure virtual

This should be called before calling paste. It creates the content for pasting.

Parameters
atAnchorspecifying location in table where content to be pasted
piecememento from previous cut or copy operation
virtual ITableModel* ICellContentMgr::QueryTableModel (void ) const
pure virtual
Parameters
returnreference-count incremented pointer to table model associated with this
virtual ErrorCode ICellContentMgr::Scale (const PMRealxScale,
const PMRealyScale 
)
pure virtual

Processes commands to scale the content of cells.

Parameters
cells
xScale
yScale