|
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "nsISupports.idl" |
|
7 |
|
8 /** |
|
9 * nsIErrorService: This is an interim service that allows nsresult codes to be mapped to |
|
10 * string bundles that can be used to look up error messages. String bundle keys can also |
|
11 * be mapped. |
|
12 * |
|
13 * This service will eventually get replaced by extending xpidl to allow errors to be defined. |
|
14 * (http://bugzilla.mozilla.org/show_bug.cgi?id=13423). |
|
15 */ |
|
16 [scriptable, uuid(afe1f190-a3c2-11e3-a5e2-0800200c9a66)] |
|
17 interface nsIErrorService : nsISupports |
|
18 { |
|
19 /** |
|
20 * Registers a string bundle URL for an error module. Error modules are obtained from |
|
21 * nsresult code with NS_ERROR_GET_MODULE. |
|
22 */ |
|
23 void registerErrorStringBundle(in short errorModule, in string stringBundleURL); |
|
24 |
|
25 /** |
|
26 * Unregisters a string bundle URL for an error module. |
|
27 */ |
|
28 void unregisterErrorStringBundle(in short errorModule); |
|
29 |
|
30 /** |
|
31 * Retrieves a string bundle URL for an error module. |
|
32 */ |
|
33 string getErrorStringBundle(in short errorModule); |
|
34 }; |
|
35 |
|
36 %{C++ |
|
37 |
|
38 // The global nsIErrorService: |
|
39 #define NS_ERRORSERVICE_NAME "Error Service" |
|
40 #define NS_ERRORSERVICE_CONTRACTID "@mozilla.org/xpcom/error-service;1" |
|
41 #define NS_ERRORSERVICE_CID \ |
|
42 { /* 744afd5e-5f8c-11d4-9877-00c04fa0cf4a */ \ |
|
43 0x744afd5e, \ |
|
44 0x5f8c, \ |
|
45 0x11d4, \ |
|
46 {0x98, 0x77, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a} \ |
|
47 } |
|
48 |
|
49 %} |