Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
MDragAndDropEventHandler
Inherited By:
TMediaView
TTextView
Purpose:
MDropAcceptor is a mixin class for classes that want to be drag-and-drop targets.
Instantiation:
MDropAcceptor is a mixin class and cannot be instantiated.
Deriving Classes:
Classes that want to accept dragged object must be derived from MDropAcceptor. Deriving classes must implement the member functions ChoosePreferredType and AcceptDrop. Deriving class can also choose to implement the member functions DragItemEntered, DragItemMoved and DragItemExited.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
Other Considerations:
None.
MDropAcceptor (const TViewHandle & theView)
Interface Category:
API.
Purpose:
Constructs an MDropAcceptor for the specified view.
Calling Context:
Called to create an MDropAcceptor.
Parameters:
- const TViewHandle & theView -The view wishing to accept dropped objects.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ MDropAcceptor ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: MDropAcceptor::DragItemEntered
virtual void DragItemEntered (const TGPoint & whereEntered, const TSequenceOf < TTypeDescription > & availableTypes)
Interface Category:
API.
Purpose:
Provides graphic feedback of the target's willingness to accept the object. The default implementation does nothing.
Calling Context:
Called when the cursor enters the view associated with this acceptor.
Parameters:
- const TGPoint & whereEntered -The local coordinates of the cursor.
- const TSequenceOf < TTypeDescription > & availableTypes -The available type descriptions of the dragged item.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Deriving classes may choose to override this member function.
Member Function: MDropAcceptor::DragItemMoved
virtual void DragItemMoved (const TGPoint & whereMoved, const TSequenceOf < TTypeDescription > & availableTypes)
Interface Category:
API.
Purpose:
Provides any additional acceptance feedback when the cursor in moved within the bounds of the view associated with this object. The default implementation does nothing.
Calling Context:
Called when the cursor has already entered the view associated with this acceptor and has now moved to a different location within the view.
Parameters:
- const TGPoint & whereEntered -The local coordinates of the cursor.
- const TSequenceOf < TTypeDescription > & availableTypes -The available type descriptions of the dragged item.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Deriving classes may choose to override this member function.
Member Function: MDropAcceptor::DragItemExited
virtual void DragItemExited (const TGPoint & whereExited)
Interface Category:
API.
Purpose:
Clears any graphic feedback when the cursor leaves the bounds of the view associated with this acceptor. The default implementation does nothing.
Calling Context:
Called when the cursor exits the view associated with this acceptor.
Parameters:
- const TGPoint & whereExited -The local coordinates where the cursor exited the view.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Deriving classes may choose to override this member function.
Member Function: MDropAcceptor::ChoosePreferredType
virtual bool ChoosePreferredType (const TGPoint & whereDropped, const TSequenceOf < TTypeDescription > & availableTypes, TTypeDescription & chosenType) const
Interface Category:
API.
Purpose:
Chooses the type description to accept, if any, from the dragged item's list of available types.
Calling Context:
Called when a dragged item is dropped on the view associated with this acceptor to determine which data representation the acceptor desires.
Parameters:
- const TGPoint & whereDropped -The local coordinates where the dragged item was dropped.
- const TSequenceOf < TTypeDescription > & availableTypes -The list available type descriptions.
- TTypeDescription & chosenType -If true is returned, this parameter is filled in with the type description that is acceptable.
Return Value:
Returns true if the list of available types contained a suitable, otherwise false is returned.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Deriving classes must implement this member function.
Member Function: MDropAcceptor::AcceptDrop
virtual bool AcceptDrop (const TGPoint & whereDropped, const TTypeDescription & theType, const TScrapItem & theItem)
Interface Category:
API.
Purpose:
Accepts the specified type description from the dropped item.
Calling Context:
Called to accept the dropped item.
Parameters:
- const TGPoint & whereDropped -The local coordinates where the dragged item was dropped.
- const TTypeDescription & theType -The type description to accept.
- const TScrapItem & theItem -The scrap item to accept.
Return Value:
Returns true if the item was accepted, otherwise false is returned.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Deriving classes must implement this member function.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.