Routing Formats
When the user taps on the Action button, the Action button must fill the picker with those transports that are appropriate for the current target. It does so using the following logic:
1. What sort of data is being operated on? Calling ClassOf(target)
yields the dataDef symbol.
2. What are the routing formats installed for this data? Calling GetViewDefs
with the dataDef symbol from step 1 provides all the installed viewDefs. Those are filtered to find only those whose type
is printFormat
.
3. Which transports can route the data? Each transport has a list of dataTypes it can route. Each routing format has a list of dataTypes it can work with to provide data. If a routing format can provide a dataType the transport can route, the transport is available for this data (that is, shows up in the Action button). For example, if any routing formats contain the view
dataType, then the Print and Fax transports can route the data (since Print and Fax can route view
dataTypes). Similarly, if any routing formats contain the text
dataType, then the Mail transport can route the data (since it can route text
dataTypes).
The Action picker displays the list of transports once it has been built. As we said earlier, when the user selects a transport, the transport can put up a slip to obtain more information from the user. If more than one routing format has specified that it can provide the dataType needed by this transport, the transport provides a Format picker to allow the user to choose between the routing formats (see FIGURE 12.8).
FIGURE 12.8 : Multiple routing formats available for the same transport.
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996