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.

156 lines
3.7 KiB

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