Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

localemgr.h

00001 /******************************************************************************
00002  *  localemgr.h   - definition of class LocaleMgr used to interact with
00003  *                              registered locales for a sword installation
00004  *
00005  * $Id: localemgr_8h-source.html,v 1.1 2003/02/28 21:21:45 mgruner Exp $
00006  *
00007  * Copyright 1998 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 LOCALEMGR_H
00024 #define LOCALEMGR_H
00025 
00026 #include <string>
00027 #include <map>
00028 #include <list>
00029 #include <swconfig.h>
00030 #include <swlocale.h>
00031 
00032 #include <defs.h>
00033 
00034 SWORD_NAMESPACE_START
00035 
00036 typedef std::map < std::string, SWLocale *, std::less < std::string > >LocaleMap;
00037 
00049 class SWDLLEXPORT LocaleMgr
00050 {
00051 private:
00052   void deleteLocales ();
00053   char *defaultLocaleName;
00054   LocaleMgr(const LocaleMgr &);
00055 
00056 protected:
00057   LocaleMap locales;
00058 
00059 public:
00063   LocaleMgr (const char *iConfigPath = 0);
00064 
00068   virtual ~ LocaleMgr ();
00069 
00075   virtual SWLocale *getLocale (const char *name);
00076 
00081   virtual std::list < std::string > getAvailableLocales ();
00082   
00090   virtual const char *translate (const char *text, const char *localeName = 0);
00091 
00096   virtual const char *getDefaultLocaleName ();
00097 
00102   virtual void setDefaultLocaleName (const char *name);
00103 
00107   static LocaleMgr systemLocaleMgr;
00108 
00109   
00112   virtual void loadConfigDir(const char *ipath);
00113   
00114 };
00115 
00116 SWORD_NAMESPACE_END
00117 #endif

Generated on Fri Feb 28 22:01:38 2003 for The Sword Project by doxygen1.3-rc3