beautypg.com

Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 762

background image

C H A P T E R 2 1

Routing Interface

21-14

Using Routing

override the routing format methods that handle the alias operations:

TargetSize

,

MakeBodyAlias

, and

ResolveBody

.

The

TargetSize

method must determine the size of the target object passed to it.

The default method does this for soup entries, but you must override it and do it
yourself for other kinds of objects. The size of the object is used to determine if the
object is greater than the size specified by the

sizeLimit

slot in the routing

format, or greater than the available space on the store. If either of these conditions
is true, an alias is created for the object.

Storing Multiple Items

21

You may want to send multiple items in one routing operation. This allows you to
use a single routing slip to address several items at once, for example, if the user
selects multiple items from an overview. If you’ve constructed a multiple-item
target object for a group of items, you can specify that these items be stored as
individual items in the Out Box or that the single multiple-item target object be
stored in the Out Box. The

storeCursors

slot in the routing format controls this

feature, along with the transport. This feature works only if the transport
also supports it and is able to handle a multiple-item target (the transport

allowBodyCursors

slot is also

true

). For example, the built-in beam transport

does not support the storing of a multiple-item target for multiple items, so the

storeCursors

slot in the routing format is ignored for that transport.

The default value of the

storeCursors

slot is

true

.

Set the

storeCursors

slot to

true

to store a single multiple-item target object

for the items in the Out Box. When the items are sent, the cursor is resolved into its
component entries.

Set the

storeCursors

slot to

nil

to store each of the selected items as a separate

item in the Out Box. Each item can later be sent or operated on individually from
the Out Box.

Using the Built-in Overview Data Class

21

The system includes a built-in overview data class,

'newtOverview

, that you can

use to simplify routing from overviews. Special formats that handle the data types

'view

,

'frame

, and

'text

are registered under this data class. (You should not

register any other formats under the

'newtOverview

class.)

At the time data is actually sent from the Out Box, these special formats handle
each item from the overview separately, looking for the first nonoverview format
registered in the system that can handle the data class of that item. At this time,
formats you have registered would be invoked separately for the individual items in
the overview selection. For example, for printing, each item would be printed on a
new page.