Copy as Markdown

Other Tools

/* 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/. */
/* Generated with cbindgen:0.26.0 */
/* DO NOT MODIFY THIS MANUALLY! This file was generated using cbindgen. See RunCbindgen.py */
#ifndef mozilla_intl_l10n_LocalizationBindings_h
#error "Don't include this file directly, instead include LocalizationBindings.h"
#endif
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>
#include "mozilla/intl/RegistryBindings.h"
namespace mozilla {
namespace intl {
namespace ffi {
struct GeckoBundleAdapter;
struct GeckoEnvironment;
struct LocalizationRc;
using GeckoL10nRegistry = L10nRegistry<GeckoEnvironment, GeckoBundleAdapter>;
struct L10nKey {
const nsACString *id;
nsTArray<L10nArg> args;
};
struct L10nAttribute {
nsCString name;
nsCString value;
};
struct L10nMessage {
nsCString value;
nsTArray<L10nAttribute> attributes;
};
struct OptionalL10nMessage {
bool is_present;
L10nMessage message;
};
extern "C" {
const void *localization_parse_locale(const nsCString *input);
void localization_new(const nsTArray<GeckoResourceId> *res_ids,
bool is_sync,
const GeckoL10nRegistry *reg,
const LocalizationRc **result);
bool localization_new_with_locales(const nsTArray<GeckoResourceId> *res_ids,
bool is_sync,
const GeckoL10nRegistry *reg,
const nsTArray<nsCString> *locales,
const LocalizationRc **result);
void localization_addref(const LocalizationRc *loc);
void localization_release(const LocalizationRc *loc);
void localization_add_res_id(const LocalizationRc *loc, const GeckoResourceId *res_id);
void localization_add_res_ids(const LocalizationRc *loc, const nsTArray<GeckoResourceId> *res_ids);
uintptr_t localization_remove_res_id(const LocalizationRc *loc, const GeckoResourceId *res_id);
uintptr_t localization_remove_res_ids(const LocalizationRc *loc,
const nsTArray<GeckoResourceId> *res_ids);
bool localization_format_value_sync(const LocalizationRc *loc,
const nsACString *id,
const nsTArray<L10nArg> *args,
nsACString *ret_val,
nsTArray<nsCString> *ret_err);
bool localization_format_values_sync(const LocalizationRc *loc,
const nsTArray<L10nKey> *keys,
nsTArray<nsCString> *ret_val,
nsTArray<nsCString> *ret_err);
bool localization_format_messages_sync(const LocalizationRc *loc,
const nsTArray<L10nKey> *keys,
nsTArray<OptionalL10nMessage> *ret_val,
nsTArray<nsCString> *ret_err);
void localization_format_value(const LocalizationRc *loc,
const nsACString *id,
const nsTArray<L10nArg> *args,
const dom::Promise *promise,
void (*callback)(const dom::Promise*,
const nsACString*,
const nsTArray<nsCString>*));
void localization_format_values(const LocalizationRc *loc,
const nsTArray<L10nKey> *keys,
const dom::Promise *promise,
void (*callback)(const dom::Promise*,
const nsTArray<nsCString>*,
const nsTArray<nsCString>*));
void localization_format_messages(const LocalizationRc *loc,
const nsTArray<L10nKey> *keys,
const dom::Promise *promise,
void (*callback)(const dom::Promise*,
const nsTArray<OptionalL10nMessage>*,
const nsTArray<nsCString>*));
void localization_set_async(const LocalizationRc *loc);
bool localization_is_sync(const LocalizationRc *loc);
void localization_on_change(const LocalizationRc *loc);
} // extern "C"
} // namespace ffi
} // namespace intl
} // namespace mozilla