WebHistoryItem.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. * 1. Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * 2. Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. *
  13. * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
  14. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  15. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  16. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
  17. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  18. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  20. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  21. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  23. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. #ifndef WebHistoryItem_H
  26. #define WebHistoryItem_H
  27. #include "WebKit.h"
  28. #include <CoreFoundation/CoreFoundation.h>
  29. #include <wtf/PassRefPtr.h>
  30. #include <wtf/RefPtr.h>
  31. #include <wtf/text/WTFString.h>
  32. namespace WebCore {
  33. class HistoryItem;
  34. }
  35. //-----------------------------------------------------------------------------
  36. class WebHistoryItem : public IWebHistoryItem, IWebHistoryItemPrivate
  37. {
  38. public:
  39. static WebHistoryItem* createInstance();
  40. static WebHistoryItem* createInstance(PassRefPtr<WebCore::HistoryItem>);
  41. protected:
  42. WebHistoryItem(PassRefPtr<WebCore::HistoryItem>);
  43. ~WebHistoryItem();
  44. public:
  45. // IUnknown
  46. virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
  47. virtual ULONG STDMETHODCALLTYPE AddRef(void);
  48. virtual ULONG STDMETHODCALLTYPE Release(void);
  49. // IWebHistoryItem
  50. virtual HRESULT STDMETHODCALLTYPE initWithURLString(
  51. /* [in] */ BSTR urlString,
  52. /* [in] */ BSTR title,
  53. /* [in] */ DATE lastVisited);
  54. virtual HRESULT STDMETHODCALLTYPE originalURLString(
  55. /* [retval][out] */ BSTR *url);
  56. virtual HRESULT STDMETHODCALLTYPE URLString(
  57. /* [retval][out] */ BSTR *url);
  58. virtual HRESULT STDMETHODCALLTYPE title(
  59. /* [retval][out] */ BSTR *pageTitle);
  60. virtual HRESULT STDMETHODCALLTYPE lastVisitedTimeInterval(
  61. /* [retval][out] */ DATE *lastVisited);
  62. virtual HRESULT STDMETHODCALLTYPE setAlternateTitle(
  63. /* [in] */ BSTR title);
  64. virtual HRESULT STDMETHODCALLTYPE alternateTitle(
  65. /* [retval][out] */ BSTR* title);
  66. virtual HRESULT STDMETHODCALLTYPE icon(
  67. /* [out, retval] */ OLE_HANDLE *hBitmap);
  68. // IWebHistoryItemPrivate
  69. virtual HRESULT STDMETHODCALLTYPE initFromDictionaryRepresentation(void* dictionary);
  70. virtual HRESULT STDMETHODCALLTYPE dictionaryRepresentation(void** dictionary);
  71. virtual HRESULT STDMETHODCALLTYPE visitCount(int *count);
  72. virtual HRESULT STDMETHODCALLTYPE setVisitCount(int count);
  73. virtual HRESULT STDMETHODCALLTYPE hasURLString(BOOL* hasURL);
  74. virtual HRESULT STDMETHODCALLTYPE mergeAutoCompleteHints(IWebHistoryItem* otherItem);
  75. virtual HRESULT STDMETHODCALLTYPE setLastVisitedTimeInterval(DATE time);
  76. virtual HRESULT STDMETHODCALLTYPE setTitle(BSTR title);
  77. virtual HRESULT STDMETHODCALLTYPE RSSFeedReferrer(BSTR* url);
  78. virtual HRESULT STDMETHODCALLTYPE setRSSFeedReferrer(BSTR url);
  79. virtual HRESULT STDMETHODCALLTYPE hasPageCache(BOOL *hasCache);
  80. virtual HRESULT STDMETHODCALLTYPE setHasPageCache(BOOL hasCache);
  81. virtual HRESULT STDMETHODCALLTYPE target(BSTR* target);
  82. virtual HRESULT STDMETHODCALLTYPE isTargetItem(BOOL* result);
  83. virtual HRESULT STDMETHODCALLTYPE children(unsigned* childCount, SAFEARRAY** children);
  84. virtual HRESULT STDMETHODCALLTYPE lastVisitWasFailure(BOOL* wasFailure);
  85. virtual HRESULT STDMETHODCALLTYPE setLastVisitWasFailure(BOOL wasFailure);
  86. virtual HRESULT STDMETHODCALLTYPE lastVisitWasHTTPNonGet(BOOL* HTTPNonGet);
  87. virtual HRESULT STDMETHODCALLTYPE setLastVisitWasHTTPNonGet(BOOL HTTPNonGet);
  88. virtual HRESULT STDMETHODCALLTYPE redirectURLs(IEnumVARIANT**);
  89. virtual HRESULT STDMETHODCALLTYPE visitedWithTitle(BSTR title, BOOL increaseVisitCount);
  90. virtual HRESULT STDMETHODCALLTYPE getDailyVisitCounts(int* number, int** counts);
  91. virtual HRESULT STDMETHODCALLTYPE getWeeklyVisitCounts(int* number, int** counts);
  92. virtual HRESULT STDMETHODCALLTYPE recordInitialVisit();
  93. // WebHistoryItem
  94. WebCore::HistoryItem* historyItem() const;
  95. protected:
  96. ULONG m_refCount;
  97. RefPtr<WebCore::HistoryItem> m_historyItem;
  98. WTF::String m_alternateTitle;
  99. };
  100. #endif