![]() | InDesign SDK 20.5 |
#include <IDragDropTextUtils.h>

Public Types | |
| enum | { kDefaultIID = IID_IDRAGDROPTEXTUTILS } |
Public Member Functions | |
| virtual bool16 | StartTextDrag (IControlView *view, IDragDropSource *dragSource, IEvent *theEvent)=0 |
| virtual IParcel * | QueryTextParcelAtPoint (IControlView *view, const SysPoint mousePt, const IPMUnknown *hitObj, const IParcel *previousParcel, UIDRef &storyUIDRef, RangeData &range, PMReal *hitIndex=nil, PMReal *adjustedHitIndex=nil)=0 |
| virtual void | DrawCaretAtDropLocation (IControlView *view, UIDRef &storyUIDRef, RangeData &range, bool16 flushDrawing=kTrue)=0 |
| virtual ErrorCode | ProcessDragDropTextCommand (IControlView *view, IDragDropController *controller, const UIDRef &storyUIDRef, RangeData &range, DragDrop::eCommandType type, bool16 ignoreAttributes=kFalse)=0 |
| virtual ErrorCode | PrepareForTextFrameDrop (IControlView *view, IDragDropController *controller, PMPoint &dropPoint, UIDRef &parent)=0 |
| virtual ErrorCode | MakeFrame (const PBPMPoint &location, const UIDRef &parent, const UIDRef &storyUIDRef, UIDRef &createdFrame)=0 |
| virtual ErrorCode | SendDragDropTextSignal (ServiceID id, IControlView *sourceView, IControlView *destinationView, const UIDRef &sourceStoryRef, RangeData &sourceRange, const UIDRef &destinationStoryRef, RangeData &destinationRange, RangeData &droppedRange, DragDrop::eCommandType type, IDataExchangeHandler *handler)=0 |
| virtual ICommand * | MakeNewTextFrameCmdForDrop (ILayoutControlData *layoutData, IDataExchangeHandler *texthandler, const bool16 ignoreAttributes)=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
Utilities for use for dealing with drag and drop of text.
| pure virtual |
Description: Use the range data (length of 0) to draw a caret at the story position in order to give user feedback about drop location.
| view | IN pointer to the control view under the mouse |
| storyUIDRef | IN Reference to the story containing the RangeData |
| range | IN text range at drop location (length of 0) |
| flushDrawing | IN whether to force flush the drawing |
| pure virtual |
Description: Process command to create a new text frame or frame grid based on the passed in storyUIDRef parameter.
| location | Where the text frame should be created, in pasteboard coordinates. |
| parent | Where in the hierarchy to put the text frame (typically a spread layer) |
| storyUIDRef | The source story uid ref (may be kInvalidUIDRef) |
| createdFrame | OUT parameter. The created text frame or frame grid based on the passed in storyUIDRef parameter) and it could be UIDRef(nil, kInvalidUID) if we fail to create. |
| pure virtual |
Description: Create a new-text-frame command, to hold raw text dragged onto a layout.
| layoutData | IN Pointer to ILayoutControlData for layout view. |
| texthandler | IN IDataExchangeHandler for the drop. |
| ignoreAttributes | IN Ignore the attributes of the source. |
| pure virtual |
Description: Check to see if we can create a text frame at this location (checks for locked layers).
| view | IN What view to drop in. |
| controller | IN The drag and drop controller |
| dropPoint | OUT The dropped point from the controller |
| parent | OUT Where in the hierarchy to put the text frame (typically a spread layer). |
| pure virtual |
Description: Process commands to do text drag and drop.
| view | IN the control view for the drop (may be nil, used to bring window to front) |
| controller | IN the drag and drop controller |
| storyUIDRef | IN Reference to the story to drop into (the destination) |
| range | IN text range at hit location (length of 0) (the destination) |
| type | IN an enum of type DragDrop::eCommandType. kDragMove for moving text, otherwise use kDrop to copy. |
| ignoreAttributes | IN Ignore the attributes on drop, default to kFalse |
| pure virtual |
Description: Utility method that encapsulates using the target object (hitObj) and uses its IDragDropTextHelper interface to return a parcel, story ref, and text range at the hit moust point.
| view | IN pointer to the control view under the mouse |
| mousePt | IN location of current mouse position |
| hitObj | IN an IPMUnknown pointer from a frame from hittesting at the mousePt. May be nil. |
| previousParcel | IN an IParcel interface from a possible previous hit. May be nil, and will be nil initially. |
| storyUIDRef | OUT Reference to the story containing the returned RangeData. kInvalidUIDRef if no hit. |
| range | OUT The hit range (length of 0). This is a model range. |
| hitIndex | OUT the model text index that was hit, may be nil. |
| adjustedHitIndex | OUT the adjusted model text index (rounded). May be nil. |
| pure virtual |
Description: Signal all drag drop text responders that a drag text event has just occurred.
| id,a | service id for what signal is being sent. Must be one of: kBeforeDragTextSignalResponderService - Just before we add text drag content to drag controller. Responder may want to adjust source range (e.g. a partially selected hyperlink). Responder may set global error code to display an alert. kBeforeDropTextSignalResponderService - Just before we create a command to do the drag/drop operation. Responder may set global error code (e.g. some kind of illegal drop that will display an error alert). kAfterDropTextSignalResponderService - Just after the drag/drop command has executed. Responder may want to do extra adjustment (e.g. smart cut/paste to insert/delete extra spaces) |
| sourceView | IN pointer to the control view for the source for drag/drop operation. |
| destinationView | IN pointer to the control view for the destination for drag/drop operation. May be same as source. May be nil for kBeforeDropTextSignalResponderService signal. |
| sourceStoryRef | IN the source story that is being dragged. |
| sourceRange | IN/OUT the source text range that is being dragged. May be modified by responder, and may even have zero length after the drop. |
| destinationStoryRef | IN the destination story that is being dropped. Will be kInvalidUIDRef for kBeforeDragTextSignalResponderService signal. |
| destinationRange | IN/OUT the destination range for the caret drop location (length of zero) that is being dropped. Will be RangeData(0,0,RangeData::kLeanForward)) for kBeforeDragTextSignalResponderService signal. May be modified by responder. |
| droppedRange | IN/OUT the dropped range for the drag and drop operation. Will be the length of the sourceRange. This range is used to select the text after the drop. May be modified by responder. |
| handler | IN the data exchange handler used for the text drag drop operation. Gives responders a place to access stored data. |
| pure virtual |
Description: Try to start up a text drag operation with the given view, drag drop source, and event.
| view | IN pointer to the control view under the mouse |
| dragSource | IN the drag source to ask if it WillDrag |
| theEvent | IN the event that initiated this query. |