IWebHistory.idl 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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. /*
  26. @discussion Notifications sent when history is modified.
  27. @constant WebHistoryItemsAddedNotification Posted from addItems:. This
  28. notification comes with a userInfo dictionary that contains the array of
  29. items added. The key for the array is WebHistoryItemsKey.
  30. @constant WebHistoryItemsRemovedNotification Posted from removeItems:.
  31. This notification comes with a userInfo dictionary that contains the array of
  32. items removed. The key for the array is WebHistoryItemsKey.
  33. @constant WebHistoryAllItemsRemovedNotification Posted from removeAllItems
  34. @constant WebHistoryLoadedNotification Posted from loadFromURL:error:.
  35. */
  36. cpp_quote("#define WebHistoryItemsAddedNotification TEXT(\"WebHistoryItemsAddedNotification\")")
  37. cpp_quote("#define WebHistoryItemsRemovedNotification TEXT(\"WebHistoryItemsRemovedNotification\")")
  38. cpp_quote("#define WebHistoryAllItemsRemovedNotification TEXT(\"WebHistoryAllItemsRemovedNotification\")")
  39. cpp_quote("#define WebHistoryLoadedNotification TEXT(\"WebHistoryLoadedNotification\")")
  40. cpp_quote("#define WebHistoryItemsDiscardedWhileLoadingNotification TEXT(\"WebHistoryItemsDiscardedWhileLoadingNotification\")")
  41. cpp_quote("#define WebHistorySavedNotification TEXT(\"WebHistorySavedNotification\")")
  42. #ifndef DO_NO_IMPORTS
  43. import "oaidl.idl";
  44. import "ocidl.idl";
  45. import "IWebError.idl";
  46. import "IWebHistoryItem.idl";
  47. #endif
  48. interface IWebError;
  49. interface IWebHistoryItem;
  50. /*!
  51. @class WebHistory
  52. @discussion WebHistory is used to track pages that have been loaded
  53. by WebKit.
  54. */
  55. [
  56. object,
  57. oleautomation,
  58. hidden,
  59. uuid(F34E4B1A-361D-4b9f-9A3F-D869DCD97F9A),
  60. pointer_default(unique)
  61. ]
  62. interface IWebHistory : IUnknown
  63. {
  64. /*!
  65. @method optionalSharedHistory
  66. @abstract Returns a shared WebHistory instance initialized with the default history file.
  67. @result A WebHistory object.
  68. + (WebHistory *)optionalSharedHistory;
  69. */
  70. HRESULT optionalSharedHistory([out, retval] IWebHistory** history);
  71. /*!
  72. @method setOptionalSharedHistory:
  73. @param history The history to use for the global WebHistory.
  74. + (void)setOptionalSharedHistory:(WebHistory *)history;
  75. */
  76. HRESULT setOptionalSharedHistory([in] IWebHistory* history);
  77. HRESULT unused1();
  78. HRESULT unused2();
  79. /*!
  80. @method addItems:
  81. @param newItems An array of WebHistoryItems to add to the WebHistory.
  82. - (void)addItems:(NSArray *)newItems;
  83. */
  84. HRESULT addItems([in] int itemCount, [in] IWebHistoryItem** items);
  85. /*!
  86. @method removeItems:
  87. @param items An array of WebHistoryItems to remove from the WebHistory.
  88. - (void)removeItems:(NSArray *)items;
  89. */
  90. HRESULT removeItems([in] int itemCount, [in] IWebHistoryItem** items);
  91. /*!
  92. @method removeAllItems
  93. - (void)removeAllItems;
  94. */
  95. HRESULT removeAllItems();
  96. /*!
  97. @method orderedLastVisitedDays
  98. @discussion Get an array of NSCalendarDates, each one representing a unique day that contains one
  99. or more history items, ordered from most recent to oldest.
  100. @result Returns an array of NSCalendarDates for which history items exist in the WebHistory.
  101. ADVISORY NOTE: This method may change for the 1.0 SDK.
  102. - (NSArray *)orderedLastVisitedDays;
  103. */
  104. HRESULT orderedLastVisitedDays([in, out] int* count, [in] DATE* calendarDates);
  105. /*!
  106. @method orderedItemsLastVisitedOnDay:
  107. @discussion Get an array of WebHistoryItem that were last visited on the day represented by the
  108. specified NSCalendarDate, ordered from most recent to oldest.
  109. @param calendarDate A date identifying the unique day of interest.
  110. @result Returns an array of WebHistoryItems last visited on the indicated day.
  111. ADVISORY NOTE: This method may change for the 1.0 SDK.
  112. - (NSArray *)orderedItemsLastVisitedOnDay:(NSCalendarDate *)calendarDate;
  113. */
  114. HRESULT orderedItemsLastVisitedOnDay([in, out] int* count, [in] IWebHistoryItem** items, [in] DATE calendarDate);
  115. /*!
  116. @method itemForURL:
  117. @abstract Get an item for a specific URL
  118. @param URL The URL of the history item to search for
  119. @result Returns an item matching the URL
  120. - (WebHistoryItem *)itemForURL:(NSURL *)URL;
  121. */
  122. HRESULT itemForURL([in] BSTR url, [out, retval] IWebHistoryItem** item);
  123. /*!
  124. @method setHistoryItemLimit:
  125. @discussion Limits the number of items that will be stored by the WebHistory.
  126. @param limit The maximum number of items that will be stored by the WebHistory.
  127. - (void)setHistoryItemLimit:(int)limit;
  128. */
  129. HRESULT setHistoryItemLimit([in] int limit);
  130. /*!
  131. @method historyItemLimit
  132. @result The maximum number of items that will be stored by the WebHistory.
  133. - (int)historyItemLimit;
  134. */
  135. HRESULT historyItemLimit([out, retval] int* limit);
  136. /*!
  137. @method setHistoryAgeInDaysLimit:
  138. @discussion setHistoryAgeInDaysLimit: sets the maximum number of days to be read from
  139. stored history.
  140. @param limit The maximum number of days to be read from stored history.
  141. - (void)setHistoryAgeInDaysLimit:(int)limit;
  142. */
  143. HRESULT setHistoryAgeInDaysLimit([in] int limit);
  144. /*!
  145. @method historyAgeInDaysLimit
  146. @return Returns the maximum number of days to be read from stored history.
  147. - (int)historyAgeInDaysLimit;
  148. */
  149. HRESULT historyAgeInDaysLimit([out, retval] int* limit);
  150. }