Back to index

scribus-ng  1.3.4.dfsg+svn20071115
langmgr.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008     begin                : Jan 2005
00009     copyright            : (C) 2005 by Craig Bradney
00010     email                : cbradney@zip.com.au
00011  ***************************************************************************/
00012 
00013 /***************************************************************************
00014  *                                                                         *
00015  *   This program is free software; you can redistribute it and/or modify  *
00016  *   it under the terms of the GNU General Public License as published by  *
00017  *   the Free Software Foundation; either version 2 of the License, or     *
00018  *   (at your option) any later version.                                   *
00019  *                                                                         *
00020  ***************************************************************************/
00021  
00022 #ifndef LANGMANAGER_H
00023 #define LANGMANAGER_H
00024 
00025 #include <qmap.h>
00026 #include <utility>
00027 
00028 #include <qstring.h>
00029 #include "scribusapi.h"
00030 
00031 typedef std::pair<QString, QString> langPair;
00032 
00033 
00034 
00035 class SCRIBUS_API LanguageManager
00036 {
00037 public:
00038        LanguageManager() {};
00039        ~LanguageManager();
00040        void init(bool generateInstalledList = true);
00041        const QString getLangFromAbbrev(QString, bool getTranslated=true);
00042        const QString getAbbrevFromLang(QString, bool getFromTranslated=true, bool useInstalled=true);
00043        void fillInstalledStringList(QStringList *stringListToFill, bool addDefaults);
00044        void printInstalledList();
00045        QString numericSequence(QString seq);
00046 
00047 private:
00048        QMap<QString, langPair > langList;
00049        QMap<QString, QString> installedLangList;
00050 
00051        void generateLangList();
00052        void generateInstalledLangList();
00053        
00054 };
00055 
00056 #endif
00057