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.

155 lines
3.8 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. OBJEDIT.H
  5. Abstract:
  6. WBEMTEST object editor classes.
  7. History:
  8. a-raymcc 12-Jun-96 Created.
  9. --*/
  10. #ifndef _OBJEDIT_H_
  11. #define _OBJEDIT_H_
  12. #include "wbemqual.h"
  13. #include "wbemdlg.h"
  14. #include "resrc1.h"
  15. #include "wbemtest.h"
  16. #define TEMP_BUF 2096
  17. class CObjectEditor : public CWbemDialog
  18. {
  19. IWbemClassObject* m_pObj;
  20. DWORD m_dwEditMode; // readwrite, readonly, foreign, nomethods
  21. HWND m_hPropList;
  22. HWND m_hQualifierList;
  23. HWND m_hMethodList;
  24. BOOL m_bClass;
  25. BOOL m_bHideSystem;
  26. BOOL m_bHideDerived;
  27. BOOL m_bNoMethods;
  28. BOOL m_bResultingObj;
  29. LONG m_lGenFlags; // generic call flags (i.e., WBEM_FLAG_ .. used in IWbemServices methods)
  30. LONG m_lSync; // sync, async, semisync
  31. LONG m_lTimeout; // used in semisync only
  32. ULONG m_nBatch; // used in semisync and sync enumerations
  33. static BOOL mstatic_bHideSystemDefault;
  34. public:
  35. enum {readwrite = 0, readonly, foreign, nomethods}; // used for edit mode: controls commands (buttons) enabled
  36. CObjectEditor(HWND hParent, LONG lGenFlags, DWORD dwEditMode, LONG lSync,
  37. IWbemClassObject *pObj, LONG lTimeout = WBEM_INFINITE,
  38. ULONG nBatch = 1);
  39. ~CObjectEditor();
  40. INT_PTR Edit();
  41. void RunDetached(CRefCountable* pOwner);
  42. protected:
  43. BOOL OnInitDialog();
  44. BOOL OnCommand(WORD wCode, WORD wID);
  45. BOOL OnDoubleClick(int nID);
  46. BOOL OnOK();
  47. void ConfigureButtons();
  48. // Buttons
  49. void OnAddQualifier();
  50. void OnEditQualifier();
  51. void OnDelQualifier();
  52. void OnAddProp();
  53. void OnEditProp();
  54. void OnDelProp();
  55. void OnAddMethod();
  56. void OnEditMethod();
  57. void OnDelMethod();
  58. void OnSuperclass();
  59. void OnDerived();
  60. void OnInstances();
  61. void OnClass();
  62. void OnRefs();
  63. void OnAssocs();
  64. void OnShowMof();
  65. void OnHideSystem();
  66. void OnHideDerived();
  67. void Refresh();
  68. void OnRefreshObject();
  69. BOOL ResultingObject(IWbemClassObject* pObj, LONG lChgFlags);
  70. };
  71. //***************************************************************************
  72. //
  73. // class CTestQualifierEditor
  74. //
  75. //***************************************************************************
  76. class CTestQualifierEditor : public CWbemDialog
  77. {
  78. HWND m_hQualifierName;
  79. HWND m_hQualifierVal;
  80. HWND m_hQualifierType;
  81. HWND m_hRadioPropInst;
  82. HWND m_hRadioPropClass;
  83. HWND m_hRadioOverride;
  84. HWND m_hRadioPropagated;
  85. HWND m_hRadioAmended;
  86. CTestQualifier *m_pTarget;
  87. BOOL m_bEditing;
  88. public:
  89. CTestQualifierEditor(HWND hParent, CTestQualifier *pTarget,
  90. BOOL bEditing = TRUE);
  91. INT_PTR Edit();
  92. BOOL OnInitDialog();
  93. BOOL Verify();
  94. };
  95. LPSTR CTestQualifierToString(CTestQualifier *pQualifier);
  96. LPSTR LPWSTRToLPSTR(LPWSTR pWStr);
  97. //***************************************************************************
  98. //
  99. // class CEmbeddedObjectEditor
  100. //
  101. //***************************************************************************
  102. class CEmbeddedObjectListEditor : public CQueryResultDlg
  103. {
  104. protected:
  105. CVarVector* m_pVarVector;
  106. WString m_wsPropName;
  107. public:
  108. CEmbeddedObjectListEditor(HWND hParent, LONG lGenFlags, LONG lQryFlags,
  109. LPCWSTR wszPropName, CVarVector* pVarVector);
  110. ~CEmbeddedObjectListEditor();
  111. BOOL CanAdd() { return TRUE;}
  112. IWbemClassObject* AddNewElement();
  113. BOOL DeleteListElement(int nSel);
  114. BOOL Verify();
  115. BOOL OnInitDialog();
  116. };
  117. extern char *ValidQualifierTypes[];
  118. extern const int nNumValidQualifierTypes;
  119. #endif