00001 /* AbiSource Program Utilities 00002 * Copyright (C) 2001 Tomas Frydrych 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00017 * 02110-1301 USA. 00018 */ 00019 00020 #ifndef UT_LANGUAGE_H 00021 #define UT_LANGUAGE_H 00022 00023 /* pre-emptive dismissal; ut_types.h is needed by just about everything, 00024 * so even if it's commented out in-file that's still a lot of work for 00025 * the preprocessor to do... 00026 */ 00027 #ifndef UT_TYPES_H 00028 #include "ut_types.h" 00029 #endif 00030 00031 enum UT_LANGUAGE_DIR 00032 { 00033 UTLANG_LTR, 00034 UTLANG_RTL, 00035 UTLANG_VERTICAL 00036 }; 00037 00038 struct UT_LangRecord 00039 { 00040 const gchar * m_szLangCode; 00041 const gchar * m_szLangName; 00042 UT_uint32 m_nID; 00043 UT_LANGUAGE_DIR m_eDir; 00044 }; 00045 00046 00047 class ABI_EXPORT UT_Language 00048 { 00049 public: 00050 UT_Language(); 00051 00052 UT_uint32 getCount(); 00053 const gchar * getNthLangCode(UT_uint32 n); 00054 const gchar * getNthLangName(UT_uint32 n); 00055 UT_uint32 getNthId(UT_uint32 n); 00056 const gchar * getCodeFromName(const gchar * szName); 00057 const gchar * getCodeFromCode(const gchar * szCode); // 00058 //see the cpp file for explanation 00059 const UT_LangRecord* getLangRecordFromCode(const gchar * szCode); 00060 UT_uint32 getIndxFromCode(const gchar * szCode); 00061 UT_uint32 getIdFromCode(const gchar * szCode); 00062 UT_LANGUAGE_DIR getDirFromCode(const gchar * szCode); 00063 00064 private: 00065 static bool s_Init; 00066 }; 00067 00068 ABI_EXPORT void UT_Language_updateLanguageNames(); 00069 #endif