C H A P T E R 2 1
Routing Interface
21-34
Using Routing
Registering to Receive Foreign Data
21
To receive data from a different application or from a non-Newton source, your
application must register its interest in such data with the In Box application
registry. To do this, use the
RegInboxApp
function.
If your application is no longer interested in foreign data, or is being uninstalled,
you can unregister to receive foreign data by using the
UnRegInboxApp
function.
Note that your application can register to receive data from a different application.
If you register a test function with
RegInBoxApp
, and that test function returns
true
for a particular item, the Routing interface changes the value of the
appSymbol
slot in the item to be the value of the
appSymbol
slot in
your application.
Be careful not to intercept incoming items that should be destined for other
applications when using this feature. The In Box application registry overrides the
appSymbol
slot of the item. The system uses the
appSymbol
slot as well as the
application data class registry (
RegAppClasses
) to find applications to which an
incoming item can be put away. The application identified by the
appSymbol
slot
is used as the default for the automatic put away feature (
AutoPutAway
) and for
the Put Away picker.
Filing Items That Are Put Away
21
When an item is put away by an application, by default it is filed in the same folder
on the receiving Newton as it was in on the sending Newton. This often makes it
difficult for users to find new items, since they may be put away in folders that are
undefined. To alleviate this problem, it is recommended that all incoming items be
put away unfiled, so that users can more easily find items and file them where they
want to. Incoming items should be put away unfiled even if the recipient has a
folder of the same name as the sender.
For most applications, you put away an item unfiled by setting the
item.body.labels
slot to
nil
. However, filing techniques vary, so
this may not work for all applications.
Viewing Items in the In/Out Box
21
When data is queued in the Out Box, or has been received in the In Box and not
automatically put away, the user can view the data directly in the In/Out Box.
When the user chooses to view an item in the In/Out Box by tapping the item, the
system looks for a view definition of the type
'editor
or
'viewer
that is
registered for the class of that item.
Your application should register such view definitions with the system if you want
users to be able to view items from your application in the In/Out Box. If you do