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.

136 lines
3.8 KiB

  1. //-------------------------------------------------------------------------
  2. // File: WMIFilterMgrDlg.h
  3. //
  4. // Author : Kishnan Nedungadi
  5. //
  6. // created : 3/27/2000
  7. //-------------------------------------------------------------------------
  8. INT_PTR CALLBACK WMIFilterManagerDlgProc(HWND hDLG, UINT iMessage, WPARAM wParam, LPARAM lParam);
  9. #define MAX_WMIFILTER_COLUMNS 5
  10. #define NAME_WIDTH 60
  11. #define DESCRIPTION_WIDTH 188
  12. #define AUTHOR_WIDTH 100
  13. #define CHANGE_DATE_WIDTH 80
  14. #define CREATION_DATE_wIDTH 80
  15. class CWMIFilterManager;
  16. class CWMIFilterContainer;
  17. class CColumnItem;
  18. class CWMIFilterManagerDlg
  19. {
  20. public:
  21. CWMIFilterManagerDlg(CWMIFilterManager * pWMIFilterManager, bool bBrowsing=false, BSTR bstrDomain=NULL);
  22. ~CWMIFilterManagerDlg();
  23. INT_PTR CALLBACK WMIFilterManagerDlgProc(HWND hDlg, UINT iMessage, WPARAM wParam, LPARAM lParam);
  24. IWbemClassObject * m_pIWbemClassObject;
  25. protected:
  26. STDMETHODIMP PopulateFilterList();
  27. STDMETHODIMP AddFilterItemToList(IWbemClassObject * pIWbemClassObject, long lIndex=MAX_LIST_ITEMS, bool bSelect=false);
  28. STDMETHODIMP InitializeDialog();
  29. STDMETHODIMP DestroyDialog();
  30. BOOL OnKillActive();
  31. STDMETHODIMP OnNew();
  32. STDMETHODIMP OnDelete();
  33. STDMETHODIMP ClearFilterList();
  34. BOOL OnOK();
  35. STDMETHODIMP GetSelectedFilter(CWMIFilterContainer ** ppCWMIFilterContainer, long lIndex=-1);
  36. STDMETHODIMP SelectFilterItem(long lIndex);
  37. STDMETHODIMP ToggleExpandedMode();
  38. STDMETHODIMP OnSave();
  39. STDMETHODIMP OnExport();
  40. STDMETHODIMP OnImport();
  41. STDMETHODIMP CheckDirtyFlags();
  42. //STDMETHODIMP PopulateQueryList();
  43. //STDMETHODIMP UpdateQueryList();
  44. //STDMETHODIMP AddQueryItemToList(IWbemClassObject * pIWbemClassObject, long lIndex=MAX_LIST_ITEMS);
  45. //STDMETHODIMP OnEditQuery();
  46. //STDMETHODIMP OnAddQuery();
  47. //STDMETHODIMP OnDeleteQuery();
  48. //STDMETHODIMP ClearQueryList();
  49. STDMETHODIMP OnManageColumns();
  50. STDMETHODIMP SetupColumns();
  51. STDMETHODIMP UpdateFilterItem(long lIndex);
  52. STDMETHODIMP PopulateQueryEdit();
  53. STDMETHODIMP AddQueryItemToString(IWbemClassObject * pIWbemClassObject, CComBSTR& bstrQueries);
  54. STDMETHODIMP SaveQueryEdit();
  55. STDMETHODIMP AddEditQueryString(BSTR bstrQuery, void **ppUnk, BSTR bstrNamespace=NULL);
  56. STDMETHODIMP SaveToMemory();
  57. STDMETHODIMP OnDuplicate();
  58. STDMETHODIMP OnHelp();
  59. HWND m_hWnd;
  60. CWMIFilterManager * m_pWMIFilterManager;
  61. HWND m_hwndFilterListView;
  62. DWORD m_dwColumnWidth[MAX_WMIFILTER_COLUMNS];
  63. HWND m_hwndQueryListView;
  64. CComPtr<IWbemClassObject> m_pCurIWbemClassObj;
  65. bool m_bExpanded;
  66. long m_lExpandedHeight;
  67. CWMIFilterContainer * m_pCurCWMIFilterContainer;
  68. bool m_bBrowsing;
  69. CSimpleArray<CColumnItem*> m_ArrayColumns;
  70. CComBSTR m_bstrDomain;
  71. };
  72. class CWMIFilterContainer
  73. {
  74. public:
  75. CWMIFilterContainer() { m_bDirty = false; m_bMemoryDirty = false;}
  76. ~CWMIFilterContainer() {}
  77. bool IsDirty() { return m_bDirty; }
  78. void SetDirtyFlag(bool value) { m_bDirty = value; }
  79. bool IsMemoryDirty() { return m_bMemoryDirty; }
  80. void SetMemoryDirtyFlag(bool value) { m_bMemoryDirty = value; }
  81. STDMETHODIMP GetIWbemClassObject(IWbemClassObject ** ppIWbemClassObject)
  82. {
  83. if(!m_pIWbemClassObject)
  84. return E_FAIL;
  85. return m_pIWbemClassObject->QueryInterface(IID_IWbemClassObject, (void **)ppIWbemClassObject);
  86. }
  87. STDMETHODIMP SetIWbemClassObject(IWbemClassObject * pIWbemClassObject)
  88. {
  89. if(!pIWbemClassObject)
  90. {
  91. m_pIWbemClassObject = NULL;
  92. return NOERROR;
  93. }
  94. else
  95. {
  96. return pIWbemClassObject->QueryInterface(IID_IWbemClassObject, (void **)&m_pIWbemClassObject);
  97. }
  98. }
  99. protected:
  100. bool m_bDirty;
  101. bool m_bMemoryDirty;
  102. CComPtr<IWbemClassObject>m_pIWbemClassObject;
  103. };