swlocale.h

00001 /******************************************************************************
00002  *  swlocale.h   - definition of Class SWLocale used for retrieval
00003  *                              of locale lookups
00004  *
00005  * $Id: swlocale.h 1864 2005-11-20 06:06:40Z scribe $
00006  *
00007  * Copyright 2000 CrossWire Bible Society (http://www.crosswire.org)
00008  *      CrossWire Bible Society
00009  *      P. O. Box 2528
00010  *      Tempe, AZ  85280-2528
00011  *
00012  * This program is free software; you can redistribute it and/or modify it
00013  * under the terms of the GNU General Public License as published by the
00014  * Free Software Foundation version 2.
00015  *
00016  * This program is distributed in the hope that it will be useful, but
00017  * WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  * General Public License for more details.
00020  *
00021  */
00022 
00023 #ifndef SWLOCALE_H
00024 #define SWLOCALE_H
00025 
00026 #include <defs.h>
00027 
00028 SWORD_NAMESPACE_START
00029 
00030 class SWConfig;
00031 static const int ENDOFABBREVS = -2;
00032 
00039 class SWDLLEXPORT SWLocale {
00040 
00041 class Private;
00042 
00043         Private *p;
00044 
00045         SWConfig *localeSource;
00046 
00047         char *name;
00048         char *description;
00049         char *encoding;
00050         struct abbrev *bookAbbrevs;
00051         char *BMAX;
00052         struct sbook **books;
00053 
00054 public:
00055         SWLocale(const char *ifilename);
00056         virtual ~SWLocale();
00057 
00062         virtual const char *getName();
00066         virtual const char *getDescription();
00067         virtual const char *getEncoding();
00068         virtual const char *translate(const char *text);
00069         virtual void augment(SWLocale &addFrom);
00070         virtual SWLocale & operator +=(SWLocale &addFrom) { augment(addFrom); return *this; }
00071         virtual const struct abbrev *getBookAbbrevs();
00072         virtual void getBooks(char **iBMAX, struct sbook ***ibooks);
00073 };
00074 
00075 SWORD_NAMESPACE_END
00076 #endif