2019-05-21 19:22:36 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2019-07-01 17:56:57 +00:00
|
|
|
/**
|
|
|
|
* This is an internal XPIDL used to expose a JS based Localization class to be used
|
|
|
|
* by its C++ wrapper.
|
|
|
|
*
|
|
|
|
* Consumers should use the WebIDL Localization API instead of this one.
|
|
|
|
*/
|
2019-05-21 19:22:36 +00:00
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
[scriptable, uuid(7d468600-551f-4fe0-98c9-92a53b63ec8d)]
|
|
|
|
interface mozILocalization : nsISupports
|
|
|
|
{
|
2020-05-31 06:58:41 +00:00
|
|
|
void activate(in bool aSync, in bool aEager, in jsval aGenerateBundles, in jsval aGenerateBundlesSync);
|
|
|
|
|
|
|
|
void setIsSync(in boolean isSync);
|
|
|
|
|
|
|
|
unsigned long addResourceId(in AString resourceId);
|
|
|
|
unsigned long removeResourceId(in AString resourceId);
|
|
|
|
|
|
|
|
unsigned long addResourceIds(in Array<AString> resourceIds);
|
|
|
|
unsigned long removeResourceIds(in Array<AString> resourceIds);
|
|
|
|
|
|
|
|
Promise formatMessages(in Array<jsval> aKeys);
|
|
|
|
Promise formatValues(in Array<jsval> aKeys);
|
|
|
|
Promise formatValue(in AUTF8String aId, [optional] in jsval aArgs);
|
2020-05-19 17:02:59 +00:00
|
|
|
|
2020-05-31 06:58:41 +00:00
|
|
|
AUTF8String formatValueSync(in AUTF8String aId, [optional] in jsval aArgs);
|
|
|
|
Array<AUTF8String> formatValuesSync(in Array<jsval> aKeys);
|
|
|
|
Array<jsval> formatMessagesSync(in Array<jsval> aKeys);
|
2020-04-10 23:35:03 +00:00
|
|
|
|
2020-05-31 06:58:41 +00:00
|
|
|
void onChange();
|
2019-05-21 19:22:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
[scriptable, uuid(96632d26-1422-12e9-b1ce-9bb586acd241)]
|
|
|
|
interface mozILocalizationJSM : nsISupports
|
|
|
|
{
|
2020-05-31 06:58:41 +00:00
|
|
|
mozILocalization getLocalization();
|
2019-05-21 19:22:36 +00:00
|
|
|
};
|