NeroPluginNLS.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /******************************************************************************
  2. |* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3. |* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4. |* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5. |* PARTICULAR PURPOSE.
  6. |*
  7. |* Copyright 1995-2005 Nero AG. All Rights Reserved.
  8. |*-----------------------------------------------------------------------------
  9. |* NeroSDK / AudioPluginManager
  10. |*
  11. |* FILE: NeroPluginNLS.h
  12. |*
  13. |* PURPOSE: Translator class definition for NLS support for Nero plugins
  14. ******************************************************************************/
  15. #ifndef _NERO_PLUGIN_NLS_
  16. #define _NERO_PLUGIN_NLS_
  17. /////////////////////////////////////////////////////////// CStranslateAction //
  18. #include "afxtempl.h"
  19. enum EWindowType
  20. {
  21. ETT_Wrong,
  22. ETT_Combo,
  23. ETT_ListBox,
  24. ETT_Other
  25. };
  26. class CTranslateAction
  27. {
  28. // Construction/Destruction
  29. public:
  30. CTranslateAction(HWND hWnd, const char *szPrevText);
  31. ~CTranslateAction();
  32. // Operations
  33. public:
  34. void Undo();
  35. void AddSubItemAction(int iNum, const char *szPrevText);
  36. protected:
  37. // Data
  38. protected:
  39. HWND m_hWnd;
  40. CString m_csPrevText;
  41. EWindowType m_type;
  42. struct SUBACTION
  43. {
  44. // Construction/Destruction
  45. SUBACTION()
  46. : m_iItem (-1)
  47. {}
  48. SUBACTION(int iItemNum, const char *szPrevText)
  49. : m_iItem (iItemNum),
  50. m_csPrevText (szPrevText)
  51. {}
  52. // Data
  53. int m_iItem;
  54. CString m_csPrevText;
  55. };
  56. CArray<SUBACTION, SUBACTION&> m_SubActions;
  57. bool m_bUndone;
  58. };
  59. ///////////////////////////////////////////////////////////////// CTranslator //
  60. // Translator class. Translates windows and separate expressions.
  61. class CTranslator
  62. {
  63. // Construction/Destruction
  64. public:
  65. CTranslator(WORD wResID, const char *szLang);
  66. ~CTranslator();
  67. // Operations
  68. public:
  69. void TranslateWindow(HWND hMainWnd);
  70. void TranslateMenu(HMENU hMenu);
  71. void UndoTranslation();
  72. void GetWordTranslation(const char *szWord, CString *pcs);
  73. // Data
  74. protected:
  75. CString m_csLang;
  76. CStringArray m_strarEng,
  77. m_strarTgt;
  78. // Maps window handles to CTranslateAction pointers.
  79. CMapPtrToPtr m_History;
  80. };
  81. CTranslator * CreateTranslator(WORD wResID, LANGID id);
  82. void DestroyTranslator(CTranslator *pTranslator);
  83. #endif _NERO_PLUGIN_NLS_