background image
C H A P T E R 5
Stationery
Using Stationery
5-5
Getting Information about Stationery
5
By using the appropriate global function, you can get information about all the
dataDefs and viewDefs that have been registered and thus are part of the system
registry. These functions include
GetDefs
,
GetDataDefs
,
GetAppDataDefs
,
GetViewDefs
, and so on. For details on these functions, see Newton
Programmer's Reference.
You can also obtain application-specific stationery information. This enables
applications that are registered for stationery to be extended by other developers.
Compatibility Information
5
The stationery feature and programming interface is new in Newton OS version
2.0. It is not supported on earlier system versions.
Using Stationery
5
Stationery allows you to:
Create discrete data definitions and view definitions.
Extend your own and other applications.
Create print formats.
Designing Stationery
5
Whether you use stationery in an application or an auto part, it is important to keep
the data and view definitions as discrete as possible. Encapsulating them, by
keeping all references confined to the code in the data or view definition, will make
them maximally reusable.
You should keep in mind that these extensions may be used in any number of
future programming situations that you cannot foresee. If your stationery was
created for an application (which you may have written at the same time), resist
any and all urges to make references to structures contained in that application,
thereby "hard-wiring" it to depend on that application. In addition, you should
provide public interfaces to any values you want to share outside the dataDef.
If your stationery is designed for a NewtApp, the stationery soup entries, which are
defined in the dataDef component of stationery, are adopted into the soup of a
NewtApp application (via the
AdoptEntry
method) so that your stationery's slots
are added to those already defined in the main application. This allows the
stationery and the host application to have discrete soup structures. See the
description of
AdoptEntry
(page 3-5) in Newton Programmer's Reference.
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна