Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

339 lines
7.9 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: locenum.h
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. //
  8. //
  9. //-----------------------------------------------------------------------------
  10. //------------------------------------------------------------------------------
  11. class LTAPIENTRY CStringType
  12. {
  13. public:
  14. //
  15. // This order is important - if must change it, make sure you make the
  16. // corresponding changes in GetTypeName() and GetTypeTLA()!
  17. // All new values must be added TO THE END, or you will break old
  18. // parsers...
  19. //
  20. // NOTE: These #include files define an enumeration. They MUST be inside this
  21. // class definition.
  22. //
  23. #include "PreCEnum.h"
  24. #include "EnumStringType.h"
  25. static int DefaultValue;
  26. NOTHROW static const TCHAR * GetTypeName(CStringType::StringType);
  27. NOTHROW static const TCHAR * GetTypeTLA(CStringType::StringType);
  28. static void Enumerate(CEnumCallback &);
  29. static const CStringType::StringType GetStringType(const TCHAR * tChIn);
  30. static const TCHAR * GetDefaultStringTypeText();
  31. static const CStringType::StringType GetDefaultStringType();
  32. static bool IsValidStringType(const CStringType::StringType &nIn);
  33. static bool IsValidStringType(const TCHAR * tChIn);
  34. private:
  35. //
  36. // Nobody should actually CONTRUCT one of these.
  37. //
  38. CStringType();
  39. //
  40. // Used to store the info about each element in the enum...
  41. //
  42. struct StringTypeInfo
  43. {
  44. TCHAR szTLA[4];
  45. const TCHAR * szName;
  46. };
  47. static const StringTypeInfo m_Info[];
  48. };
  49. typedef CStringType CST;
  50. //------------------------------------------------------------------------------
  51. class LTAPIENTRY CPlatform
  52. {
  53. public:
  54. // NOTE: These #include files define an enumeration. They MUST be inside this
  55. // class definition.
  56. //
  57. #include "PreCEnum.h"
  58. #include "EnumPlatform.h"
  59. NOTHROW static const TCHAR * GetPlatformName(CPlatform::Platform);
  60. static void Enumerate(CEnumCallback &);
  61. static const CPlatform::Platform CPlatform::GetPlatformType(const TCHAR * tChplat);
  62. static const TCHAR * GetDefaultPlatformText();
  63. static const CPlatform::Platform GetDefaultPlatform();
  64. static bool IsValidPlatform(const CPlatform::Platform &nIn);
  65. static bool IsValidPlatform(const TCHAR * tChplat);
  66. private:
  67. static int DefaultValue;
  68. static const TCHAR * const m_szPlatformNames[];
  69. };
  70. //------------------------------------------------------------------------------
  71. class LTAPIENTRY CLocApprovalState
  72. {
  73. public:
  74. enum ApprovalState
  75. {
  76. Invalid = 0,
  77. Old_Pending, // OBSOLETE! Do Not Use!
  78. Approved,
  79. PreApproved,
  80. NotReady,
  81. Failed,
  82. ForResearch,
  83. NotApplicable
  84. };
  85. static ApprovalState DefaultValue;
  86. NOTHROW static const TCHAR * GetApprovalText(CLocApprovalState::ApprovalState);
  87. static void Enumerate(CEnumCallback &);
  88. static const CLocApprovalState::ApprovalState GetApprovalState(const TCHAR * );
  89. static const TCHAR * GetDefaultApprovalText();
  90. static const CLocApprovalState::ApprovalState GetDefaultApprovalState();
  91. static BOOL IsValidApprovalState(const CLocApprovalState::ApprovalState &nIn);
  92. static BOOL IsValidApprovalState(const TCHAR * );
  93. private:
  94. struct SStateName
  95. {
  96. ApprovalState as;
  97. const TCHAR *szName;
  98. };
  99. static const SStateName m_aStateNames[];
  100. CLocApprovalState();
  101. };
  102. typedef CLocApprovalState CAS;
  103. //------------------------------------------------------------------------------
  104. class LTAPIENTRY CLocAutoApproved
  105. {
  106. // Operations
  107. public:
  108. enum AutoApproved
  109. {
  110. Invalid = 0,
  111. No,
  112. Partial,
  113. Yes,
  114. NotApplicable
  115. };
  116. NOTHROW static TCHAR const * GetAutoApprovedText(AutoApproved const aa);
  117. static void Enumerate(CEnumCallback & cbEnumCallback);
  118. static AutoApproved const GetAutoApproved(TCHAR const * const tChIn);
  119. static TCHAR const * GetDefaultAutoApprovedText();
  120. static AutoApproved const GetDefaultAutoApproved();
  121. static bool IsValidAutoApproved(AutoApproved const nIn);
  122. static bool IsValidAutoApproved(TCHAR const * tChIn);
  123. // Construction
  124. private:
  125. // prevent constructing, copying and assigning
  126. CLocAutoApproved();
  127. CLocAutoApproved(CLocAutoApproved const &);
  128. CLocAutoApproved const & operator=(CLocAutoApproved const &);
  129. // Member Variables
  130. private:
  131. static TCHAR const * const m_szAutoApprovedNames[];
  132. static AutoApproved const DefaultValue;
  133. };
  134. typedef CLocAutoApproved CAA;
  135. //------------------------------------------------------------------------------
  136. class LTAPIENTRY CLocTranslationOrigin
  137. {
  138. public:
  139. enum TranslationOrigin
  140. {
  141. Invalid = 0,
  142. New,
  143. Uploaded,
  144. AutoTranslated,
  145. Copied,
  146. PreviousVersion,
  147. NotApplicable
  148. };
  149. NOTHROW static const TCHAR * GetOriginText(CLocTranslationOrigin::TranslationOrigin);
  150. static void Enumerate(CEnumCallback &);
  151. private:
  152. static const TCHAR *const m_szOriginNames[];
  153. CLocTranslationOrigin();
  154. };
  155. typedef CLocTranslationOrigin CTO;
  156. class LTAPIENTRY COutputTabs
  157. {
  158. public:
  159. enum OutputTabs
  160. {
  161. File,
  162. Test,
  163. Messages,
  164. Update,
  165. Utility,
  166. GlobalErrorBox,
  167. OutputMax
  168. };
  169. static void Enumerate(CEnumCallback &);
  170. private:
  171. static const UINT m_nStateNames[];
  172. COutputTabs();
  173. };
  174. class LTAPIENTRY CValidationCode
  175. {
  176. public:
  177. enum ValidationCode
  178. {
  179. NotHandled, // for sub-parser use ONLY
  180. NoError,
  181. Warning,
  182. Error
  183. };
  184. NOTHROW static ValidationCode UpgradeValue(ValidationCode OldValue,
  185. ValidationCode NewValue);
  186. private:
  187. CValidationCode();
  188. };
  189. typedef CValidationCode CVC;
  190. //------------------------------------------------------------------------------
  191. class LTAPIENTRY CValidationOptions
  192. {
  193. public:
  194. CValidationOptions();
  195. enum ValidationOption
  196. {
  197. CheckDBCSHotKeyPos = 0,
  198. CheckDBCSHotKeyChar,
  199. CheckRemovedHotKey,
  200. CheckAddedHotKey,
  201. CheckHotKeyPosition,
  202. CheckRemovedAccelerator,
  203. CheckReorderableParams,
  204. CheckPrintf,
  205. CheckBlankTarget,
  206. CheckBlankSource,
  207. CheckNewLineCount,
  208. CheckChangedTerminator,
  209. CheckLeadingPunctuation,
  210. CheckTrailingPunctuation,
  211. CheckLeadingSpaces,
  212. CheckTrailingSpaces,
  213. CheckTranslationSize,
  214. CheckNULChanges,
  215. CheckCharsInCodePage,
  216. //
  217. // Internal value, DO NOT USE
  218. //
  219. END_MARKER
  220. };
  221. static void Enumerate(CEnumCallback &);
  222. NOTHROW static void GetText(ValidationOption, CLString &);
  223. NOTHROW static void GetLongText(ValidationOption vo, CLString &strText);
  224. NOTHROW void SetFlag(ValidationOption, BOOL);
  225. NOTHROW BOOL GetFlag(ValidationOption) const;
  226. NOTHROW const CValidationOptions & operator=(const CValidationOptions &);
  227. private:
  228. DWORD dwFlags;
  229. };
  230. typedef CValidationOptions CVO;
  231. //------------------------------------------------------------------------------
  232. class LTAPIENTRY CAmpKeyword
  233. {
  234. public:
  235. enum AmpKeyword
  236. {
  237. amp = 0,
  238. lt,
  239. gt,
  240. };
  241. static const WCHAR * GetValue(CAmpKeyword::AmpKeyword);
  242. static unsigned int GetValueLength(CAmpKeyword::AmpKeyword);
  243. static WCHAR GetEquivalentChar(CAmpKeyword::AmpKeyword);
  244. static int FindAmpKeyword(const WCHAR * pwszStr, unsigned int nPos);
  245. private:
  246. //
  247. // Nobody should actually CONTRUCT one of these.
  248. //
  249. CAmpKeyword();
  250. //
  251. // Used to store the info about each element in the enum...
  252. //
  253. struct SAmpKeyword
  254. {
  255. const WCHAR * m_wszValue;
  256. WCHAR m_chEquivalentChar;
  257. };
  258. static const SAmpKeyword m_aAmpKeywords[];
  259. static const int m_nNumAmpKeywords;
  260. };
  261. typedef CAmpKeyword CAK;
  262. //------------------------------------------------------------------------------
  263. // CEnumIntoPasStrList provides a method of enumerating directly into a list of
  264. // CPascalString's.
  265. //
  266. // ASSUMPTIONS:
  267. // 1. Enumerators will send data in proper increasing order
  268. // 2. No gaps in indicies.
  269. //
  270. class LTAPIENTRY CEnumIntoPasStrList: public CEnumCallback
  271. {
  272. // Construction
  273. public:
  274. CEnumIntoPasStrList(CPasStringList & lstPasStr, BOOL fLock = TRUE);
  275. ~CEnumIntoPasStrList();
  276. // CEnumCallback implementation
  277. public:
  278. virtual void SetRange(UINT nStart, UINT nFinish);
  279. virtual BOOL ProcessEnum(const EnumInfo &);
  280. protected:
  281. CPasStringList & m_lstPasStr;
  282. UINT m_nStart; // Start of range
  283. UINT m_nFinish; // End of range
  284. UINT m_nCurrent; // Check of current item TO retrieve
  285. BOOL m_fLock; // Lock list when finished
  286. };