2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2000-02-11 08:04:53 +03:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
2013-09-23 21:29:27 +04:00
|
|
|
|
|
|
|
interface nsIFile;
|
|
|
|
interface nsISimpleEnumerator;
|
2000-02-11 08:04:53 +03:00
|
|
|
|
2001-03-24 03:22:18 +03:00
|
|
|
/**
|
2001-11-02 18:29:57 +03:00
|
|
|
* nsIDirectoryServiceProvider
|
|
|
|
*
|
|
|
|
* Used by Directory Service to get file locations.
|
2001-03-24 03:22:18 +03:00
|
|
|
*/
|
|
|
|
|
2000-02-11 08:04:53 +03:00
|
|
|
[scriptable, uuid(bbf8cab0-d43a-11d3-8cc2-00609792278c)]
|
|
|
|
interface nsIDirectoryServiceProvider: nsISupports
|
|
|
|
{
|
2001-11-02 18:29:57 +03:00
|
|
|
/**
|
|
|
|
* getFile
|
|
|
|
*
|
|
|
|
* Directory Service calls this when it gets the first request for
|
|
|
|
* a prop or on every request if the prop is not persistent.
|
|
|
|
*
|
|
|
|
* @param prop The symbolic name of the file.
|
|
|
|
* @param persistent TRUE - The returned file will be cached by Directory
|
|
|
|
* Service. Subsequent requests for this prop will
|
|
|
|
* bypass the provider and use the cache.
|
|
|
|
* FALSE - The provider will be asked for this prop
|
|
|
|
* each time it is requested.
|
|
|
|
*
|
|
|
|
* @return The file represented by the property.
|
|
|
|
*
|
|
|
|
*/
|
2011-08-07 09:03:32 +04:00
|
|
|
nsIFile getFile(in string prop, out boolean persistent);
|
2001-11-02 18:29:57 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* nsIDirectoryServiceProvider2
|
|
|
|
*
|
|
|
|
* An extension of nsIDirectoryServiceProvider which allows
|
|
|
|
* multiple files to be returned for the given key.
|
|
|
|
*/
|
|
|
|
|
|
|
|
[scriptable, uuid(2f977d4b-5485-11d4-87e2-0010a4e75ef2)]
|
|
|
|
interface nsIDirectoryServiceProvider2: nsIDirectoryServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* getFiles
|
|
|
|
*
|
|
|
|
* Directory Service calls this when it gets a request for
|
|
|
|
* a prop and the requested type is nsISimpleEnumerator.
|
|
|
|
*
|
|
|
|
* @param prop The symbolic name of the file list.
|
|
|
|
*
|
|
|
|
* @return An enumerator for a list of file locations.
|
|
|
|
* The elements in the enumeration are nsIFile
|
2005-06-02 17:29:04 +04:00
|
|
|
* @returnCode NS_SUCCESS_AGGREGATE_RESULT if this result should be
|
|
|
|
* aggregated with other "lower" providers.
|
2001-11-02 18:29:57 +03:00
|
|
|
*/
|
|
|
|
nsISimpleEnumerator getFiles(in string prop);
|
2000-02-11 08:04:53 +03:00
|
|
|
};
|
|
|
|
|
2001-11-02 18:29:57 +03:00
|
|
|
/**
|
|
|
|
* nsIDirectoryService
|
|
|
|
*/
|
|
|
|
|
2000-02-11 08:04:53 +03:00
|
|
|
[scriptable, uuid(57a66a60-d43a-11d3-8cc2-00609792278c)]
|
|
|
|
interface nsIDirectoryService: nsISupports
|
|
|
|
{
|
2001-11-02 18:29:57 +03:00
|
|
|
/**
|
|
|
|
* init
|
|
|
|
*
|
|
|
|
* Must be called. Used internally by XPCOM initialization.
|
|
|
|
*
|
|
|
|
*/
|
2001-01-19 01:51:57 +03:00
|
|
|
void init();
|
2001-11-02 18:29:57 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* registerProvider
|
|
|
|
*
|
|
|
|
* Register a provider with the service.
|
|
|
|
*
|
|
|
|
* @param prov The service will keep a strong reference
|
|
|
|
* to this object. It will be released when
|
|
|
|
* the service is released.
|
|
|
|
*
|
|
|
|
*/
|
2000-02-11 08:04:53 +03:00
|
|
|
void registerProvider(in nsIDirectoryServiceProvider prov);
|
2019-05-23 01:37:14 +03:00
|
|
|
|
2001-11-02 18:29:57 +03:00
|
|
|
/**
|
|
|
|
* unregisterProvider
|
|
|
|
*
|
|
|
|
* Unregister a provider with the service.
|
|
|
|
*
|
|
|
|
* @param prov
|
|
|
|
*
|
|
|
|
*/
|
2000-09-08 08:57:33 +04:00
|
|
|
void unregisterProvider(in nsIDirectoryServiceProvider prov);
|
2000-02-11 08:04:53 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|