Apple Newton Utilities Podręcznik Użytkownika Strona 794

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 942
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 793
CHAPTER 22
Transport Interface
22-6 Using the Transport Interface
Here is an example of installing a transport in the part InstallScript function:
InstallScript := func(partFrame,removeFrame)
begin
RegTransport(kAppSym, partFrame.partData.(kAppSym));
// assumes that partData.(kAppSym) holds the transport
end;
When your transport is removed, use the UnRegTransport function to unregister
the transport from the system. You pass the
UnRegTransport function the
transport
appSymbol like this:
RemoveScript := func(removeFrame)
begin
UnRegTransport(kAppSym);
end;
If your transport is scrubbed by the user from the Extras Drawer, the system
also calls the
DeletionScript function in its package part. In the
DeletionScript function, you should call the DeleteTransport function,
which removes user conguration information related to the transport. Here’s an
example of a
DeletionScript function:
SetPartFrameSlot('DeletionScript,func(removeFrame)
begin
// delete prefs and other temporary data
DeleteTransport(kAppSym);
end)
Setting the Address Class 22
The transport object contains a slot, addressingClass, that holds a symbol.
This symbol identies the class of the address information used by the transport,
such as that stored in the
toRef and fromRef slots of an item. (See the section
“Item Frame” beginning on page 22-2.) The In/Out Box uses this symbol to look
up and display the to and from address information based on soup entries (usually
from the Names soup).
The class of address information is dened by name reference data denitions
registered in the system. You can specify one of the following built-in name
reference data denitions in the
addressingClass slot:
'|nameRef.email|, for use with a transport that handles e-mail
'|nameRef.fax|, for use with a transport that handles fax phone calls
'|nameRef.phone|, for use with a transport that handles other phone calls
Or you can specify a custom name reference data denition that you have created
and registered with the system. Note that all name reference data denitions must
be registered under a symbol that is a subclass of
'nameref.
Przeglądanie stron 793
1 2 ... 789 790 791 792 793 794 795 796 797 798 799 ... 941 942

Komentarze do niniejszej Instrukcji

Brak uwag