Back to index

lightning-sunbird  0.9+nobinonly
nsIRegistry.idl
Go to the documentation of this file.
00001 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org Code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1999
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 #include "nsISupports.idl"
00038 #include "nsIEnumerator.idl"
00039 
00040 interface nsIFile;
00041 
00042 typedef PRUint32 nsRegistryKey;
00043 typedef long     nsWellKnownRegistry;
00044 
00045 [scriptable,uuid(5D41A440-8E37-11d2-8059-00600811A9C3)]
00046 interface nsIRegistry : nsISupports
00047 {
00048     const long None = 0;
00049     const long Users = 1;
00050     const long Common = 2;
00051     const long CurrentUser = 3;
00052 
00053     const long ApplicationComponentRegistry = 1;
00054     const long ApplicationRegistry = 2;
00055 
00056     // Dont use this one. This for internal use only.
00057     const long ApplicationCustomRegistry = -1;
00058 
00059     void open(in nsIFile regFile);
00060     void openWellKnownRegistry(in nsWellKnownRegistry regid);
00061 
00062     void flush();
00063     boolean isOpen();
00064     
00065     nsRegistryKey addKey(in nsRegistryKey baseKey, in wstring keyname);
00066     nsRegistryKey getKey(in nsRegistryKey baseKey, in wstring keyname);
00067     void removeKey(in nsRegistryKey baseKey, in wstring keyname);
00068 
00069     wstring getString(in nsRegistryKey baseKey, in wstring valname);
00070     void setString(in nsRegistryKey baseKey, in wstring valname, in wstring value);
00071 
00072     string getStringUTF8(in nsRegistryKey baseKey, in string path);
00073     void setStringUTF8(in nsRegistryKey baseKey, in string path, in string value);
00074 
00075     void getBytesUTF8(in nsRegistryKey baseKey, in string path, out PRUint32 length, [retval, array, size_is(length)] out PRUint8 valueArray);
00076     void setBytesUTF8(in nsRegistryKey baseKey, in string path, in PRUint32 length, [array, size_is(length)] in PRUint8 valueArray);
00077     PRInt32 getInt(in nsRegistryKey baseKey, in string path);
00078     void setInt(in nsRegistryKey baseKey, in string path, in PRInt32 value);
00079     PRInt64 getLongLong(in nsRegistryKey baseKey, in string path);
00080     void setLongLong(in nsRegistryKey baseKey, in string path, inout PRInt64 value);
00081 
00086     nsRegistryKey addSubtree(in nsRegistryKey baseKey, in string path);
00087     void removeSubtree(in nsRegistryKey baseKey, in string path);
00088     nsRegistryKey getSubtree(in nsRegistryKey baseKey, in string path);
00089 
00090     nsRegistryKey addSubtreeRaw(in nsRegistryKey baseKey, in string path);
00091     void removeSubtreeRaw(in nsRegistryKey baseKey, in string path);
00092     nsRegistryKey getSubtreeRaw(in nsRegistryKey baseKey, in string path);
00093 
00094     nsIEnumerator enumerateSubtrees(in nsRegistryKey baseKey);
00095     nsIEnumerator enumerateAllSubtrees(in nsRegistryKey baseKey);
00096     nsIEnumerator enumerateValues(in nsRegistryKey baseKey);
00097     
00098     const unsigned long String = 1;
00099     const unsigned long Int32 = 2;
00100     const unsigned long Bytes = 3;
00101     const unsigned long File = 4;
00102     
00103     unsigned long getValueType(in nsRegistryKey baseKey, in string path);
00104     PRUint32 getValueLength(in nsRegistryKey baseKey, in string path);
00105     void deleteValue(in nsRegistryKey baseKey, in string path);
00106 
00111     void escapeKey([array, size_is(length)] in PRUint8 key, in PRUint32 terminator, inout PRUint32 length, [retval, array, size_is(length)] out PRUint8 escaped); 
00112     void unescapeKey([array, size_is(length)] in PRUint8 escaped, in PRUint32 terminator, inout PRUint32 length, [retval, array, size_is(length)] out PRUint8 key); 
00113 
00114     attribute string currentUserName;
00115 
00116     void pack();
00117 };
00118 
00119 [scriptable, uuid(8cecf236-1dd2-11b2-893c-f9848956eaec)]
00120 interface nsIRegistryEnumerator : nsIEnumerator
00121 {
00122     void currentItemInPlaceUTF8(out nsRegistryKey key,
00123                                 [shared, retval] out string item);
00124 };
00125 
00126 [scriptable, uuid(D1B54831-AC07-11d2-805E-00600811A9C3)]
00127 interface nsIRegistryNode : nsISupports
00128 {
00129     readonly attribute string nameUTF8;
00130     readonly attribute wstring name;
00131     readonly attribute nsRegistryKey key;
00132 };
00133 
00134 [scriptable,uuid(5316C380-B2F8-11d2-A374-0080C6F80E4B)]
00135 interface nsIRegistryValue : nsISupports
00136 {
00137     readonly attribute wstring name;
00138     readonly attribute string nameUTF8;
00139     readonly attribute unsigned long type;
00140     readonly attribute PRUint32 length;
00141 };
00142 
00143 [uuid(3A15FC88-7A61-4Ab4-8E58-31E95fAB3DA8)]
00149 interface nsIRegistryGetter : nsISupports
00150 {
00164     void getStringUTF8IntoBuffer(in nsRegistryKey baseKey, in string path,
00165                                  inout char buf, inout PRUint32 length);
00166 
00180     void getBytesUTF8IntoBuffer(in nsRegistryKey baseKey, in string path,
00181                                 inout PRUint8 buf, inout PRUint32 length);
00182 };
00183 
00184 %{ C++
00185 #include "nsIRegistryUtils.h"
00186 %}