InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IAdaptiveTransientData.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Sachin Singhal
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 2019 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: All information contained herein is, and remains
18 // the property of Adobe Systems Incorporated and its suppliers,
19 // if any. The intellectual and technical concepts contained
20 // herein are proprietary to Adobe Systems Incorporated and its
21 // suppliers and may be covered by U.S. and Foreign Patents,
22 // patents in process, and are protected by trade secret or copyright law.
23 // Dissemination of this information or reproduction of this material
24 // is strictly forbidden unless prior written permission is obtained
25 // from Adobe Systems Incorporated.
26 //
27 //========================================================================================
28 
29 #ifndef __IAdaptiveTransientData__
30 #define __IAdaptiveTransientData__
31 
32 #include "IPMUnknown.h"
33 #include "AutoLayoutID.h"
34 
35 #include "PMRect.h"
36 #include "UIDList.h"
37 
41 {
42 public:
43  UIDList fDependents;
44  PMRect fInitialBounds, fFinalBounds, fRecommendedBounds;
45  PMPoint fStartPoint, fEndPoint, fFinalStartPoint, fFinalEndPoint;
46  UID fTOPUID, fSpreadUID;
47  bool16 fUnlockThis, fLeftToRightBinding, fDependentsInitialised, fHasRecommendedBounds;
48 
49  AdapativePageItemData() : fDependentsInitialised(kFalse), fUnlockThis(kFalse), fTOPUID(kInvalidUID), fSpreadUID(kInvalidUID), fHasRecommendedBounds(false), fHasNewStartAndEndPointForTOP(false) {}
51 
55  bool16 HasNewStartAndEndPointForTOP() { return fHasNewStartAndEndPointForTOP; }
56 
62  void GetStartAndEndPointForTOP(PMPoint &startPoint, PMPoint &endPoint, bool reset = false)
63  {
64  if (fHasNewStartAndEndPointForTOP)
65  {
66  startPoint = fStartBracketPoint;
67  endPoint = fEndBracketPoint;
68  if (reset)
69  fHasNewStartAndEndPointForTOP = false;
70  }
71  }
72 
77  void SetStartAndEndPointForTOP(PMPoint startPoint, PMPoint endPoint)
78  {
79  fStartBracketPoint = startPoint;
80  fEndBracketPoint = endPoint;
81  fHasNewStartAndEndPointForTOP = true;
82  }
83 
87  bool HasRecommendedBounds() { return fHasRecommendedBounds; }
88 
93  virtual PMRect GetRecommendedBounds(bool reset = false)
94  {
95  PMRect returnRect = fRecommendedBounds;
96  if (reset)
97  {
98  fRecommendedBounds = PMRect();
99  fHasRecommendedBounds = false;
100  }
101  return returnRect;
102  }
103 
108  {
109  fRecommendedBounds = bounds;
110  fHasRecommendedBounds = true;
111  }
112 
113 private:
114  PMPoint fStartBracketPoint, fEndBracketPoint;
115  bool fHasNewStartAndEndPointForTOP;
116 };
117 
121 {
122 public:
123  /* Default IID to be used by UseDefaultIID() */
124  enum { kDefaultIID = IID_IADAPTIVETRANSIENTDATA };
125 
129  virtual AdapativePageItemData* GetData(UID)= 0;
130 
133  virtual void Reset() = 0;
134 };
135 
136 #endif // __IAdaptiveTransientData__