InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CGraphicPlaceBehavior.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 __CGraphicPlaceBehavior__
25 #define __CGraphicPlaceBehavior__
26 
27 #include "IPlaceBehavior.h"
28 #include "IReferencePointData.h"
29 #include "IDataBase.h"
30 
31 class IPersistUIDData ;
32 
33 class CGraphicPlaceBehavior : public CPMUnknown<IPlaceBehavior>
34 {
35 public:
37  virtual ~CGraphicPlaceBehavior();
38 
39 // source
40  virtual UIDList ProcessPlace(IPlaceBehavior* targetItem, const UIDRef& parent, const PMPointList& points,
42  const ISpread* spread, IPlaceBehavior::eAfterPlace *afterPlace,
43  IItemsToPlaceData::ePlaceFrom placeFrom = IItemsToPlaceData::kPlaceGun);
44  virtual void ProcessReplacePreserveState(IPlaceBehavior* srcRoot, IPlaceBehavior* target);
45  virtual void AppendScriptObjects( ScriptList& objectList ) ;
46 
47 // target
48  virtual UID ProcessReplace(const UIDRef& placedItem, const UIDRef& oldItem, bool16 useClippingFrame, IPlaceBehavior::eAfterPlace *afterPlace, IItemsToPlaceData::ePlaceFrom placeFrom = IItemsToPlaceData::kPlaceGun);
49  virtual bool16 CanPlaceInto(eFrameKind newPageItemKind) const;
50  virtual bool16 CanPlaceInto(const IPlaceBehavior& sourceItem, const ISpread* spread) const;
51  virtual bool16 CanReplace() const;
52  virtual bool16 CanConvertTo(eFrameKind newPageItemKind) const;
53  virtual ErrorCode ProcessConvertTo(eFrameKind newPageItemKind, IControlView* view);
54  virtual bool16 IsEmpty() const;
55  virtual bool16 IsFromMaster(const IHierarchy* targetHier, const ISpread* targetSpread) const; // Is targetHier from a different spread?
56 
57 protected:
59  // Am I a page item from master and overrideable?
60  virtual bool16 IsItemMasterNotOverrideable(const IHierarchy* hier, const ISpread* spread) const;
61 
62  // Am I the "Outermost" graphicFrame of this page item
63  virtual bool16 IsItemRoot() const;
64 
65  // override this for different frame kinds
66  virtual eFrameKind GetFrameKind() const;
67 
68  // Query the "Outermost" graphicFrame of this page item
69  virtual IPlaceBehavior* QueryItemRoot();
70 
71 
72  virtual UIDList ProcessDoPlace(const UIDRef& parent, const PMPointList& points, IItemsToPlaceData::ePlaceFrom placeFrom = IItemsToPlaceData::kPlaceGun);
73  virtual UIDList ProcessDoPlaceInto(IPlaceBehavior* targetItem, const PMPointList& points, IPlaceBehavior::eAfterPlace &whatToDoAfter,IItemsToPlaceData::ePlaceFrom placeFrom = IItemsToPlaceData::kPlaceGun);
74 
75  virtual UID ProcessReplaceMe(const UIDRef& placedItem, const UIDRef& oldItem, bool16 usePlaceGunFrame, IPlaceBehavior::eAfterPlace *afterPlace, IItemsToPlaceData::ePlaceFrom placeFrom);
76  virtual UID ProcessReplaceChildren(const UIDRef& placedItem, const UIDRef& oldItem, bool16 usePlaceGunFrame, IPlaceBehavior::eAfterPlace *afterPlace);
77 
78  virtual void HandleXMPRotation(IPersistUIDData* uidData, bool16 modifyFrame);
79 
80 
81  // methods to access PlaceGun(or PlaceHead).
82  virtual bool16 IsPlaceLoaded(IDataBase* db, IItemsToPlaceData::ePlaceFrom placeFrom) const;
83  virtual UID GetFirstItemToPlaceUID(IDataBase* db, IItemsToPlaceData::ePlaceFrom placeFrom) const;
84  virtual ErrorCode ClearFirstItemToPlace(IDataBase* db, IItemsToPlaceData::ePlaceFrom placeFrom) const;
85  virtual ErrorCode AbortFirstItemToPlace(IDataBase* db, IItemsToPlaceData::ePlaceFrom placeFrom) const;
86  virtual ErrorCode AbortAllItemsToPlace(IDataBase* db, IItemsToPlaceData::ePlaceFrom placeFrom) const;
87 
88  // method to map a reference point position to the value required by interface IAlignContentInFrameCmdData
89  virtual int32 RefPointPositionToAlignContentInFrame(IReferencePointData::ReferencePointPosition pos) const;
90 
91 };
92 
93 #endif //__CGraphicPlaceBehavior__