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.

341 lines
8.1 KiB

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