InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ITableCommands.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Mat Marcus
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __ITableCommands__
25 #define __ITableCommands__
26 
27 #include "TablesID.h"
28 #include "TableTypes.h"
29 #include "ICellStrokeAttrData.h"
30 #include "ITableModel.h"
31 
32 class AttributeBossList;
33 class TableMementoPiece; // $$$ should not be in the API
34 class WideString;
35 class ICommand;
36 
41 class ITableCommands : public IPMUnknown
42 {
43 public:
44  enum { kDefaultIID = IID_ITABLECOMMANDS };
45 
46 
48 
49 
81  virtual ErrorCode InsertRows(const RowRange& rows, const Tables::ERelativePosition pos, const PMReal& height, const Tables::EContinuation continuation = Tables::eStructureAllAttrs) = 0;
82 
94  virtual ErrorCode MoveRows(ITableModel* sourceTable, GridArea fromArea, int32 toRow, Tables::ERelativePosition pos, bool16 duplicateFlag) = 0;
95 
107  virtual ErrorCode MoveColumns(ITableModel* sourceTable, GridArea fromArea, int32 toColumn, Tables::ERelativePosition pos, bool16 duplicateFlag) = 0;
108 
130  virtual ErrorCode InsertColumns(const ColRange& cols, const Tables::ERelativePosition pos, const PMReal& width, const Tables::EContinuation continuation = Tables::eStructureAllAttrs) = 0;
131 
140  virtual ErrorCode DeleteRows (const RowRange& rows) = 0;
141 
156  virtual ErrorCode DeleteRowsButNotAnchors(const RowRange& rows) = 0;
157 
168  virtual ErrorCode DeleteColumns(const ColRange& cols) = 0;
169 
175  virtual ErrorCode MergeCells (const GridArea& cells) = 0;
176 
185  virtual ErrorCode UnmergeCell (const GridAddress& anchor) = 0;
186 
193 // virtual ErrorCode SplitCell(const GridAddress& anchor, const ITableModel::ESplitDirection splitDirection) = 0;
194 
200  virtual ErrorCode SplitCells (const GridArea& cells, const ITableModel::ESplitDirection splitDirection) = 0;
201 
202  /* Method to change table direction from LeftToRight to RightToLeft
203  @param directionRTL direction to change to
204  @return kSuccess command executed successfully
205  */
206  virtual ErrorCode ChangeTableDirection(Tables::EDirection directionRTL) = 0;
207 
209 
211 
212 
229  virtual ErrorCode ResizeRows (const RowRange& rows, const PMReal& newHeight) = 0;
230 
238  virtual ErrorCode ResizeCols (const ColRange& cols, const PMReal& newWidth) = 0;
239 
249  virtual ErrorCode ApplyRowOverrides(const RowRange& rows, const AttributeBossList* attrs) = 0;
250 
260  virtual ErrorCode ApplyColOverrides(const ColRange& cols, const AttributeBossList* attrs) = 0;
261 
285  virtual ErrorCode ApplyCellStrokes(const GridArea& area, const ICellStrokeAttrData::Data& data) = 0;
286 
305  virtual ErrorCode ClearCellStrokes(const GridArea& area, const ICellStrokeAttrData::Data& data) = 0;
306 
313  virtual ErrorCode ClearCellStrokesUISafe(const GridArea& area, const ICellStrokeAttrData::Data& data) = 0;
314 
324  virtual ErrorCode SwapCellStrokeFill(const GridArea& cells) = 0;
325 
334  virtual ErrorCode ApplyCellOverrides(const GridArea& cells, const AttributeBossList* attrs) = 0;
335 
345  virtual ErrorCode ClearCellOverrides(const GridArea& cells, const AttributeBossList* attrs) = 0;
346 
355  virtual ErrorCode ApplyTableOverrides(const AttributeBossList* attrs) = 0;
356 
364  virtual ErrorCode SetTableStyle(const UIDRef& styleRef) = 0;
365 
373  virtual ErrorCode ClearBorderOverrides(Tables::ECellEdge edge, const AttributeBossList* attrs) = 0;
374 
390  virtual ErrorCode ClearCellOverridesUISafe(const GridArea& cells, const AttributeBossList* attrs) = 0;
391 
393 
394  // Attributes -- returns a command to be processed
396 
397 
403  virtual ICommand* QueryApplyCellStrokesCmd(const GridArea& area, const ICellStrokeAttrData::Data& data) = 0;
409  virtual ICommand* QueryClearCellStrokesCmd(const GridArea& area, const ICellStrokeAttrData::Data& data) = 0;
421  virtual ICommand* QueryClearCellStrokesUISafeCmd(const GridArea& area, const ICellStrokeAttrData::Data& data) = 0;
427  virtual ICommand* QueryApplyCellOverridesCmd(const GridArea& cells, const AttributeBossList* attrs) = 0;
429 
431 
432 
439  virtual ErrorCode SetCellText(const WideString& cellText, const GridAddress& anchor) = 0;
440 
445  virtual ErrorCode ClearContent(const GridArea& cells) = 0;
446 
448 
450 
451 
455  virtual ErrorCode RegisterStrand(const UIDRef& strandRef) = 0;
456 
462  virtual ErrorCode RegisterContentMgr(CellType contentMgrType, const UIDRef& contenMgr) = 0;
463 
465 
467 
468 
474  virtual ErrorCode CreateRowSegment(const PMReal& distanceFromEdge, const ColRange& segmentRange) = 0;
475 
482  virtual ErrorCode CreateColSegment(const PMReal& distanceFromEdge, const RowRange& segmentRange) = 0;
484 
485 
487 
488 
492  virtual ErrorCode ConvertToHeaderRows(const RowRange& rows) = 0;
493 
497  virtual ErrorCode ConvertToFooterRows(const RowRange& rows) = 0;
498 
502  virtual ErrorCode ConvertToBodyRows(const RowRange& rows) = 0;
503 
505 
506 
508 
509 
514  virtual ErrorCode ConvertTableToText(const PMString colSeparator="\t", const PMString rowSeparator="\r") = 0;
515 
520  virtual ICommand* QueryDeleteTableCmd(const UIDRef& tableRef) = 0;
521 
529  virtual ErrorCode ConvertCellsType(const GridArea& cells, CellType destType, bool16 tryToPreserveData = kFalse) = 0;
530 
539  virtual ErrorCode PastePageItem(const GridAddress &anchor, UIDRef pageItemUID, bool16 preventCopy = kFalse) = 0;
540 };
541 
542 #endif // __ITableCommands__