InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CDragDropTarget.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Dave Burnard
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 __CDragDropTarget__
25 #define __CDragDropTarget__
26 
27 #include "ShuksanID.h"
28 #include "DragDropID.h"
29 
30 #include "IEvent.h"
31 #include "IDragDropTarget.h"
32 #include "IDropTargetCallback.h"
33 #include "IDragDropController.h"
34 #include "HelperInterface.h"
35 #include "PMFlavorTypes.h"
36 #include "CmdUtils.h"
37 
38 class DataObjectIterator;
39 
40 
41 
48 {
49  typedef IDragDropTarget inherited;
51 
52  public:
54  virtual ~CDragDropTarget();
55 
64  virtual void HandleDoDragEnter();
66  virtual void HandleDoDragWithin(const PMPoint& localPt);
68  virtual void HandleDoDragLeave();
70  virtual ErrorCode HandleProcessDragDropCommand(IDragDropController*, DragDrop::eCommandType);
72 
76  virtual SysWireframe DoMakeDropHiliteRegion() const;
77 
86 
91  virtual IDataBase* GetTargetDataBase() const;
92 
96  bool16 SameAsDragSource(const IDragDropSource* dragSource) const;
97 
102  bool16 AffectsSameDataAsDragSource(const IDragDropSource* dragSource) const;
103 
108  virtual bool16 HitTest_OutsideBounds(const SysPoint&) const;
109 
113  virtual IDragDropTarget* QueryInternalDropTarget(const SysPoint& windowPoint,
114  PMPoint& localPoint,
115  DataObjectIterator* dataIter,
116  const IDragDropSource* iSource,
117  const IDragDropController* iController);
119  virtual PMMatrix GetInternalTransform() const;
121  virtual void SetInternalTransform(PMMatrix);
122 
127 
131  virtual void SetActiveContext();
135  virtual void ResetActiveContext();
136 
140  virtual void SetDocument(IDocument*);
141 
146  virtual void DrawTargetOutline();
147 
151  virtual bool16 IsTargetModifiable() const;
152 
153  protected:
158  virtual void PrepareTargetForDrag();
159 
165 
166  // Tracking the drag as it enters, drags, and leaves this target
168  virtual void DoDragEnter();
170  virtual void DoDragWithin(const PMPoint& localPt);
172  virtual void DoDragLeave();
173 
178  const PMPoint& localPt);
179 
183  virtual PMRect HandleGetDragDataBounds() const; //
187  virtual PMRect GetDragDataBounds() const;
188 
189  protected:
193  const DragDrop::TargetResponse& GetCachedResponse() const {return fCachedResponse;}
194  mutable DragDrop::TargetResponse fCachedResponse;
195 
196  DropTargetCallbackList* GetTargetCallbackList() {return &fTargetCallbackList;}
197 
198  private:
199  PMMatrix fInternalTransform;
200  DropTargetCallbackList fTargetCallbackList;
201 
202 
203 };
204 
205 
206 #endif