Branch libreoffice-5-0-4
[LibreOffice.git] / include / svtools / langtab.hxx
blob56d06188266c295800b5d780bac73d9efb36c263
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SVTOOLS_LANGTAB_HXX
20 #define INCLUDED_SVTOOLS_LANGTAB_HXX
22 #include <i18nlangtag/lang.h>
23 #include <rtl/ustring.hxx>
24 #include <svtools/svtdllapi.h>
26 class LanguageTag;
28 class SVT_DLLPUBLIC SvtLanguageTable
30 public:
32 static bool HasLanguageType( const LanguageType eType );
33 static OUString GetLanguageString( const LanguageType eType );
34 static LanguageType GetLanguageType( const OUString& rStr );
35 static sal_uInt32 GetLanguageEntryCount();
36 static LanguageType GetLanguageTypeAtIndex( sal_uInt32 nIndex );
38 /**
39 @param bUserInterfaceSelection
40 If TRUE, don't replace an UI-only locale. Only use for
41 Tools->Options->LanguageSettings->UserInterface listbox.
42 If FALSE, do replace; same as GetLanguageString() without bool
43 parameter.
45 static OUString GetLanguageString( const LanguageType eType, bool bUserInterfaceSelection );
47 /** Add a language tag to the table.
49 @param rString
50 UI visible description string. If empty, the rLanguageTag Bcp47
51 string is used instead.
53 static sal_uInt32 AddLanguageTag( const LanguageTag& rLanguageTag, const OUString& rString );
56 // Add LRE or RLE embedding characters to the string based on the
57 // String content (see #i78466#, #i32179#)
58 SVT_DLLPUBLIC const OUString ApplyLreOrRleEmbedding( const OUString &rText );
60 #endif
62 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */