InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CCellContent.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: dwaterfa
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 __CCellContent__
25 #define __CCellContent__
26 
27 #include "ICellContent.h"
28 #include "CPMUnknown.h"
29 #include "ITableLayout.h"
30 
31 
32 class CCellContent : public CPMUnknown<ICellContent>
33 {
34 public:
35  CCellContent(IPMUnknown *boss);
36 
37  virtual void SetTableModel(const UIDRef& tableModelRef)
38  { fTableModelRef = tableModelRef; }
39 
40  virtual UIDRef GetTableModel() const
41  { return fTableModelRef; }
42 
43  virtual void SetGridID(const GridID& gridID)
44  { fGridID = gridID; }
45 
46  virtual GridID GetGridID() const
47  { return fGridID; }
48 
49  virtual void SetGridAddress(const GridAddress& gridAddress)
50  { fGridAddress = gridAddress; }
51 
52  virtual GridAddress GetGridAddress() const
53  { return fGridAddress; }
54 
55  virtual PMRect GetCellPathBounds(ParcelKey key) const
56  {
57  InterfacePtr<const ITableLayout> layout(fTableModelRef, UseDefaultIID());
58  return layout->GetCellParcelPathBounds(fGridAddress, key);
59  }
60 
61  virtual UID GetParcelFrameUID(ParcelKey key) const
62  {
63  InterfacePtr<const ITableLayout> layout(fTableModelRef, UseDefaultIID());
64  return layout->GetParcelTextFrameUID(fGridAddress, key);
65  }
66 
67  virtual PMMatrix GetParcelToFrameMatrix(ParcelKey key) const
68  {
69  InterfacePtr<const ITableLayout> layout(fTableModelRef, UseDefaultIID());
70  return layout->GetParcelToTextFrameMatrix(fGridAddress, key);
71  }
72 
73  virtual bool16 GetParcelAcceptingInvals(ParcelKey key) const
74  {
75  InterfacePtr<const ITableLayout> layout(fTableModelRef, UseDefaultIID());
76  return layout->GetParcelAcceptingInvals(fGridAddress, key);
77  }
78 
79  virtual void AddParcelPendingInval(ParcelKey key,
80  const PMRect& invalRect)
81  {
82  InterfacePtr<ITableLayout> layout(fTableModelRef, UseDefaultIID());
83  layout->AddParcelPendingInval(fGridAddress, key, invalRect);
84  }
85 
87  bool16 isDamaged)
88  {
89  InterfacePtr<ITableLayout> layout(fTableModelRef, UseDefaultIID());
90  layout->NotifyParcelContentDamageChanged(fGridAddress, key, isDamaged);
91  }
92 
94  {
95  InterfacePtr<ITableLayout> layout(fTableModelRef, UseDefaultIID());
96  layout->NotifyParcelPositionDependentContentSet(fGridAddress, key);
97  }
98 
100  {
101  InterfacePtr<ITableLayout> layout(fTableModelRef, UseDefaultIID());
102  layout->NotifyParcelInkBoundsChanged(fGridAddress, key);
103  }
104 
105  virtual void InvalCellContent(ParcelKey key)
106  {
107  }
108 
110  OwnedItemDataList* rList) const
111  {
112  }
113 
114  virtual void ConvertFromAnna(TableLayout* layout)
115  {
116  // Derived classes know if they existed in 2.0
117  }
118 
119 protected:
120  //
121  // These are NOT and should not be persisted.
122  //
123  UIDRef fTableModelRef;
124  GridID fGridID;
125  GridAddress fGridAddress;
126 
127 };
128 
129 
130 #endif