michael@0: /* -*- Mode: C++; tab-width: 4; 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: /** michael@0: * nsIErrorService: This is an interim service that allows nsresult codes to be mapped to michael@0: * string bundles that can be used to look up error messages. String bundle keys can also michael@0: * be mapped. michael@0: * michael@0: * This service will eventually get replaced by extending xpidl to allow errors to be defined. michael@0: * (http://bugzilla.mozilla.org/show_bug.cgi?id=13423). michael@0: */ michael@0: [scriptable, uuid(afe1f190-a3c2-11e3-a5e2-0800200c9a66)] michael@0: interface nsIErrorService : nsISupports michael@0: { michael@0: /** michael@0: * Registers a string bundle URL for an error module. Error modules are obtained from michael@0: * nsresult code with NS_ERROR_GET_MODULE. michael@0: */ michael@0: void registerErrorStringBundle(in short errorModule, in string stringBundleURL); michael@0: michael@0: /** michael@0: * Unregisters a string bundle URL for an error module. michael@0: */ michael@0: void unregisterErrorStringBundle(in short errorModule); michael@0: michael@0: /** michael@0: * Retrieves a string bundle URL for an error module. michael@0: */ michael@0: string getErrorStringBundle(in short errorModule); michael@0: }; michael@0: michael@0: %{C++ michael@0: michael@0: // The global nsIErrorService: michael@0: #define NS_ERRORSERVICE_NAME "Error Service" michael@0: #define NS_ERRORSERVICE_CONTRACTID "@mozilla.org/xpcom/error-service;1" michael@0: #define NS_ERRORSERVICE_CID \ michael@0: { /* 744afd5e-5f8c-11d4-9877-00c04fa0cf4a */ \ michael@0: 0x744afd5e, \ michael@0: 0x5f8c, \ michael@0: 0x11d4, \ michael@0: {0x98, 0x77, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a} \ michael@0: } michael@0: michael@0: %}