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.

98 lines
2.4 KiB

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. FLDDEFHELP.H
  5. History:
  6. --*/
  7. // RAID: LS42 Bug 46 fixed by MikeL
  8. // Pointer to a function to allow each column
  9. // type to have its own validation function.
  10. typedef BOOL (* PFNVALIDATE) (LPCTSTR, DWORD);
  11. // RAID: LS42 Bug 46 fixed by MikeL
  12. // Added pfnValidateFunc to allow each column
  13. // type to have its own validation function.
  14. //------------------------------------------------------------------------------
  15. struct SBasicColumn
  16. {
  17. const WCHAR *szInternalName;
  18. long nID;
  19. UINT IDSName;
  20. UINT IDSHelp;
  21. CColumnVal::ColumnValType vt;
  22. Operators ops;
  23. BOOL fDisplay;
  24. BOOL fSort;
  25. BOOL fReadOnly;
  26. PFNVALIDATE pfnValidateFunc;
  27. };
  28. struct SStringListColumn
  29. {
  30. SBasicColumn sBasic;
  31. UINT IDSStringList;
  32. };
  33. #pragma warning(disable: 4275) // non dll-interface class 'foo' used
  34. // as base for dll-interface class 'bar'
  35. class LTAPIENTRY CColDefHelper : public CObject
  36. {
  37. public:
  38. CColDefHelper(HINSTANCE h);
  39. void SetBasicColumns(const SBasicColumn * pBasic, UINT nCntBasic);
  40. void SetStringColumns(const SStringListColumn * pStrings, UINT nCntStrings);
  41. CTableSchema * CreateSchema(const SchemaId &, UINT IDSDescription);
  42. private:
  43. HINSTANCE m_hInst;
  44. const SBasicColumn * m_pBasicColumns;
  45. const SStringListColumn *m_pStringColumns;
  46. UINT m_uiBasicCount;
  47. UINT m_uiStringCount;
  48. };
  49. #pragma warning(default : 4275)
  50. const TCHAR COL_PICK_SEPARATOR = _T('\n');
  51. #define BEGIN_BASIC_COLUMN_DEFS(var) \
  52. const SBasicColumn var[] = \
  53. {
  54. // RAID: LS42 Bug 46 fixed by MikeL
  55. // Added pfnValidateFunc to allow each column
  56. // type to have its own validate function.
  57. #define BASIC_COLUMN_DEF_ENTRY(name, nID, IDSName, IDSHelp, cvt, ops, fDisplay, fSort, fReadOnly, pfnValidateFunc) \
  58. {name, nID, IDSName, IDSHelp, cvt, ops, fDisplay, fSort, fReadOnly, pfnValidateFunc}
  59. #define END_BASIC_COLUMN_DEFS() \
  60. }
  61. #define BEGIN_STRING_LIST_COLUMN_DEFS(var) \
  62. const SStringListColumn var[] = \
  63. {
  64. // RAID: LS42 Bug 46 fixed by MikeL
  65. // Added pfnValidateFunc to allow each column
  66. // type to have its own validate function.
  67. #define STRING_LIST_COLUMN_ENTRY(name, nID, IDSName, IDSHelp, ops, fDisplay, fSort, fReadOnly, pfnValidateFunc, IDSList) \
  68. { { name, nID, IDSName, IDSHelp, CColumnVal::cvtStringList, ops, fDisplay, fSort, fReadOnly, pfnValidateFunc }, IDSList}
  69. #define END_STRING_LIST_COLUMN_DEFS() \
  70. }