OpendTect-6_4  6.4
texttranslator.h
Go to the documentation of this file.
1 #ifndef texttranslator_h
2 #define texttranslator_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Nanne Hemstra
9  Date: January 2010
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 -*/
14 
15 
16 #include "basicmod.h"
17 #include "callback.h"
18 #include "uistring.h"
19 #include "threadlock.h"
20 #include "objectset.h"
21 #include "bufstring.h"
22 #include "bufstringset.h"
23 
24 mFDQtclass(QTranslator)
25 mFDQtclass(QLocale)
26 mFDQtclass(QString)
27 
29 class FilePath;
30 
36 public:
39 
40  int nrSupportedLanguages() const;
41  uiString getLanguageUserName(int) const;
42  BufferString getLocaleName(int) const;
43  bool setLanguage(int,uiString& errmsg);
44  int currentLanguage() const;
45 
50  int changeCount() const { return dirtycount_; }
51  //Increased every time language is changed
52 
53  const mQtclass(QTranslator)* getQTranslator(const char* appl) const;
54  const mQtclass(QLocale)* getQLocale() const;
55 
56  bool addLanguage(TextTranslatorLanguage*);
58 
59  static bool loadTranslations();
64 protected:
65  friend class TextTranslatorLanguage;
66 
67  void loadUSEnglish();
68 
72 
73 public: //Speicalized stuff
74  static void GetLocalizationDir(FilePath&);
75  static char cApplicationEnd() { return '_'; }
76 };
77 
78 
82 {
83  mRefCountImpl(TextTranslatorLanguage);
84  mODTextTranslationClass(TextTranslatorLanguage);
85 public:
87  const char*vlocalename);
88 
89  const mQtclass(QString)& getLanguageName() const;
90  const mQtclass(QLocale)& getLanguageLocale() const;
92 
93  bool addFile(const char* filename);
94 
95  bool load();
96 
97  const mQtclass(QTranslator)* getTranslator(const char* appl) const;
98 
99 protected:
100 
101  bool loaded_;
104  mQtclass(QLocale)* locale_;
105 
107 
110 };
111 
112 mGlobal(Basic) TextTranslateMgr& TrMgr();
113 
114 namespace OD
115 {
116 mGlobal(Basic) void loadLocalization();
117 }
118 
119 #endif
#define mRefCountImpl(ClassName)
Macro to setup a class with destructor for reference counting.
Definition: refcount.h:163
#define mExpClass(module)
Definition: commondefs.h:160
const ::QTranslator * getTranslator(const char *appl) const
int currentlanguageidx_
Definition: texttranslator.h:71
To be able to send and/or receive CallBacks, inherit from this class.
Definition: callback.h:272
BufferStringSet applications_
Definition: texttranslator.h:109
#define mQtclass(cls)
Definition: commondefs.h:229
ObjectSet< QTranslator > translators_
Definition: texttranslator.h:108
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
BufferString getLocaleName() const
#define mGlobal(module)
Definition: commondefs.h:163
::QLocale * locale_
Definition: texttranslator.h:104
const ::QString & getLanguageName() const
static char cApplicationEnd()
Definition: texttranslator.h:75
Definition: uistring.h:89
TextTranslateMgr & TrMgr()
Set of BufferString objects.
Definition: bufstringset.h:28
::QString * languagename_
Definition: texttranslator.h:103
ObjectSet< TextTranslatorLanguage > languages_
Definition: texttranslator.h:70
BufferStringSet filenames_
Definition: texttranslator.h:106
#define mFDQtclass(cls)
Definition: commondefs.h:228
const ::QLocale & getLanguageLocale() const
File pathname tools.
Definition: filepath.h:34
void loadLocalization()
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
bool loaded_
Definition: texttranslator.h:101
OpendTect.
Definition: commontypes.h:29
int changeCount() const
Definition: texttranslator.h:50
Definition: texttranslator.h:81
int dirtycount_
Definition: texttranslator.h:69
bool addFile(const char *filename)
Notifier< TextTranslateMgr > languageChange
Definition: texttranslator.h:46
Definition: texttranslator.h:34
TextTranslatorLanguage(const char *vlocalename)
BufferString localename_
Definition: texttranslator.h:102

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019