1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/base/nsIErrorService.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,49 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +/** 1.12 + * nsIErrorService: This is an interim service that allows nsresult codes to be mapped to 1.13 + * string bundles that can be used to look up error messages. String bundle keys can also 1.14 + * be mapped. 1.15 + * 1.16 + * This service will eventually get replaced by extending xpidl to allow errors to be defined. 1.17 + * (http://bugzilla.mozilla.org/show_bug.cgi?id=13423). 1.18 + */ 1.19 +[scriptable, uuid(afe1f190-a3c2-11e3-a5e2-0800200c9a66)] 1.20 +interface nsIErrorService : nsISupports 1.21 +{ 1.22 + /** 1.23 + * Registers a string bundle URL for an error module. Error modules are obtained from 1.24 + * nsresult code with NS_ERROR_GET_MODULE. 1.25 + */ 1.26 + void registerErrorStringBundle(in short errorModule, in string stringBundleURL); 1.27 + 1.28 + /** 1.29 + * Unregisters a string bundle URL for an error module. 1.30 + */ 1.31 + void unregisterErrorStringBundle(in short errorModule); 1.32 + 1.33 + /** 1.34 + * Retrieves a string bundle URL for an error module. 1.35 + */ 1.36 + string getErrorStringBundle(in short errorModule); 1.37 +}; 1.38 + 1.39 +%{C++ 1.40 + 1.41 +// The global nsIErrorService: 1.42 +#define NS_ERRORSERVICE_NAME "Error Service" 1.43 +#define NS_ERRORSERVICE_CONTRACTID "@mozilla.org/xpcom/error-service;1" 1.44 +#define NS_ERRORSERVICE_CID \ 1.45 +{ /* 744afd5e-5f8c-11d4-9877-00c04fa0cf4a */ \ 1.46 + 0x744afd5e, \ 1.47 + 0x5f8c, \ 1.48 + 0x11d4, \ 1.49 + {0x98, 0x77, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a} \ 1.50 +} 1.51 + 1.52 +%}