Aspose::Words::Loading::LanguagePreferences Class Reference

Detailed Description

Allows to set up language preferences.

Examples

Shows how to apply language preferences when loading a document.

auto loadOptions = MakeObject<LoadOptions>();
loadOptions->get_LanguagePreferences()->AddEditingLanguage(EditingLanguage::Japanese);
auto doc = MakeObject<Document>(MyDir + u"No default editing language.docx", loadOptions);
int localeIdFarEast = doc->get_Styles()->get_DefaultFont()->get_LocaleIdFarEast();
std::cout << (localeIdFarEast == (int)EditingLanguage::Japanese
? String(u"The document either has no any FarEast language set in defaults or it was set to Japanese originally.")
: String(u"The document default FarEast language was set to another than Japanese language originally, so it is not overridden."))
<< std::endl;

#include <Aspose.Words.Cpp/Loading/LanguagePreferences.h>

+ Inheritance diagram for Aspose::Words::Loading::LanguagePreferences:

Public Member Functions

 LanguagePreferences ()
 
void AddEditingLanguage (EditingLanguage language)
 Adds additional editing language. More...
 
void AddEditingLanguages (ArrayPtr< EditingLanguage > languages)
 Adds additional editing languages. More...
 
EditingLanguage get_DefaultEditingLanguage () const
 Gets or sets default editing language. The default value is EnglishUS. More...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
void set_DefaultEditingLanguage (EditingLanguage value)
 Setter for get_DefaultEditingLanguage. More...
 

Static Public Member Functions

static const TypeInfoType ()
 

Constructor & Destructor Documentation

◆ LanguagePreferences()

Aspose::Words::Loading::LanguagePreferences::LanguagePreferences ( )

Member Function Documentation

◆ AddEditingLanguage()

void Aspose::Words::Loading::LanguagePreferences::AddEditingLanguage ( Aspose::Words::Loading::EditingLanguage  language)

Adds additional editing language.

Examples

Shows how to apply language preferences when loading a document.

auto loadOptions = MakeObject<LoadOptions>();
loadOptions->get_LanguagePreferences()->AddEditingLanguage(EditingLanguage::Japanese);
auto doc = MakeObject<Document>(MyDir + u"No default editing language.docx", loadOptions);
int localeIdFarEast = doc->get_Styles()->get_DefaultFont()->get_LocaleIdFarEast();
std::cout << (localeIdFarEast == (int)EditingLanguage::Japanese
? String(u"The document either has no any FarEast language set in defaults or it was set to Japanese originally.")
: String(u"The document default FarEast language was set to another than Japanese language originally, so it is not overridden."))
<< std::endl;

◆ AddEditingLanguages()

void Aspose::Words::Loading::LanguagePreferences::AddEditingLanguages ( System::ArrayPtr< Aspose::Words::Loading::EditingLanguage languages)

Adds additional editing languages.

◆ get_DefaultEditingLanguage()

Aspose::Words::Loading::EditingLanguage Aspose::Words::Loading::LanguagePreferences::get_DefaultEditingLanguage ( ) const

Gets or sets default editing language. The default value is EnglishUS.

Examples

Shows how set a default language when loading a document.

auto loadOptions = MakeObject<LoadOptions>();
loadOptions->get_LanguagePreferences()->set_DefaultEditingLanguage(EditingLanguage::Russian);
auto doc = MakeObject<Document>(MyDir + u"No default editing language.docx", loadOptions);
int localeId = doc->get_Styles()->get_DefaultFont()->get_LocaleId();
std::cout << (localeId == (int)EditingLanguage::Russian
? String(u"The document either has no any language set in defaults or it was set to Russian originally.")
: String(u"The document default language was set to another than Russian language originally, so it is not overridden."))
<< std::endl;

◆ GetType()

virtual const System::TypeInfo& Aspose::Words::Loading::LanguagePreferences::GetType ( ) const
overridevirtual

Reimplemented from System::Object.

◆ Is()

virtual bool Aspose::Words::Loading::LanguagePreferences::Is ( const System::TypeInfo target) const
overridevirtual

Reimplemented from System::Object.

◆ set_DefaultEditingLanguage()

void Aspose::Words::Loading::LanguagePreferences::set_DefaultEditingLanguage ( Aspose::Words::Loading::EditingLanguage  value)

◆ Type()

static const System::TypeInfo& Aspose::Words::Loading::LanguagePreferences::Type ( )
static