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.

157 lines
3.6 KiB

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. UIOPTSET.H
  5. History:
  6. --*/
  7. #pragma once
  8. #pragma warning(disable: 4275) // non dll-interface class 'foo' used
  9. // as base for dll-interface class 'bar'
  10. class CLocUIOption;
  11. class CLocUIOptionList;
  12. class LTAPIENTRY CLocUIOptionEnumCallback : public CObject
  13. {
  14. public:
  15. CLocUIOptionEnumCallback() {};
  16. void AssertValid(void) const;
  17. virtual BOOL ProcessOption(CLocUIOption *) = 0;
  18. virtual BOOL ProcessOption(const CLocUIOption *) = 0;
  19. private:
  20. CLocUIOptionEnumCallback(const CLocUIOptionEnumCallback &);
  21. void operator=(int);
  22. };
  23. class LTAPIENTRY CLocUIOptionSet;
  24. class LTAPIENTRY CLocUIOptionSetList :
  25. public CTypedPtrList<CPtrList, CLocUIOptionSet *>
  26. {
  27. public:
  28. NOTHROW CLocUIOptionSetList() {};
  29. void AssertValid(void) const;
  30. NOTHROW ~CLocUIOptionSetList();
  31. private:
  32. CLocUIOptionSetList(const CLocUIOptionSetList &);
  33. void operator=(const CLocUIOptionSetList &);
  34. };
  35. //
  36. // This is used to control the order of the tabs displayed in the options
  37. // dialog.
  38. enum OptionSetDisplayOrder
  39. {
  40. osDefault = 50
  41. };
  42. class LTAPIENTRY CLocUIOptionSet : public CRefCount, public CObject
  43. {
  44. public:
  45. NOTHROW CLocUIOptionSet();
  46. void AssertValid(void) const;
  47. NOTHROW void AddOption(CLocUIOption *);
  48. NOTHROW void AddOptionSet(CLocUIOptionSet *);
  49. NOTHROW void RemoveOptionSet(const TCHAR *);
  50. NOTHROW const CLocUIOptionList & GetOptionList(void) const;
  51. NOTHROW const CLocUIOptionSetList & GetOptionSets(void) const;
  52. NOTHROW BOOL FindUIOption(const TCHAR *, CLocUIOption *&pOption);
  53. NOTHROW BOOL FindUIOption(const TCHAR *, const CLocUIOption *&pOption) const;
  54. NOTHROW void SetDescription(const HINSTANCE hDescDll, UINT idsDesc);
  55. NOTHROW void SetDescription(const CLString &);
  56. NOTHROW void SetHelpText(const HINSTANCE hHelpDll, UINT idsHelp);
  57. NOTHROW void SetHelpText(const CLString &);
  58. NOTHROW void SetHelpID(UINT);
  59. void SetGroupName(const TCHAR *);
  60. NOTHROW void SetDisplayOrder(UINT);
  61. NOTHROW void GetDescription(CLString &) const;
  62. NOTHROW void GetHelpText(CLString &) const;
  63. NOTHROW UINT GetHelpID(void) const;
  64. NOTHROW BOOL IsEmpty(void) const;
  65. const CLString &GetGroupName(void) const;
  66. NOTHROW UINT GetDisplayOrder(void) const;
  67. virtual BOOL IsReadOnly(void) const = 0;
  68. virtual BOOL IsVisible(void) const = 0;
  69. BOOL EnumOptions(CLocUIOptionEnumCallback *);
  70. BOOL EnumOptions(CLocUIOptionEnumCallback *) const;
  71. virtual void OnChange(void) const = 0;
  72. protected:
  73. NOTHROW virtual ~CLocUIOptionSet();
  74. void SetParent(const CLocUIOptionSet *);
  75. const CLocUIOptionSet *GetParent(void) const;
  76. private:
  77. CLocUIOptionList m_olOptions;
  78. CLocUIOptionSetList m_oslSubOptions;
  79. CLString m_strDesc, m_strHelp;
  80. UINT m_idHelp;
  81. const CLocUIOptionSet *m_pParent;
  82. CLString m_strGroup;
  83. UINT m_uiDisplayOrder;
  84. CLocUIOptionSet(const CLocUIOptionSet &);
  85. void operator=(const CLocUIOptionSet &);
  86. };
  87. class LTAPIENTRY CLocUIOptionSetDef : public CLocUIOptionSet
  88. {
  89. public:
  90. CLocUIOptionSetDef();
  91. enum ControlType
  92. {
  93. ctDefault,
  94. ctAlways,
  95. ctNever
  96. };
  97. void SetReadOnly(ControlType);
  98. void SetVisible(ControlType);
  99. virtual BOOL IsReadOnly(void) const;
  100. virtual BOOL IsVisible(void) const;
  101. virtual void OnChange(void) const;
  102. const CLocUIOptionSetDef & operator=(const CLocUIOptionSetDef &);
  103. private:
  104. ControlType m_ctReadOnly;
  105. ControlType m_ctVisible;
  106. };
  107. #pragma warning(default: 4275)
  108. #if !defined(_DEBUG) || defined(IMPLEMENT)
  109. #include "uioptset.inl"
  110. #endif