Protocol for the Negotiation Message

When the receiver application receives the initial drag message from the sender application, it examines the data message in that message, to ascertain what actions the sender application can carry out, and how it can provide the desired data in the final drag message. Using this information, the receiver application formulates the negotiation message, which it sends back as a reply to the original drag message using the BMessage::SendReply() function.

A Negotiation Message is Characterized by its 'what' Member

Recall that the drag message constructed by the sender application contained (among other things) a "be:actions" message field, which indicated the actions the sender was willing to perform upon the dragged data. The allowable actions (at the time of this writing--further actions may be added in the future) are given by the following constants:
When constructing the negotiation message, the receiver application will choose one of the actions listed in the data message's "be:types" message field (remember, not all allowable actions will necessarily be listed in this message field), and use that action as the value of the what member in the negotiation message. This will inform the sender application of which of the possible actions is desired by the receiver.

Message Fields in the Negotiation Message

In addition to the action contained in the what member, the negotiation message may also contain a number of message fields; exactly which message fields are defined depends somewhat on the requested action. The allowable message fields are:
Of course, you can leave out fields that don't apply to a particular action. For example, if the receiver chooses B_TRASH_TARGET as the action (by putting a value of B_TRASH_TARGET into the what member of the negotiation message), no message fields are required; in fact, the sender doesn't even need to respond to a request of B_TRASH_TARGET with a data message, it simply has to delete the dragged data.

Copyright 2005 by yellowTAB GmbH, Be Inc., Palm Source Inc. and their respective legal successors
All rights reserved.