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.

70 lines
1.8 KiB

  1. #ifndef __FAVORITES_H_
  2. #define __FAVORITES_H_
  3. #include <commctrl.h>
  4. #include <subsmgr.h>
  5. #define NUM_FAVS 200
  6. #define NUM_LINKS 50
  7. #define FTYPE_UNUSED 0
  8. #define FTYPE_FOLDER 1
  9. #define FTYPE_URL 2
  10. #define FF_DEFAULT 0x0000
  11. #define FF_NAME 0x0001
  12. #define FF_PATH 0x0002
  13. #define FF_URL 0x0004
  14. #define FF_ICON 0x0008
  15. #define FF_TVI 0x0010
  16. #define FF_ALL 0x001F
  17. struct SFav
  18. {
  19. // Constructors and destructors
  20. public:
  21. SFav();
  22. ~SFav();
  23. // Attiributes
  24. public:
  25. WORD wType;
  26. LPTSTR pszName;
  27. LPTSTR pszPath;
  28. LPTSTR pszUrl;
  29. LPTSTR pszIconFile;
  30. BOOL fOffline;
  31. LPTV_ITEM pTvItem;
  32. // Properties
  33. public:
  34. HRESULT Load(UINT nIndex, LPCTSTR pszIns, BOOL fQL = FALSE,
  35. LPCTSTR pszFixPath = NULL, LPCTSTR pszNewPath = NULL, BOOL fIgnoreOffline = FALSE);
  36. HRESULT Load(LPCTSTR pszName, LPCTSTR pszFavorite, LPCTSTR pszExtractPath,
  37. ISubscriptionMgr2 *psm = NULL, BOOL fIgnoreOffline = FALSE);
  38. HRESULT Add (HWND htv, HTREEITEM hti);
  39. HRESULT Save(HWND htv, UINT nIndex, LPCTSTR pszIns, LPCTSTR pszExtractPath, BOOL fQL = FALSE,
  40. BOOL fFixUpPath = TRUE);
  41. void SetTVI();
  42. // Operations
  43. public:
  44. static SFav* CreateNew (HWND htv, BOOL fQL = FALSE);
  45. static SFav* GetFirst (HWND htv, BOOL fQL = FALSE);
  46. SFav* GetNext (HWND htv, BOOL fQL = FALSE) const;
  47. void Free (HWND htv, BOOL fQL, LPCTSTR pszExtractPath = NULL);
  48. static UINT GetNumber (HWND htv, BOOL fQL = FALSE);
  49. static UINT GetMaxNumber(BOOL fQL = FALSE);
  50. BOOL Expand(WORD wFlags = FF_DEFAULT);
  51. void Shrink(WORD wFlags = FF_ALL);
  52. void Delete(WORD wFlags = FF_ALL);
  53. BOOL GetPath(HWND htv, LPTSTR pszResult, UINT cchResult = 0) const;
  54. };
  55. typedef SFav FAVSTRUC, *LPFAVSTRUC;
  56. #endif