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.

102 lines
3.1 KiB

  1. /******************************************************************************
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. Favorites.h
  5. Abstract:
  6. This file contains the declaration of the class used to implement
  7. the Favorites inside the Help Center Application.
  8. Revision History:
  9. Davide Massarenti (dmassare) 05/10/2000
  10. created
  11. ******************************************************************************/
  12. #if !defined(__INCLUDED___PCH___FAVORITES_H___)
  13. #define __INCLUDED___PCH___FAVORITES_H___
  14. /////////////////////////////////////////////////////////////////////////////
  15. //
  16. // From HelpServiceTypeLib.idl
  17. //
  18. #include <HelpServiceTypeLib.h>
  19. //
  20. // From HelpCenterTypeLib.idl
  21. //
  22. #include <HelpCenterTypeLib.h>
  23. typedef MPC::CComCollection< IPCHFavorites, &LIBID_HelpCenterTypeLib, MPC::CComSafeMultiThreadModel> CPCHFavorites_Parent;
  24. class ATL_NO_VTABLE CPCHFavorites : // Hungarian: pchf
  25. public CPCHFavorites_Parent
  26. {
  27. public:
  28. struct Entry
  29. {
  30. public:
  31. CComPtr<CPCHHelpSessionItem> m_Data;
  32. HRESULT Init( );
  33. HRESULT Load( /*[in]*/ MPC::Serializer& streamIn );
  34. HRESULT Save( /*[in]*/ MPC::Serializer& streamOut );
  35. };
  36. typedef std::list< Entry > List;
  37. typedef List::iterator Iter;
  38. typedef List::const_iterator IterConst;
  39. ////////////////////////////////////////
  40. private:
  41. List m_lstFavorites;
  42. bool m_fLoaded;
  43. ////////////////////////////////////////
  44. HRESULT Erase();
  45. HRESULT Load();
  46. HRESULT Save();
  47. HRESULT FindEntry( /*[in]*/ IPCHHelpSessionItem* pItem, /*[out]*/ Iter& it );
  48. ////////////////////////////////////////
  49. public:
  50. BEGIN_COM_MAP(CPCHFavorites)
  51. COM_INTERFACE_ENTRY(IDispatch)
  52. COM_INTERFACE_ENTRY(IPCHCollection)
  53. COM_INTERFACE_ENTRY(IPCHFavorites)
  54. END_COM_MAP()
  55. CPCHFavorites();
  56. virtual ~CPCHFavorites();
  57. ////////////////////////////////////////////////////////////////////////////////
  58. static CPCHFavorites* s_GLOBAL;
  59. static HRESULT InitializeSystem();
  60. static void FinalizeSystem ();
  61. ////////////////////////////////////////////////////////////////////////////////
  62. HRESULT Synchronize( /*[in]*/ bool fForce );
  63. public:
  64. // IPCHFavorites
  65. STDMETHOD(IsDuplicate)( /*[in]*/ BSTR bstrURL, /*[out, retval]*/ VARIANT_BOOL *pfDup );
  66. STDMETHOD(Add )( /*[in]*/ BSTR bstrURL, /*[in,optional]*/ VARIANT vTitle , /*[out, retval]*/ IPCHHelpSessionItem* *ppItem );
  67. STDMETHOD(Rename )( /*[in]*/ BSTR bstrTitle, /*[in]*/ IPCHHelpSessionItem* pItem );
  68. STDMETHOD(Move )( /*[in]*/ IPCHHelpSessionItem* pInsertAfter, /*[in]*/ IPCHHelpSessionItem* pItem );
  69. STDMETHOD(Delete )( /*[in]*/ IPCHHelpSessionItem* pItem );
  70. };
  71. /////////////////////////////////////////////////////////////////////////////
  72. #endif // !defined(__INCLUDED___PCH___FAVORITES_H___)