OpendTect  6.3
texttranslator.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Nanne Hemstra
8  Date: January 2010
9 ________________________________________________________________________
10 
11 -*/
12 
13 
14 #include "basicmod.h"
15 #include "notify.h"
16 #include "uistring.h"
17 #include "bufstringset.h"
18 
19 mFDQtclass(QTranslator);
20 mFDQtclass(QLocale);
21 mFDQtclass(QString);
22 
24 namespace File { class Path; }
25 
31 public:
34 
35  int nrSupportedLanguages() const;
36  uiString getLanguageUserName(int) const;
37  BufferString getLocaleName(int) const;
38  bool setLanguage(int,uiString& errmsg);
39  int currentLanguage() const;
40 
45  int changeCount() const { return dirtycount_; }
46  //Increased every time language is changed
47 
48  const mQtclass(QTranslator)* getQTranslator(const char* appl) const;
49  const mQtclass(QLocale)* getQLocale() const;
50 
51  bool addLanguage(TextTranslatorLanguage*);
53 
54 protected:
55  friend class TextTranslatorLanguage;
56 
57  void loadUSEnglish();
58 
62 public: //Speicalized stuff
63  static void GetLocalizationDir(File::Path&);
64  static char cApplicationEnd() { return '_'; }
65 };
66 
67 
70 mExpClass(Basic) TextTranslatorLanguage : public RefCount::Referenced
72 public:
74  const char*vlocalename);
75 
76  const mQtclass(QString)& getLanguageName() const;
77  const mQtclass(QLocale)& getLanguageLocale() const;
79 
80  bool addFile(const char* filename);
81 
82  bool load();
83 
84  const mQtclass(QTranslator)* getTranslator(const char* appl) const;
85 
86 protected:
88 
89  bool loaded_;
92  mQtclass(QLocale)* locale_;
93 
95 
98 };
99 
100 mGlobal(Basic) TextTranslateMgr& TrMgr();
#define mExpClass(module)
Definition: commondefs.h:157
const ::QTranslator * getTranslator(const char *appl) const
Interface for several file and directory related services.
Definition: file.h:29
int currentlanguageidx_
Definition: texttranslator.h:61
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
BufferStringSet applications_
Definition: texttranslator.h:97
#define mQtclass(cls)
Definition: commondefs.h:232
ObjectSet< QTranslator > translators_
Definition: texttranslator.h:96
#define mODTextTranslationClass(clss)
Definition: uistring.h:37
BufferString getLocaleName() const
#define mGlobal(module)
Definition: commondefs.h:160
::QLocale * locale_
Definition: texttranslator.h:92
const ::QString & getLanguageName() const
static char cApplicationEnd()
Definition: texttranslator.h:64
File pathname tools.
Definition: filepath.h:35
Definition: uistring.h:88
TextTranslateMgr & TrMgr()
Set of BufferString objects.
Definition: bufstringset.h:25
::QString * languagename_
Definition: texttranslator.h:91
ObjectSet< TextTranslatorLanguage > languages_
Definition: texttranslator.h:60
BufferStringSet filenames_
Definition: texttranslator.h:94
#define mFDQtclass(cls)
Definition: commondefs.h:231
const ::QLocale & getLanguageLocale() const
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
bool loaded_
Definition: texttranslator.h:89
int changeCount() const
Definition: texttranslator.h:45
Definition: texttranslator.h:70
int dirtycount_
Definition: texttranslator.h:59
bool addFile(const char *filename)
Notifier< TextTranslateMgr > languageChange
Definition: texttranslator.h:41
Definition: texttranslator.h:29
TextTranslatorLanguage(const char *vlocalename)
BufferString localename_
Definition: texttranslator.h:90

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