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