本文整理汇总了C++中AccessibleWrap::Language方法的典型用法代码示例。如果您正苦于以下问题:C++ AccessibleWrap::Language方法的具体用法?C++ AccessibleWrap::Language怎么用?C++ AccessibleWrap::Language使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AccessibleWrap
的用法示例。
在下文中一共展示了AccessibleWrap::Language方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReturnString
const gchar*
GetLocaleCB(AtkObject* aAtkObj)
{
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap)
return nullptr;
nsAutoString locale;
accWrap->Language(locale);
return AccessibleWrap::ReturnString(locale);
}
示例2: getDocumentLocaleCB
const gchar *
getDocumentLocaleCB(AtkDocument *aDocument)
{
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
if (!accWrap)
return nullptr;
nsAutoString locale;
accWrap->Language(locale);
return locale.IsEmpty() ? nullptr : AccessibleWrap::ReturnString(locale);
}
示例3: GetAccessibleWrap
const gchar *
getDocumentLocaleCB(AtkDocument *aDocument)
{
nsAutoString locale;
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
if (accWrap) {
accWrap->Language(locale);
} else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aDocument))) {
proxy->Language(locale);
}
return locale.IsEmpty() ? nullptr : AccessibleWrap::ReturnString(locale);
}
示例4: if
STDMETHODIMP
ia2Accessible::get_locale(IA2Locale* aLocale)
{
if (!aLocale)
return E_INVALIDARG;
// Language codes consist of a primary code and a possibly empty series of
// subcodes: language-code = primary-code ( "-" subcode )*
// Two-letter primary codes are reserved for [ISO639] language abbreviations.
// Any two-letter subcode is understood to be a [ISO3166] country code.
AccessibleWrap* acc = static_cast<AccessibleWrap*>(this);
if (acc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAutoString lang;
acc->Language(lang);
// If primary code consists from two letters then expose it as language.
int32_t offset = lang.FindChar('-', 0);
if (offset == -1) {
if (lang.Length() == 2) {
aLocale->language = ::SysAllocString(lang.get());
return S_OK;
}
} else if (offset == 2) {
aLocale->language = ::SysAllocStringLen(lang.get(), 2);
// If the first subcode consists from two letters then expose it as
// country.
offset = lang.FindChar('-', 3);
if (offset == -1) {
if (lang.Length() == 5) {
aLocale->country = ::SysAllocString(lang.get() + 3);
return S_OK;
}
} else if (offset == 5) {
aLocale->country = ::SysAllocStringLen(lang.get() + 3, 2);
}
}
// Expose as a string if primary code or subcode cannot point to language or
// country abbreviations or if there are more than one subcode.
aLocale->variant = ::SysAllocString(lang.get());
return S_OK;
}