Back to index

lightning-sunbird  0.9+nobinonly
nsIWindowsRegKey.idl
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* vim:set ts=2 sw=2 sts=2 et cindent: */
00003 /* ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is mozilla.org code.
00017  *
00018  * The Initial Developer of the Original Code is Google Inc.
00019  * Portions created by the Initial Developer are Copyright (C) 2005
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *  Darin Fisher <darin@meer.net>
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either the GNU General Public License Version 2 or later (the "GPL"), or
00027  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 #include "nsISupports.idl"
00040 
00041 native HKEY(HKEY);
00042 
00050 [scriptable, uuid(2555b930-d64f-437e-9be7-0a2cb252c1f4)]
00051 interface nsIWindowsRegKey : nsISupports
00052 {
00060   const unsigned long ROOT_KEY_CLASSES_ROOT     = 0x80000000;
00061   const unsigned long ROOT_KEY_CURRENT_USER     = 0x80000001;
00062   const unsigned long ROOT_KEY_LOCAL_MACHINE    = 0x80000002;
00063 
00071   const unsigned long ACCESS_BASIC              = 0x00020000;
00072   const unsigned long ACCESS_QUERY_VALUE        = 0x00000001;
00073   const unsigned long ACCESS_SET_VALUE          = 0x00000002;
00074   const unsigned long ACCESS_CREATE_SUB_KEY     = 0x00000004;
00075   const unsigned long ACCESS_ENUMERATE_SUB_KEYS = 0x00000008;
00076   const unsigned long ACCESS_NOTIFY             = 0x00000010;
00077   const unsigned long ACCESS_READ               = ACCESS_BASIC |
00078                                                   ACCESS_QUERY_VALUE |
00079                                                   ACCESS_ENUMERATE_SUB_KEYS |
00080                                                   ACCESS_NOTIFY;
00081   const unsigned long ACCESS_WRITE              = ACCESS_BASIC |
00082                                                   ACCESS_SET_VALUE |
00083                                                   ACCESS_CREATE_SUB_KEY;
00084   const unsigned long ACCESS_ALL                = ACCESS_READ |
00085                                                   ACCESS_WRITE;
00086 
00100   const unsigned long TYPE_NONE   = 0;  // REG_NONE
00101   const unsigned long TYPE_STRING = 1;  // REG_SZ
00102   const unsigned long TYPE_BINARY = 3;  // REG_BINARY
00103   const unsigned long TYPE_INT    = 4;  // REG_DWORD
00104   const unsigned long TYPE_INT64  = 11; // REG_QWORD
00105 
00117   [noscript] attribute HKEY key;
00118 
00123   void close();
00124 
00141   void open(in unsigned long rootKey, in AString relPath, in unsigned long mode);
00142 
00158   void create(in unsigned long rootKey, in AString relPath, in unsigned long mode);
00159 
00166   nsIWindowsRegKey openChild(in AString relPath, in unsigned long mode);
00167 
00173   nsIWindowsRegKey createChild(in AString relPath, in unsigned long mode);
00174 
00178   readonly attribute unsigned long childCount;
00179 
00186   AString getChildName(in unsigned long index);
00187 
00194   boolean hasChild(in AString name);
00195 
00199   readonly attribute unsigned long valueCount;
00200 
00207   AString getValueName(in unsigned long index);
00208 
00215   boolean hasValue(in AString name);
00216 
00224   void removeChild(in AString relPath);
00225 
00232   void removeValue(in AString name);
00233 
00241   unsigned long getValueType(in AString name);
00242 
00251   AString readStringValue(in AString name);
00252 
00259   unsigned long readIntValue(in AString name);
00260 
00267   unsigned long long readInt64Value(in AString name);
00268 
00279   ACString readBinaryValue(in AString name);
00280 
00291   void writeStringValue(in AString name, in AString data);
00292 
00302   void writeIntValue(in AString name, in unsigned long data);
00303 
00313   void writeInt64Value(in AString name, in unsigned long long data);
00314 
00331   void writeBinaryValue(in AString name, in ACString data);
00332 
00342   void startWatching(in boolean recurse);
00343 
00348   void stopWatching();
00349 
00354   boolean isWatching();
00355 
00360   boolean hasChanged();
00361 };