background image
C H A P T E R 1 6
Find
16-10
Using the Find Service
The most important difference between Local finds and other kinds of find
operations is that when the system invokes your search method as part of a Global
or Selected find, your application may not be open. Therefore, you must test to see
that the application soup is available before searching it.
The system informs your search method of the scope of the search through the
scope
parameter. You can choose to ignore it or you can modify your application's
actions based on whether the value of this parameter is
'localFind
or
'globalFind
. The system passes the
'globalFind
symbol when it invokes
your search method for a Global or Selected find. The
'localFind
symbol is
passed for Local find operations.
Checklist for Adding Find Support
16
To add application support for the Find service, you need to do the following:
Create a
title
slot, in the view referenced by the
owner
slot of your finder
frame, that contains the user-visible name of the application.
Create the
appName
slot in your application's base view that contains the user-
visible name of the application.
Choose a finder proto on which to base your application's frame. You should
use
ROM_SoupFinder
if your data is stored in a single soup, and
ROM_CompatibleFinder
otherwise.
Supply at least one search method (
Find
,
DateFind
).
Append the resultant finder frame to the system-supplied
results
array at the
end of your search method(s).
Supply a
FindSoupExcerpt
method that extracts strings from soup entries for
display in the Find overview. This method is required only if you use the
ROM_SoupFinder
proto. If you use the
ROM_CompatibleFinder
proto you
must add a
title
slot with a string defining each found item to the frame
representing the item.
Supply a
ShowFoundItem
method that displays an individual entry from the
found items.
When using a
ROM_CompatibleFinder
proto, write a
ShowFakeEntry
method to call your
ShowFoundItem
method.
When using the
ROM_CompatibleFinder
, you should either not allow
your found items to be selected (and thus not routed), or override the relevant
routing methods.
Optionally, you may also do the following:
Register and unregister for participation in Global and Selected finds.
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна