OSDN Git Service

* Use standard order of header files
[winmerge-jp/winmerge-jp.git] / Src / Common / LanguageSelect.h
1 /** 
2  * @file  LanguageSelect.h
3  *
4  * @brief Declaration file for CLanguageSelect dialog.
5  */
6 // ID line follows -- this is updated by SVN
7 // $Id$
8
9 #if !defined(AFX_LANGUAGESELECT_H__4395A84F_E8DF_11D1_BBCB_00A024706EDC__INCLUDED_)
10 #define AFX_LANGUAGESELECT_H__4395A84F_E8DF_11D1_BBCB_00A024706EDC__INCLUDED_
11
12 #include "CMoveConstraint.h"
13
14 #include <vector>
15 #include <string>
16
17 /////////////////////////////////////////////////////////////////////////////
18 // CLanguageSelect dialog
19
20 /**
21  * @brief Dialog for selecting GUI language.
22  *
23  * Language select dialog shows list of installed GUI languages and
24  * allows user to select one for use.
25  */
26 class CLanguageSelect : public CDialog
27 {
28 // Construction
29 public:
30         void SetModuleHandle(HMODULE hModule) { m_hModule = hModule; }
31         CLanguageSelect(UINT idMainMenu, UINT idDocMenu, BOOL bReloadMenu =TRUE, BOOL bUpdateTitle =TRUE, CWnd* pParent = NULL);   // standard constructor
32         BOOL AreLangsInstalled() const;
33         WORD GetLangId() { return m_wCurLanguage; };
34         void InitializeLanguage();
35         void UpdateDocTitle();
36         void ReloadMenu();
37
38         bool TranslateString(size_t line, std::string &) const;
39         bool TranslateString(size_t line, std::wstring &) const;
40         void SetIndicators(CStatusBar &, const UINT *, int) const;
41         void TranslateMenu(HMENU) const;
42         void TranslateDialog(HWND) const;
43         String LoadString(UINT) const;
44         std::wstring LoadDialogCaption(LPCTSTR lpDialogTemplateID) const;
45
46 // Implementation data
47 private:
48         prdlg::CMoveConstraint m_constraint; 
49         BOOL m_bReloadMenu;
50         BOOL m_bUpdateTitle;
51         HMODULE m_hModule;
52         UINT m_idMainMenu;
53         UINT m_idDocMenu;
54         HINSTANCE m_hCurrentDll;
55         LANGID m_wCurLanguage;
56         std::vector<std::string> m_strarray;
57         unsigned m_codepage;
58 // Implementation methods
59 private:
60         String GetFileName(LANGID);
61         BOOL LoadLanguageFile(LANGID);
62         BOOL SetLanguage(LANGID);
63         UINT GetDocResId();
64         void LoadAndDisplayLanguages();
65
66 // Dialog Data
67         //{{AFX_DATA(CLanguageSelect)
68         enum { IDD = IDD_LANGUAGE_SELECT };
69         CListBox        m_ctlLangList;
70         //}}AFX_DATA
71
72
73 // Overrides
74         // ClassWizard generated virtual function overrides
75         //{{AFX_VIRTUAL(CLanguageSelect)
76         public:
77         protected:
78         virtual void DoDataExchange(CDataExchange* pDX);        // DDX/DDV support
79         //}}AFX_VIRTUAL
80
81
82         // Generated message map functions
83         //{{AFX_MSG(CLanguageSelect)
84         virtual void OnOK();
85         virtual BOOL OnInitDialog();
86         //}}AFX_MSG
87         DECLARE_MESSAGE_MAP()
88 };
89
90
91
92
93 //{{AFX_INSERT_LOCATION}}
94 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
95
96 #endif // !defined(AFX_LANGUAGESELECT_H__4395A84F_E8DF_11D1_BBCB_00A024706EDC__INCLUDED_)