noxstringDlg.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. // noxstringDlg.h : header file
  19. //
  20. #if !defined(AFX_NOXSTRINGDLG_H__2BF3124D_3BA1_11D3_B9DA_006097B90D93__INCLUDED_)
  21. #define AFX_NOXSTRINGDLG_H__2BF3124D_3BA1_11D3_B9DA_006097B90D93__INCLUDED_
  22. #if _MSC_VER > 1000
  23. #pragma once
  24. #endif // _MSC_VER > 1000
  25. #include "resource.h"
  26. #include "transdb.h"
  27. typedef enum
  28. {
  29. SAME_LINE,
  30. NEW_LINE
  31. } LogFormat;
  32. typedef struct
  33. {
  34. int new_strings;
  35. int deleted_strings;
  36. int modified_strings;
  37. int new_labels;
  38. int deleted_labels;
  39. int modified_labels;
  40. int skipped_labels;
  41. int updated_comments;
  42. int updated_contexts;
  43. int updated_waves;
  44. int updated_speakers;
  45. int updated_listeners;
  46. int updated_maxlen;
  47. int changes;
  48. } UPDATEINFO;
  49. class CNoxstringDlgAutoProxy;
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CNoxstringDlg dialog
  52. class CNoxstringDlg : public CDialog
  53. {
  54. DECLARE_DYNAMIC(CNoxstringDlg);
  55. friend class CNoxstringDlgAutoProxy;
  56. CProgressCtrl *progress;
  57. CStatic *percent;
  58. int progress_pos;
  59. int progress_range;
  60. int max_index;
  61. CComboBox *combo;
  62. int operate_always;
  63. // Construction
  64. public:
  65. int ValidateStrFile ( const char *filename );
  66. int MatchText ( NoxText *text, NoxLabel *label, NoxText **match );
  67. int RetranslateText ( NoxText *text, NoxText *label );
  68. void VerifyDialog( TransDB *db, LangID langid);
  69. void VerifyTranslations( TransDB *db, LangID langid ) ;
  70. int CanProceed ( void );
  71. int CanOperate ( void );
  72. int SaveMainDB ( void );
  73. int UpdateLabel ( NoxLabel *source, NoxLabel *destination, UPDATEINFO &info, int update = TRUE, int skip = FALSE);
  74. int UpdateDB ( TransDB *source, TransDB *destination, int update = TRUE);
  75. void ProgressComplete ( void );
  76. void SetProgress ( int pos );
  77. void InitProgress ( int range );
  78. int SaveLog ( void );
  79. void Status ( const char *string, int log = TRUE);
  80. void Log ( const char *string, LogFormat format = NEW_LINE );
  81. CNoxstringDlg(CWnd* pParent = NULL); // standard constructor
  82. virtual ~CNoxstringDlg();
  83. int LoadStrFile ( TransDB *db, const char *fileaname, void (*cb ) (void ) = NULL );
  84. void Ready ( void ) { Status ( "Ready", FALSE ); ProgressComplete(); };
  85. // Dialog Data
  86. //{{AFX_DATA(CNoxstringDlg)
  87. enum { IDD = IDD_NOXSTRING_DIALOG };
  88. // NOTE: the ClassWizard will add data members here
  89. //}}AFX_DATA
  90. // ClassWizard generated virtual function overrides
  91. //{{AFX_VIRTUAL(CNoxstringDlg)
  92. protected:
  93. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  94. //}}AFX_VIRTUAL
  95. // Implementation
  96. protected:
  97. CNoxstringDlgAutoProxy* m_pAutoProxy;
  98. HICON m_hIcon;
  99. BOOL CanExit();
  100. // Generated message map functions
  101. //{{AFX_MSG(CNoxstringDlg)
  102. virtual BOOL OnInitDialog();
  103. afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  104. afx_msg void OnPaint();
  105. afx_msg HCURSOR OnQueryDragIcon();
  106. afx_msg void OnClose();
  107. afx_msg void OnDropFiles(HDROP hDropInfo);
  108. afx_msg void OnViewdbs();
  109. afx_msg void OnReload();
  110. afx_msg void OnUpdate();
  111. afx_msg void OnSave();
  112. afx_msg void OnWarnings();
  113. afx_msg void OnErrors();
  114. afx_msg void OnChanges();
  115. afx_msg void OnExport();
  116. afx_msg void OnImport();
  117. afx_msg void OnGenerate();
  118. afx_msg void OnVerifyDialog();
  119. afx_msg void OnTranslations();
  120. afx_msg void OnSelchangeCombolang();
  121. afx_msg void OnReports();
  122. afx_msg void OnDblclkCombolang();
  123. afx_msg void OnReset();
  124. afx_msg void OnSent();
  125. //}}AFX_MSG
  126. DECLARE_MESSAGE_MAP()
  127. };
  128. extern CNoxstringDlg *MainDLG;
  129. //{{AFX_INSERT_LOCATION}}
  130. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  131. #endif // !defined(AFX_NOXSTRINGDLG_H__2BF3124D_3BA1_11D3_B9DA_006097B90D93__INCLUDED_)