InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ILayoutTarget.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Michael Martz
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 // Note:
24 //
25 //========================================================================================
26 
27 #ifndef _ILayoutTarget_
28 #define _ILayoutTarget_
29 //________________________________________________________________________________________________
30 // INCLUDES
31 //________________________________________________________________________________________________
32  #include "IPMUnknown.h"
33  #include "ShuksanID.h"
34  #include "UIDList.h"
35 //================================================================================================
36 //________________________________________________________________________________________________
37 // Constants
38 //________________________________________________________________________________________________
39 // const bool16 kStripStandoffs = kTrue;
40 // const bool16 kDontStripStandoffs = kFalse;
41 // const bool16 kStripIfParentLocked = kTrue;
42 // const bool16 kDontStripIfParentLocked = kFalse;
43 //________________________________________________________________________________________________
44 // CLASS DECLARATION
45 //________________________________________________________________________________________________
48 class ILayoutTarget : public IPMUnknown
49  {
50  //____________________________________________________________________________________________
51  // Data Types
52  //____________________________________________________________________________________________
53  public:
54  enum { kDefaultIID = IID_ILAYOUTTARGET };
55 
56 
57 
58 
59  template< typename, int v> struct Int2Type { enum { value = v};};
60 
62  {
65 
66  /*--------trickery below--------*/
67  template<int v> StandoffChoice( const Int2Type<StandoffChoice, v>& ) : value(v) { }
68  StandoffChoice( const StandoffChoice& other) : value( other.value) { }
69  friend bool operator==( const StandoffChoice& lhs, const StandoffChoice& rhs) { return lhs.value == rhs.value; }
70  friend bool operator!=( const StandoffChoice& lhs, const StandoffChoice& rhs) { return lhs.value != rhs.value; }
71  private: int value;
72  };
73 
75  {
78 
79  /*--------trickery below--------*/
80  template<int v> LockedParentChoice( const Int2Type<LockedParentChoice, v>& ) : value(v) { }
81  LockedParentChoice( const LockedParentChoice& other) : value( other.value) { }
82  friend bool operator==( const LockedParentChoice& lhs, const LockedParentChoice& rhs) { return lhs.value == rhs.value; }
83  friend bool operator!=( const LockedParentChoice& lhs, const LockedParentChoice& rhs) { return lhs.value != rhs.value; }
84  private: int value;
85  };
86 
87 
88 
89 
90  //____________________________________________________________________________________________
91  // Member functions
92  //____________________________________________________________________________________________
93  public:
94  //........................................................................................
95  // (Add to / Remove from) the layout target
96  //........................................................................................
99  virtual void Add (const UID newItem) = 0;
102  virtual void Add (const UIDList& newItems) = 0;
105  virtual void Remove (const UID itemToRemove) = 0;
106 
109  virtual void Clear (void) = 0;
110 
113  virtual UIDList GetUIDList (StandoffChoice stripStandoffs, LockedParentChoice stripIfParentLocked) const = 0;
114  inline UIDList GetUIDList( StandoffChoice stripStandoffs) const;
115 
116 
117 
120  virtual void SetUIDList (const UIDList&) = 0;
123  virtual void SetUIDList (const UID) = 0;
124 
127 // virtual UIDList GetLastUIDList (StandoffChoice stripStandoffs, bool16 stripIfParentLocked = kDontStripIfParentLocked) const = 0;
128 
140  virtual UIDList CreateFlattenedUIDList (const PMIID&) const = 0;
141 
145  virtual void CalculatePreviousSelectionDifferences (UIDList* addedPageItems, UIDList*removedPageItems) = 0;
146  //........................................................................................
147  // Utilities
148  //........................................................................................
151  virtual void Initialize (IDataBase*) = 0;
154  virtual bool16 PartOfTarget (const UID&) const = 0;
155 
158  virtual void TargetChanged (void) = 0;
159 
162  virtual bool16 HasContent (void) const = 0;
163 
166  virtual UIDRef GetKeyObject (void) const = 0;
167 
170  virtual void SetKeyObject (const UIDRef& keyObject) = 0;
171  };
172 
173 
178 
179 inline UIDList ILayoutTarget::GetUIDList( StandoffChoice stripStandoffs) const { return GetUIDList( stripStandoffs, kDontStripIfParentLocked);}
180 
181 
182 #endif // _ILayoutTarget_
183 
184