InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IPlaceBehavior.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner:
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 __IPlaceBehavior__
25 #define __IPlaceBehavior__
26 
27 #include "IPMUnknown.h"
28 
29 #include "ICursorMgr.h"
30 #include "IItemsToPlaceData.h"
31 #include "GenericID.h"
32 #include "PMPoint.h"
33 #include "ScriptData.h"
34 
35 class ISpread;
36 class IControlView;
37 
46 class IPlaceBehavior : public IPMUnknown
47 {
48 public:
49  enum { kDefaultIID = IID_IPLACEBEHAVIOR};
50 
51  //----------------------------------------------------------------------------------------------
52  // Source content methods
53  //----------------------------------------------------------------------------------------------
54 
56  enum eAfterPlace {
58  kOldBehavior,
60  kLeaveAsIs,
62  kClearPlaceGun,
64  kAbortPlaceGun
65  };
66 
68  enum ePlaceType {
70  kPlaceSingle,
72  kPlaceCascade,
74  kPlaceMultiple
75  };
76 
77 
88  virtual UIDList ProcessPlace(IPlaceBehavior* targetItem, const UIDRef& parent, const PMPointList& points,
89  ICursorMgr::eCursorModifierState finalModifiers,
90  ICursorMgr::eCursorModifierState startingModifiers,
91  const ISpread* spread, eAfterPlace *afterPlace = nil,
92  IItemsToPlaceData::ePlaceFrom placeFrom = IItemsToPlaceData::kPlaceGun) = 0;
93 
99  virtual void ProcessReplacePreserveState(IPlaceBehavior* newItem, IPlaceBehavior* target) = 0;
100 
105  virtual void AppendScriptObjects( ScriptList& objectList ) = 0 ;
106 
107  //----------------------------------------------------------------------------------------------
108  // Target content methods
109  //----------------------------------------------------------------------------------------------
110 
112  enum eFrameKind {
114  kTextFrameKind,
116  kGraphicFrameKind,
118  kInteractiveFrameKind,
120  kContainerFrameKind,
124  kUnknownFrameKind
125  };
126 
134  virtual UID ProcessReplace(const UIDRef& placedItem, const UIDRef& oldItem, bool16 useClippingFrame, IPlaceBehavior::eAfterPlace *afterPlace= nil, IItemsToPlaceData::ePlaceFrom placeFrom = IItemsToPlaceData::kPlaceGun) = 0;
135 
141  virtual bool16 CanPlaceInto(const IPlaceBehavior& sourceItem, const ISpread* spread) const = 0;
142 
147  virtual bool16 CanPlaceInto(eFrameKind newPageItemKind) const = 0;
148 
152  virtual bool16 CanReplace() const = 0;
153 
158  virtual bool16 CanConvertTo(eFrameKind newPageItemKind) const = 0;
159 
165  virtual ErrorCode ProcessConvertTo(eFrameKind newPageItemKind, IControlView* controlView) = 0;
166 
168  virtual bool16 IsEmpty() const = 0;
169 
170  // Target helper methods
171 
179  virtual UID ProcessReplaceMe(const UIDRef& placedItem, const UIDRef& oldItem, bool16 usePlaceGunFrame, IPlaceBehavior::eAfterPlace *afterPlace, IItemsToPlaceData::ePlaceFrom placeFrom = IItemsToPlaceData::kPlaceGun) = 0;
180 
188  virtual UID ProcessReplaceChildren(const UIDRef& placedItem, const UIDRef& oldItem, bool16 usePlaceGunFrame, IPlaceBehavior::eAfterPlace *afterPlace) = 0;
189 
191  virtual eFrameKind GetFrameKind() const = 0;
192 
198  virtual bool16 IsFromMaster(const IHierarchy* targetHier, const ISpread* targetSpread) const = 0;
199 };
200 
201 #endif //__IPlaceBehavior__