IWebBackForwardList.idl 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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 DO_NO_IMPORTS
  26. import "oaidl.idl";
  27. import "ocidl.idl";
  28. import "IWebHistoryItem.idl";
  29. #endif
  30. interface IWebHistoryItem;
  31. /*!
  32. @class WebBackForwardList
  33. WebBackForwardList holds an ordered list of WebHistoryItems that comprises the back and
  34. forward lists.
  35. Note that the methods which modify instances of this class do not cause
  36. navigation to happen in other layers of the stack; they are only for maintaining this data
  37. structure.
  38. */
  39. [
  40. object,
  41. oleautomation,
  42. uuid(C278A16D-B502-4131-B551-DCE3F4ED2B36),
  43. pointer_default(unique)
  44. ]
  45. interface IWebBackForwardList : IUnknown
  46. {
  47. /*!
  48. @method addItem:
  49. @abstract Adds an entry to the list.
  50. @param entry The entry to add.
  51. @discussion The added entry is inserted immediately after the current entry.
  52. If the current position in the list is not at the end of the list, elements in the
  53. forward list will be dropped at this point. In addition, entries may be dropped to keep
  54. the size of the list within the maximum size.
  55. - (void)addItem:(WebHistoryItem *)item;
  56. */
  57. HRESULT addItem([in] IWebHistoryItem* item);
  58. /*!
  59. @method goBack
  60. @abstract Move the current pointer back to the entry before the current entry.
  61. - (void)goBack;
  62. */
  63. HRESULT goBack();
  64. /*!
  65. @method goForward
  66. @abstract Move the current pointer ahead to the entry after the current entry.
  67. - (void)goForward;
  68. */
  69. HRESULT goForward();
  70. /*!
  71. @method goToItem:
  72. @abstract Move the current pointer to the given entry.
  73. @param item The history item to move the pointer to
  74. - (void)goToItem:(WebHistoryItem *)item;
  75. */
  76. HRESULT goToItem([in] IWebHistoryItem* item);
  77. /*!
  78. @method backItem
  79. @abstract Returns the entry right before the current entry.
  80. @result The entry right before the current entry, or nil if there isn't one.
  81. - (WebHistoryItem *)backItem;
  82. */
  83. HRESULT backItem([out, retval] IWebHistoryItem** item);
  84. /*!
  85. @method currentItem
  86. @abstract Returns the current entry.
  87. @result The current entry.
  88. - (WebHistoryItem *)currentItem;
  89. */
  90. HRESULT currentItem([out, retval] IWebHistoryItem** item);
  91. /*!
  92. @method forwardItem
  93. @abstract Returns the entry right after the current entry.
  94. @result The entry right after the current entry, or nil if there isn't one.
  95. - (WebHistoryItem *)forwardItem;
  96. */
  97. HRESULT forwardItem([out, retval] IWebHistoryItem** item);
  98. /*!
  99. @method backListWithLimit:
  100. @abstract Returns a portion of the list before the current entry.
  101. @param limit A cap on the size of the array returned.
  102. @result An array of items before the current entry, or nil if there are none. The entries are in the order that they were originally visited.
  103. - (NSArray *)backListWithLimit:(int)limit;
  104. */
  105. HRESULT backListWithLimit([in] int limit, [out] int* listCount, [in] IWebHistoryItem** list);
  106. /*!
  107. @method forwardListWithLimit:
  108. @abstract Returns a portion of the list after the current entry.
  109. @param limit A cap on the size of the array returned.
  110. @result An array of items after the current entry, or nil if there are none. The entries are in the order that they were originally visited.
  111. - (NSArray *)forwardListWithLimit:(int)limit;
  112. */
  113. HRESULT forwardListWithLimit([in] int limit, [out] int* listCount, [in] IWebHistoryItem** list);
  114. /*!
  115. @method capacity
  116. @abstract Returns the list's maximum size.
  117. @result The list's maximum size.
  118. - (int)capacity;
  119. */
  120. HRESULT capacity([out, retval] int* result);
  121. /*!
  122. @method setCacpacity
  123. @abstract Sets the list's maximum size.
  124. @param size The new maximum size for the list.
  125. - (void)setCapacity:(int)size;
  126. */
  127. HRESULT setCapacity([in] int size);
  128. /*!
  129. @method backListCount
  130. @abstract Returns the back list's current count.
  131. @result The number of items in the list.
  132. - (int)backListCount;
  133. */
  134. HRESULT backListCount([out, retval] int* count);
  135. /*!
  136. @method forwardListCount
  137. @abstract Returns the forward list's current count.
  138. @result The number of items in the list.
  139. - (int)forwardListCount;
  140. */
  141. HRESULT forwardListCount([out, retval] int* sizecount);
  142. /*!
  143. @method containsItem:
  144. @param item The item that will be checked for presence in the WebBackForwardList.
  145. @result Returns YES if the item is in the list.
  146. - (BOOL)containsItem:(WebHistoryItem *)item;
  147. */
  148. HRESULT containsItem([in] IWebHistoryItem* item, [out, retval] BOOL* result);
  149. /*!
  150. @method itemAtIndex:
  151. @abstract Returns an entry the given distance from the current entry.
  152. @param index Index of the desired list item relative to the current item; 0 is current item, -1 is back item, 1 is forward item, etc.
  153. @result The entry the given distance from the current entry. If index exceeds the limits of the list, nil is returned.
  154. - (WebHistoryItem *)itemAtIndex:(int)index;
  155. */
  156. HRESULT itemAtIndex([in] int index, [out, retval] IWebHistoryItem** item);
  157. }