00001 /* AbiWord 00002 * Copyright (C) 1998 AbiSource, Inc. 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 AP_STRINGS_H 00021 #define AP_STRINGS_H 00022 00023 #include "xap_Strings.h" 00024 00026 // build a table of AP ID values 00028 00029 #define dcl(id,s) AP_STRING_ID_##id, 00030 00031 typedef enum _AP_String_Id_Enum 00032 { 00033 AP_STRING_ID__FIRST__ = 1000, /* must be first -- must be >= XAP_STRING_ID__LAST__ */ 00034 #include "ap_String_Id.h" 00035 AP_STRING_ID__LAST__ /* must be last */ 00036 } AP_String_Id_Enum; 00037 00038 #undef dcl 00039 00041 // a sub-class to wrap the compiled-in (english) strings 00043 00044 class ABI_EXPORT AP_BuiltinStringSet : public XAP_BuiltinStringSet 00045 { 00046 public: 00047 AP_BuiltinStringSet(XAP_App * pApp, const gchar * szLanguageName); 00048 virtual ~AP_BuiltinStringSet(void); 00049 00050 virtual const gchar * getValue(XAP_String_Id id) const; 00051 00052 #ifdef DEBUG 00053 bool dumpBuiltinSet(const char * szFilename) const; 00054 #endif 00055 00056 protected: 00057 const gchar ** m_arrayAP; 00058 }; 00059 00061 // a sub-class to deal with disk-based string sets (translations) 00063 00064 class ABI_EXPORT AP_DiskStringSet : public XAP_DiskStringSet 00065 { 00066 public: 00067 AP_DiskStringSet(XAP_App * pApp); 00068 virtual ~AP_DiskStringSet(void); 00069 00070 virtual bool setValue(XAP_String_Id id, const gchar * szString); 00071 virtual bool setValue(const gchar * szId, const gchar * szString); 00072 virtual const gchar * getValue(XAP_String_Id id) const; 00073 virtual bool loadStringsFromDisk(const char * szFilename); 00074 00075 protected: 00076 UT_GenericVector<gchar*> m_vecStringsAP; 00077 }; 00078 00079 00080 00081 #endif /* AP_STRINGS_H */ 00082 00083