inISearchProcess.idl 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. #include "nsISupports.idl"
  5. interface nsAString;
  6. interface inISearchObserver;
  7. [scriptable, uuid(D5FA765B-2448-4686-B7C1-5FF13ACB0FC9)]
  8. interface inISearchProcess : nsISupports
  9. {
  10. // indicates if an asynchronous search is in progress
  11. readonly attribute boolean isActive;
  12. // the number of results returned
  13. readonly attribute long resultCount;
  14. // for optimization when doing an async search, this will optionally
  15. // destroy old results, assuming they will be fetched as soon as
  16. // the observer is notified of their presence. If true, then indices
  17. // pass to the get*ResultAt methods will return null for any index
  18. // other than the most recent one, and getResults will return null always.
  19. attribute boolean holdResults;
  20. // start a synchronous search
  21. void searchSync();
  22. // start an asynchronous search
  23. void searchAsync(in inISearchObserver aObserver);
  24. // command an async process to stop immediately
  25. void searchStop();
  26. // performs a step in the asynchronous search loop
  27. // return indicates true if loop is done, false if it should continue
  28. // This is there only for the benefit of asynchronous search controllers,
  29. // and is not for use by those who just wish to call searchAsync
  30. boolean searchStep();
  31. // methods for getting results of specific types
  32. AString getStringResultAt(in long aIndex);
  33. long getIntResultAt(in long aIndex);
  34. unsigned long getUIntResultAt(in long aIndex);
  35. };