Source code of Windows XP (NT5)
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.

132 lines
3.2 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. /*++
  3. Copyright (C) Microsoft Corporation, 1997 - 1998
  4. Module Name:
  5. DlgIASAdd.h
  6. Abstract:
  7. Header file for the CDlgIASAddAttr class.
  8. See DlgIASAdd.cpp for implementation.
  9. Revision History:
  10. byao - created
  11. mmaguire 06/01/98 - revamped
  12. --*/
  13. //////////////////////////////////////////////////////////////////////////////
  14. #if !defined(_IAS_ADD_ATTRIBUTE_DIALOG_H_)
  15. #define _IAS_ADD_ATTRIBUTE_DIALOG_H_
  16. //////////////////////////////////////////////////////////////////////////////
  17. // BEGIN INCLUDES
  18. //
  19. // where we can find what this class derives from:
  20. //
  21. #include "helper.h"
  22. //
  23. //
  24. // where we can find what this class has or uses:
  25. //
  26. #include "PgIASAdv.h"
  27. #include "iashelper.h"
  28. //
  29. // END INCLUDES
  30. //////////////////////////////////////////////////////////////////////////////
  31. //////////////////////////////////////////////////////////////////////////////
  32. /*++
  33. ::GetSelectedItemIndex
  34. Utility function which returns index value of first selected item in list control.
  35. Returns NOTHING_SELECTED if no item is selected.
  36. --*/
  37. //////////////////////////////////////////////////////////////////////////////
  38. inline int GetSelectedItemIndex( CListCtrl & ListCtrl )
  39. {
  40. int iIndex = 0;
  41. int iFlags = LVNI_ALL | LVNI_SELECTED;
  42. // Note: GetNextItem excludes the current item passed in. So to
  43. // find the first item which matches, you must pass in -1.
  44. iIndex = ListCtrl.GetNextItem( -1, iFlags );
  45. // Note: GetNextItem returns -1 (which is NOTHING_SELECTED for us) if it can't find anything.
  46. return iIndex;
  47. }
  48. /////////////////////////////////////////////////////////////////////////////
  49. // CDlgIASAddAttr dialog
  50. class CDlgIASAddAttr : public CDialog
  51. {
  52. // Construction
  53. public:
  54. CDlgIASAddAttr( CPgIASAdv * pOwner
  55. , LONG lAttrFilter
  56. , std::vector< CComPtr<IIASAttributeInfo> > * pvecAllAttributeInfos
  57. );
  58. ~CDlgIASAddAttr();
  59. HRESULT SetSdo(ISdoCollection* pIAttrCollectionSdo,
  60. ISdoDictionaryOld* pIDictionary);
  61. // Dialog Data
  62. //{{AFX_DATA(CDlgIASAddAttr)
  63. enum { IDD = IDD_IAS_ATTRIBUTE_ADD };
  64. CListCtrl m_listAllAttrs;
  65. //}}AFX_DATA
  66. // Overrides
  67. // ClassWizard generated virtual function overrides
  68. //{{AFX_VIRTUAL(CDlgIASAddAttr)
  69. protected:
  70. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  71. //}}AFX_VIRTUAL
  72. // Implementation
  73. protected:
  74. void UpdateButtonState();
  75. // Generated message map functions
  76. //{{AFX_MSG(CDlgIASAddAttr)
  77. virtual BOOL OnInitDialog();
  78. afx_msg void OnButtonIasAddSelectedAttribute();
  79. afx_msg void OnItemChangedListIasAllAttributes(NMHDR* pNMHDR, LRESULT* pResult);
  80. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  81. afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
  82. afx_msg void OnDblclkListIasAllattrs(NMHDR* pNMHDR, LRESULT* pResult);
  83. //}}AFX_MSG
  84. DECLARE_MESSAGE_MAP()
  85. private:
  86. std::vector< CComPtr<IIASAttributeInfo> > * m_pvecAllAttributeInfos;
  87. LONG m_lAttrFilter;
  88. CComPtr<ISdoDictionaryOld> m_spDictionarySdo;
  89. CComPtr<ISdoCollection> m_spAttrCollectionSdo;
  90. CPgIASAdv * m_pOwner;
  91. };
  92. //{{AFX_INSERT_LOCATION}}
  93. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  94. #endif // _IAS_ADD_ATTRIBUTE_DIALOG_H_