Scribus
Open source desktop publishing at your fingertips
localemgr.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 /***************************************************************************
8  begin : Jan 2005
9  copyright : (C) 2005 by Craig Bradney
10  email : cbradney@zip.com.au
11  ***************************************************************************/
12 
13 /***************************************************************************
14  * *
15  * This program is free software; you can redistribute it and/or modify *
16  * it under the terms of the GNU General Public License as published by *
17  * the Free Software Foundation; either version 2 of the License, or *
18  * (at your option) any later version. *
19  * *
20  ***************************************************************************/
21 
22 #ifndef LOCALEMANAGER_H
23 #define LOCALEMANAGER_H
24 
25 #include <QLocale>
26 #include <QMap>
27 #include <QString>
28 
29 #include "scribusapi.h"
30 
31 class SCRIBUS_API LocaleDef
32 {
33  friend class LocaleManager;
34 
35  public:
36  LocaleDef();
37  LocaleDef(const QString& locale, const QString& unit, const QString& pageSize)
38  {
39 
40  m_locale=locale;
41  m_unit=unit;
42  m_pageSize=pageSize;
43 
44  }
45  ~LocaleDef() {};
46 
47  private:
48  QString m_locale;
49  QString m_unit;
50  QString m_pageSize;
51 };
52 
53 class SCRIBUS_API LocaleManager
54 {
55  LocaleManager() {};
56  ~LocaleManager();
57 
58  void init();
59 
60 public:
61  static LocaleManager* instance();
62  static void deleteInstance();
63 
64  const QString getUnitFromLocale(QString);
65  void printSelectedForLocale(const QString &locale);
66  QString pageSizeForLocale(const QString &locale);
67  QString unitForLocale(const QString &locale);
68 
69 private:
70  static LocaleManager* m_instance;
71 
72  QList <LocaleDef> localeTable;
73  QLocale sysLocale;
74  void generateLocaleList();
75 };
76 
77 #endif
78 
Definition: localemgr.h:53
Definition: localemgr.h:31