Leaked source code of windows server 2003
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.

340 lines
8.3 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. COSPlatform();
  69. static const TCHAR * const m_szPlatformNames[];
  70. };
  71. //------------------------------------------------------------------------------
  72. class LTAPIENTRY CLocApprovalState
  73. {
  74. public:
  75. enum ApprovalState
  76. {
  77. Invalid = 0,
  78. Old_Pending, // OBSOLETE! Do Not Use!
  79. Approved,
  80. PreApproved,
  81. NotReady,
  82. Failed,
  83. ForResearch,
  84. NotApplicable
  85. };
  86. static ApprovalState DefaultValue;
  87. NOTHROW static const TCHAR * GetApprovalText(CLocApprovalState::ApprovalState);
  88. static void Enumerate(CEnumCallback &);
  89. static const CLocApprovalState::ApprovalState GetApprovalState(const TCHAR * );
  90. static const TCHAR * GetDefaultApprovalText();
  91. static const CLocApprovalState::ApprovalState GetDefaultApprovalState();
  92. static BOOL IsValidApprovalState(const CLocApprovalState::ApprovalState &nIn);
  93. static BOOL IsValidApprovalState(const TCHAR * );
  94. private:
  95. struct SStateName
  96. {
  97. ApprovalState as;
  98. const TCHAR *szName;
  99. };
  100. static const SStateName m_aStateNames[];
  101. CLocApprovalState();
  102. };
  103. typedef CLocApprovalState CAS;
  104. //------------------------------------------------------------------------------
  105. class LTAPIENTRY CLocAutoApproved
  106. {
  107. // Operations
  108. public:
  109. enum AutoApproved
  110. {
  111. Invalid = 0,
  112. No,
  113. Partial,
  114. Yes,
  115. NotApplicable
  116. };
  117. NOTHROW static TCHAR const * GetAutoApprovedText(AutoApproved const aa);
  118. static void Enumerate(CEnumCallback & cbEnumCallback);
  119. static AutoApproved const GetAutoApproved(TCHAR const * const tChIn);
  120. static TCHAR const * GetDefaultAutoApprovedText();
  121. static AutoApproved const GetDefaultAutoApproved();
  122. static bool IsValidAutoApproved(AutoApproved const nIn);
  123. static bool IsValidAutoApproved(TCHAR const * tChIn);
  124. // Construction
  125. private:
  126. // prevent constructing, copying and assigning
  127. CLocAutoApproved();
  128. CLocAutoApproved(CLocAutoApproved const &);
  129. CLocAutoApproved const & operator=(CLocAutoApproved const &);
  130. // Member Variables
  131. private:
  132. static TCHAR const * const m_szAutoApprovedNames[];
  133. static AutoApproved const DefaultValue;
  134. };
  135. typedef CLocAutoApproved CAA;
  136. //------------------------------------------------------------------------------
  137. class LTAPIENTRY CLocTranslationOrigin
  138. {
  139. public:
  140. enum TranslationOrigin
  141. {
  142. Invalid = 0,
  143. New,
  144. Uploaded,
  145. AutoTranslated,
  146. Copied,
  147. PreviousVersion,
  148. NotApplicable
  149. };
  150. NOTHROW static const TCHAR * GetOriginText(CLocTranslationOrigin::TranslationOrigin);
  151. static void Enumerate(CEnumCallback &);
  152. private:
  153. static const TCHAR *const m_szOriginNames[];
  154. CLocTranslationOrigin();
  155. };
  156. typedef CLocTranslationOrigin CTO;
  157. class LTAPIENTRY COutputTabs
  158. {
  159. public:
  160. enum OutputTabs
  161. {
  162. File,
  163. Test,
  164. Messages,
  165. Update,
  166. Utility,
  167. GlobalErrorBox,
  168. OutputMax
  169. };
  170. static void Enumerate(CEnumCallback &);
  171. private:
  172. static const UINT m_nStateNames[];
  173. COutputTabs();
  174. };
  175. class LTAPIENTRY CValidationCode
  176. {
  177. public:
  178. enum ValidationCode
  179. {
  180. NotHandled, // for sub-parser use ONLY
  181. NoError,
  182. Warning,
  183. Error
  184. };
  185. NOTHROW static ValidationCode UpgradeValue(ValidationCode OldValue,
  186. ValidationCode NewValue);
  187. private:
  188. CValidationCode();
  189. };
  190. typedef CValidationCode CVC;
  191. //------------------------------------------------------------------------------
  192. class LTAPIENTRY CValidationOptions
  193. {
  194. public:
  195. CValidationOptions();
  196. enum ValidationOption
  197. {
  198. CheckDBCSHotKeyPos = 0,
  199. CheckDBCSHotKeyChar,
  200. CheckRemovedHotKey,
  201. CheckAddedHotKey,
  202. CheckHotKeyPosition,
  203. CheckRemovedAccelerator,
  204. CheckReorderableParams,
  205. CheckPrintf,
  206. CheckBlankTarget,
  207. CheckBlankSource,
  208. CheckNewLineCount,
  209. CheckChangedTerminator,
  210. CheckLeadingPunctuation,
  211. CheckTrailingPunctuation,
  212. CheckLeadingSpaces,
  213. CheckTrailingSpaces,
  214. CheckTranslationSize,
  215. CheckNULChanges,
  216. CheckCharsInCodePage,
  217. //
  218. // Internal value, DO NOT USE
  219. //
  220. END_MARKER
  221. };
  222. static void Enumerate(CEnumCallback &);
  223. NOTHROW static void GetText(ValidationOption, CLString &);
  224. NOTHROW static void GetLongText(ValidationOption vo, CLString &strText);
  225. NOTHROW void SetFlag(ValidationOption, BOOL);
  226. NOTHROW BOOL GetFlag(ValidationOption) const;
  227. NOTHROW const CValidationOptions & operator=(const CValidationOptions &);
  228. private:
  229. DWORD dwFlags;
  230. };
  231. typedef CValidationOptions CVO;
  232. //------------------------------------------------------------------------------
  233. class LTAPIENTRY CAmpKeyword
  234. {
  235. public:
  236. enum AmpKeyword
  237. {
  238. amp = 0,
  239. lt,
  240. gt,
  241. };
  242. static const WCHAR * GetValue(CAmpKeyword::AmpKeyword);
  243. static unsigned int GetValueLength(CAmpKeyword::AmpKeyword);
  244. static WCHAR GetEquivalentChar(CAmpKeyword::AmpKeyword);
  245. static int FindAmpKeyword(const WCHAR * pwszStr, unsigned int nPos);
  246. private:
  247. //
  248. // Nobody should actually CONTRUCT one of these.
  249. //
  250. CAmpKeyword();
  251. //
  252. // Used to store the info about each element in the enum...
  253. //
  254. struct SAmpKeyword
  255. {
  256. const WCHAR * m_wszValue;
  257. WCHAR m_chEquivalentChar;
  258. };
  259. static const SAmpKeyword m_aAmpKeywords[];
  260. static const int m_nNumAmpKeywords;
  261. };
  262. typedef CAmpKeyword CAK;
  263. //------------------------------------------------------------------------------
  264. // CEnumIntoPasStrList provides a method of enumerating directly into a list of
  265. // CPascalString's.
  266. //
  267. // ASSUMPTIONS:
  268. // 1. Enumerators will send data in proper increasing order
  269. // 2. No gaps in indicies.
  270. //
  271. class LTAPIENTRY CEnumIntoPasStrList: public CEnumCallback
  272. {
  273. // Construction
  274. public:
  275. CEnumIntoPasStrList(CPasStringList & lstPasStr, BOOL fLock = TRUE);
  276. ~CEnumIntoPasStrList();
  277. // CEnumCallback implementation
  278. public:
  279. virtual void SetRange(UINT nStart, UINT nFinish);
  280. virtual BOOL ProcessEnum(const EnumInfo &);
  281. protected:
  282. CPasStringList & m_lstPasStr;
  283. UINT m_nStart; // Start of range
  284. UINT m_nFinish; // End of range
  285. UINT m_nCurrent; // Check of current item TO retrieve
  286. BOOL m_fLock; // Lock list when finished
  287. };