beautypg.com

Receiving data 21 – Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 779

background image

C H A P T E R 2 1

Routing Interface

Using Routing

21-31

Receiving Data

21

Incoming data arrives first as an entry in the In Box. If there is a public view
definition registered for the class of the entry, the item may then be viewed directly
in the In Box.

IMPORTANT

Generally, the

body

slot of every received item must have a

meaningful class. (This is not strictly required if the item has an

appSymbol

slot.) If

body

contains a frame, its

class

slot

identifies its data class. Items received from other Newton devices
generally have a

body.class

slot. For items received from

other systems, the transport must assign a meaningful class
(use

SetClass

).

An incoming item may be stored in the In Box until the user chooses to manually
put away the item into an application, or an incoming item may be transferred
automatically to an application as soon as the item arrives in the In Box. This is
controlled by the applications present on the Newton and described in detail in the
following sections.

If an In Box item contains an

appSymbol

slot, that slot identifies the receiving

application for the item. The system uses this slot to identify the default application
to which the item should be put away (if any). If the original item contained a

destAppSymbol

slot when submitted to the In Box, that slot is copied into the

appSymbol

slot to identify the application that should receive it. The receiving

transport does this before the item is passed to the In Box by using the transport
method

NewFromItem

.

These are the minimum steps you need to take to support receiving items through
the In/Out Box in your application:

Supply a

PutAwayScript

method in your application base view. When a user

chooses to put away an item to your application from the In/Out Box, the item is
passed to this method.

Register the data classes that your application can accept by using the

RegAppClasses

function in the application part

InstallScript

function.

Unregister using

UnRegTheseAppClasses

or

UnRegAppClasses

in the

application part

RemoveScript

function.

Automatically Putting Away Items

21

The first thing the In Box does with an incoming item is to determine which
applications might want to accept the item immediately. The In Box does this by
checking the In Box application registry to find out if any applications have
registered to accept such items; see the section “Registering to Receive Foreign