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.

60 lines
1.7 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: treeobsv.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _TREEOBSV_H_
  11. #define _TREEOBSV_H_
  12. #include "observer.h"
  13. typedef LONG_PTR TREEITEMID;
  14. // Tree item attributes
  15. const DWORD TIA_NAME = 0x00000001;
  16. const DWORD TIA_IMAGE = 0x00000002;
  17. // observer styles
  18. const DWORD TOBSRV_HIDEROOT = 0x00000001; // Don't display root item
  19. const DWORD TOBSRV_FOLDERSONLY = 0x00000002; // Show only folder items
  20. const TREEITEMID TREEID_ROOT = static_cast<TREEITEMID>(-1);
  21. const TREEITEMID TREEID_LAST = static_cast<TREEITEMID>(-2);
  22. class CTreeObserver
  23. {
  24. public:
  25. STDMETHOD (SetStyle) (DWORD dwStyle) = 0;
  26. STDMETHOD_(void, ItemAdded) (TREEITEMID tid) = 0;
  27. STDMETHOD_(void, ItemRemoved) (TREEITEMID tidParent, TREEITEMID tidRemoved) = 0;
  28. STDMETHOD_(void, ItemChanged) (TREEITEMID tid, DWORD dwAttrib) = 0;
  29. };
  30. class CTreeSource
  31. {
  32. public:
  33. STDMETHOD_(TREEITEMID, GetRootItem) () = 0;
  34. STDMETHOD_(TREEITEMID, GetParentItem) (TREEITEMID tid) = 0;
  35. STDMETHOD_(TREEITEMID, GetChildItem) (TREEITEMID tid) = 0;
  36. STDMETHOD_(TREEITEMID, GetNextSiblingItem) (TREEITEMID tid) = 0;
  37. STDMETHOD_(LPARAM, GetItemParam) (TREEITEMID tid) = 0;
  38. STDMETHOD_(void, GetItemName) (TREEITEMID tid, LPTSTR pszName, int cchMaxName) = 0;
  39. STDMETHOD_(int, GetItemImage) (TREEITEMID tid) = 0;
  40. STDMETHOD_(int, GetItemOpenImage)(TREEITEMID tid) = 0;
  41. STDMETHOD_(BOOL, IsFolderItem) (TREEITEMID tid) = 0;
  42. };
  43. #endif // _TREEOBSV_H_