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.

96 lines
2.6 KiB

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