michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 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: #include "nsISupports.idl" michael@0: michael@0: interface nsIFile; michael@0: interface nsISimpleEnumerator; michael@0: michael@0: /** michael@0: * nsIDirectoryServiceProvider michael@0: * michael@0: * Used by Directory Service to get file locations. michael@0: */ michael@0: michael@0: [scriptable, uuid(bbf8cab0-d43a-11d3-8cc2-00609792278c)] michael@0: interface nsIDirectoryServiceProvider: nsISupports michael@0: { michael@0: /** michael@0: * getFile michael@0: * michael@0: * Directory Service calls this when it gets the first request for michael@0: * a prop or on every request if the prop is not persistent. michael@0: * michael@0: * @param prop The symbolic name of the file. michael@0: * @param persistent TRUE - The returned file will be cached by Directory michael@0: * Service. Subsequent requests for this prop will michael@0: * bypass the provider and use the cache. michael@0: * FALSE - The provider will be asked for this prop michael@0: * each time it is requested. michael@0: * michael@0: * @return The file represented by the property. michael@0: * michael@0: */ michael@0: nsIFile getFile(in string prop, out boolean persistent); michael@0: }; michael@0: michael@0: /** michael@0: * nsIDirectoryServiceProvider2 michael@0: * michael@0: * An extension of nsIDirectoryServiceProvider which allows michael@0: * multiple files to be returned for the given key. michael@0: */ michael@0: michael@0: [scriptable, uuid(2f977d4b-5485-11d4-87e2-0010a4e75ef2)] michael@0: interface nsIDirectoryServiceProvider2: nsIDirectoryServiceProvider michael@0: { michael@0: /** michael@0: * getFiles michael@0: * michael@0: * Directory Service calls this when it gets a request for michael@0: * a prop and the requested type is nsISimpleEnumerator. michael@0: * michael@0: * @param prop The symbolic name of the file list. michael@0: * michael@0: * @return An enumerator for a list of file locations. michael@0: * The elements in the enumeration are nsIFile michael@0: * @returnCode NS_SUCCESS_AGGREGATE_RESULT if this result should be michael@0: * aggregated with other "lower" providers. michael@0: */ michael@0: nsISimpleEnumerator getFiles(in string prop); michael@0: }; michael@0: michael@0: /** michael@0: * nsIDirectoryService michael@0: */ michael@0: michael@0: [scriptable, uuid(57a66a60-d43a-11d3-8cc2-00609792278c)] michael@0: interface nsIDirectoryService: nsISupports michael@0: { michael@0: /** michael@0: * init michael@0: * michael@0: * Must be called. Used internally by XPCOM initialization. michael@0: * michael@0: */ michael@0: void init(); michael@0: michael@0: /** michael@0: * registerProvider michael@0: * michael@0: * Register a provider with the service. michael@0: * michael@0: * @param prov The service will keep a strong reference michael@0: * to this object. It will be released when michael@0: * the service is released. michael@0: * michael@0: */ michael@0: void registerProvider(in nsIDirectoryServiceProvider prov); michael@0: michael@0: /** michael@0: * unregisterProvider michael@0: * michael@0: * Unregister a provider with the service. michael@0: * michael@0: * @param prov michael@0: * michael@0: */ michael@0: void unregisterProvider(in nsIDirectoryServiceProvider prov); michael@0: }; michael@0: michael@0: