/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org Code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsIEnumerator.idl"
interface nsIFile;
typedef long nsWellKnownRegistry;
interface nsIRegistry : nsISupports
{
const long None = 0;
const long Users = 1;
const long Common = 2;
const long CurrentUser = 3;
const long ApplicationComponentRegistry = 1;
const long ApplicationRegistry = 2;
// Dont use this one. This for internal use only.
const long ApplicationCustomRegistry = -1;
void flush();
boolean isOpen();
void getBytesUTF8(in nsRegistryKey baseKey, in string path, out PRUint32 length, [retval, array, size_is(length)] out PRUint8 valueArray);
void setBytesUTF8(in nsRegistryKey baseKey, in string path, in PRUint32 length, [array, size_is(length)] in PRUint8 valueArray);
/**
* addSubtree() and friends need to be renamed to addKeyUTF8().
* If you are using these forms make sure you pass UTF8 data
*/
/**
* escapeKey() takes arbitrary binary data and converts it into
* valid ASCII which can be used as registry key or value names
*/
void escapeKey([array, size_is(length)] in PRUint8 key, in PRUint32 terminator, inout PRUint32 length, [retval, array, size_is(length)] out PRUint8 escaped);
void unescapeKey([array, size_is(length)] in PRUint8 escaped, in PRUint32 terminator, inout PRUint32 length, [retval, array, size_is(length)] out PRUint8 key);
void pack();
};
interface nsIRegistryEnumerator : nsIEnumerator
{
};
interface nsIRegistryNode : nsISupports
{
};
interface nsIRegistryValue : nsISupports
{
};
/**
* It sucks that nsIRegistry has to always allocate and return
* strings. nsIRegistryGetter adds in interfaces for non allocating getters
* to registry values.
*/
interface nsIRegistryGetter : nsISupports
{
/**
* Get a string value of attribute valname in widestring or utf8 format
*
* @return
* NS_OK on success.
* buf has the string value copied into it. length is NOT changed.
* NS_ERROR_REG_BUFFER_TOO_SMALL if not enough buffer space.
* length is updated to actual length in chars including
* terminating NULL and buf will be unchanged.
* NS_ERROR_FAILURE if an unknown error happened. state of buf and
* length undefined.
* various failure codes otherwise. buf and length wont be updated.
*/
/**
* Get a a byte array value of attribute valname
*
* @return
* NS_OK on success. buf has the string value copied into it.
* length is updated to actual number of bytes copied into buf.
* NS_ERROR_REG_BUFFER_TOO_SMALL if not enough buffer space.
* length is updated to actual length in PRUint8s including
* terminating NULL and buf will be unchanged.
* NS_ERROR_FAILURE if an unknown error happened. state of buf and
* length undefined.
* various other failure codes otherwise. buf and length wont be updated.
*/
};
%{ C++
#include "nsIRegistryUtils.h"
%}