OSDN Git Service

Merge with stable
[winmerge-jp/winmerge-jp.git] / Src / Common / LanguageSelect.h
1 /** 
2  * @file  LanguageSelect.h
3  *
4  * @brief Declaration file for CLanguageSelect dialog.
5  */
6 #pragma once
7
8 #include <vector>
9 #include <string>
10 #include <map>
11 #include "CMoveConstraint.h"
12
13 /////////////////////////////////////////////////////////////////////////////
14 // CLanguageSelect class
15
16 /**
17  * @brief Class for selecting GUI language.
18  *
19  * Language select dialog shows list of installed GUI languages and
20  * allows user to select one for use.
21  */
22 class CLanguageSelect
23 {
24 // Construction
25 public:
26         CLanguageSelect();   // standard constructor
27         WORD GetLangId() const { return m_wCurLanguage; }
28         void InitializeLanguage(WORD langID);
29
30         bool TranslateString(size_t line, std::string &) const;
31         bool TranslateString(size_t line, std::wstring &) const;
32         bool TranslateString(const std::string&, String &) const;
33         void SetIndicators(CStatusBar &, const UINT *, int) const;
34         void TranslateMenu(HMENU) const;
35         void TranslateDialog(HWND) const;
36         String LoadString(UINT) const;
37         std::wstring LoadDialogCaption(LPCTSTR lpDialogTemplateID) const;
38         std::vector<std::pair<LANGID, String> > GetAvailableLanguages() const;
39         BOOL SetLanguage(LANGID, BOOL bShowError = FALSE);
40
41 // Implementation data
42 private:
43         HINSTANCE m_hCurrentDll;
44         LANGID m_wCurLanguage;
45         std::vector<std::string> m_strarray;
46         typedef std::map<std::string, int> EngLinenoMap;
47         EngLinenoMap m_map_lineno;
48         unsigned m_codepage;
49 // Implementation methods
50 private:
51         String GetFileName(LANGID) const;
52         BOOL LoadLanguageFile(LANGID, BOOL bShowError = FALSE);
53 };