webengine/osswebengine/WebKit/win/Interfaces/IWebHistory.idl
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2  * Copyright (C) 2006, 2007 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 cpp_quote("/*")
       
    27 cpp_quote(" * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.")
       
    28 cpp_quote(" *")
       
    29 cpp_quote(" * Redistribution and use in source and binary forms, with or without")
       
    30 cpp_quote(" * modification, are permitted provided that the following conditions")
       
    31 cpp_quote(" * are met:")
       
    32 cpp_quote(" * 1. Redistributions of source code must retain the above copyright")
       
    33 cpp_quote(" *    notice, this list of conditions and the following disclaimer.")
       
    34 cpp_quote(" * 2. Redistributions in binary form must reproduce the above copyright")
       
    35 cpp_quote(" *    notice, this list of conditions and the following disclaimer in the")
       
    36 cpp_quote(" *    documentation and/or other materials provided with the distribution.")
       
    37 cpp_quote(" *")
       
    38 cpp_quote(" * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY")
       
    39 cpp_quote(" * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE")
       
    40 cpp_quote(" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR")
       
    41 cpp_quote(" * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR")
       
    42 cpp_quote(" * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,")
       
    43 cpp_quote(" * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,")
       
    44 cpp_quote(" * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR")
       
    45 cpp_quote(" * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY")
       
    46 cpp_quote(" * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT")
       
    47 cpp_quote(" * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE")
       
    48 cpp_quote(" * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ")
       
    49 cpp_quote(" */")
       
    50 
       
    51 /*
       
    52     @discussion Notifications sent when history is modified. 
       
    53     @constant WebHistoryItemsAddedNotification Posted from addItems:.  This 
       
    54     notification comes with a userInfo dictionary that contains the array of
       
    55     items added.  The key for the array is WebHistoryItemsKey.
       
    56     @constant WebHistoryItemsRemovedNotification Posted from removeItems:.  
       
    57     This notification comes with a userInfo dictionary that contains the array of
       
    58     items removed.  The key for the array is WebHistoryItemsKey.
       
    59     @constant WebHistoryAllItemsRemovedNotification Posted from removeAllItems
       
    60     @constant WebHistoryLoadedNotification Posted from loadFromURL:error:.
       
    61 */
       
    62 cpp_quote("#define WebHistoryItemsAddedNotification TEXT(\"WebHistoryItemsAddedNotification\")")
       
    63 cpp_quote("#define WebHistoryItemsRemovedNotification TEXT(\"WebHistoryItemsRemovedNotification\")")
       
    64 cpp_quote("#define WebHistoryAllItemsRemovedNotification TEXT(\"WebHistoryAllItemsRemovedNotification\")")
       
    65 cpp_quote("#define WebHistoryLoadedNotification TEXT(\"WebHistoryLoadedNotification\")")
       
    66 cpp_quote("#define WebHistoryItemsDiscardedWhileLoadingNotification TEXT(\"WebHistoryItemsDiscardedWhileLoadingNotification\")")
       
    67 cpp_quote("#define WebHistorySavedNotification TEXT(\"WebHistorySavedNotification\")")
       
    68 
       
    69 import "oaidl.idl";
       
    70 import "ocidl.idl";
       
    71 import "IWebError.idl";
       
    72 import "IWebHistoryItem.idl";
       
    73 
       
    74 /*!
       
    75     @class WebHistory
       
    76     @discussion WebHistory is used to track pages that have been loaded
       
    77     by WebKit.
       
    78 */
       
    79 [
       
    80     object,
       
    81     oleautomation,
       
    82     hidden,
       
    83     uuid(F34E4B1A-361D-4b9f-9A3F-D869DCD97F9A),
       
    84     pointer_default(unique)
       
    85 ]
       
    86 interface IWebHistory : IUnknown
       
    87 {
       
    88     /*!
       
    89         @method optionalSharedHistory
       
    90         @abstract Returns a shared WebHistory instance initialized with the default history file.
       
    91         @result A WebHistory object.
       
    92         + (WebHistory *)optionalSharedHistory;
       
    93     */
       
    94     HRESULT optionalSharedHistory([out, retval] IWebHistory** history);
       
    95 
       
    96     /*!
       
    97         @method setOptionalSharedHistory:
       
    98         @param history The history to use for the global WebHistory.
       
    99         + (void)setOptionalSharedHistory:(WebHistory *)history;
       
   100     */
       
   101     HRESULT setOptionalSharedHistory([in] IWebHistory* history);
       
   102 
       
   103     /*!
       
   104         @method loadFromURL:error:
       
   105         @param URL The URL to use to initialize the WebHistory.
       
   106         @param error Set to nil or an NSError instance if an error occurred.
       
   107         @abstract The designated initializer for WebHistory.
       
   108         @result Returns YES if successful, NO otherwise.
       
   109         - (BOOL)loadFromURL:(NSURL *)URL error:(NSError **)error;
       
   110     */
       
   111     HRESULT loadFromURL([in] BSTR url, [out] IWebError** error, [out, retval] BOOL* succeeded);
       
   112 
       
   113     /*!
       
   114         @method saveToURL:error:
       
   115         @discussion Save history to URL. It is the client's responsibility to call this at appropriate times.
       
   116         @param URL The URL to use to save the WebHistory.
       
   117         @param error Set to nil or an NSError instance if an error occurred.
       
   118         @result Returns YES if successful, NO otherwise.
       
   119         - (BOOL)saveToURL:(NSURL *)URL error:(NSError **)error;
       
   120     */
       
   121     HRESULT saveToURL([in] BSTR url, [out] IWebError** error, [out, retval] BOOL* succeeded);
       
   122 
       
   123     /*!
       
   124         @method addItems:
       
   125         @param newItems An array of WebHistoryItems to add to the WebHistory.
       
   126         - (void)addItems:(NSArray *)newItems;
       
   127     */
       
   128     HRESULT addItems([in] int itemCount, [in] IWebHistoryItem** items);
       
   129 
       
   130     /*!
       
   131         @method removeItems:
       
   132         @param items An array of WebHistoryItems to remove from the WebHistory.
       
   133         - (void)removeItems:(NSArray *)items;
       
   134     */
       
   135     HRESULT removeItems([in] int itemCount, [in] IWebHistoryItem** items);
       
   136 
       
   137     /*!
       
   138         @method removeAllItems
       
   139         - (void)removeAllItems;
       
   140     */
       
   141     HRESULT removeAllItems();
       
   142 
       
   143     /*!
       
   144         @method orderedLastVisitedDays
       
   145         @discussion Get an array of NSCalendarDates, each one representing a unique day that contains one
       
   146         or more history items, ordered from most recent to oldest.
       
   147         @result Returns an array of NSCalendarDates for which history items exist in the WebHistory.
       
   148         
       
   149         ADVISORY NOTE:  This method may change for the 1.0 SDK.
       
   150         - (NSArray *)orderedLastVisitedDays;
       
   151     */
       
   152     HRESULT orderedLastVisitedDays([in, out] int* count, [in] DATE* calendarDates);
       
   153 
       
   154     /*!
       
   155         @method orderedItemsLastVisitedOnDay:
       
   156         @discussion Get an array of WebHistoryItem that were last visited on the day represented by the
       
   157         specified NSCalendarDate, ordered from most recent to oldest.
       
   158         @param calendarDate A date identifying the unique day of interest.
       
   159         @result Returns an array of WebHistoryItems last visited on the indicated day.
       
   160 
       
   161         ADVISORY NOTE:  This method may change for the 1.0 SDK.
       
   162         - (NSArray *)orderedItemsLastVisitedOnDay:(NSCalendarDate *)calendarDate;
       
   163     */
       
   164     HRESULT orderedItemsLastVisitedOnDay([in, out] int* count, [in] IWebHistoryItem** items, [in] DATE calendarDate);
       
   165 
       
   166     /*!
       
   167         @method itemForURL:
       
   168         @abstract Get an item for a specific URL
       
   169         @param URL The URL of the history item to search for
       
   170         @result Returns an item matching the URL
       
   171         - (WebHistoryItem *)itemForURL:(NSURL *)URL;
       
   172     */
       
   173     HRESULT itemForURL([in] BSTR url, [out, retval] IWebHistoryItem** item);
       
   174 
       
   175     /*!
       
   176         @method setHistoryItemLimit:
       
   177         @discussion Limits the number of items that will be stored by the WebHistory.
       
   178         @param limit The maximum number of items that will be stored by the WebHistory.
       
   179         - (void)setHistoryItemLimit:(int)limit;
       
   180     */
       
   181     HRESULT setHistoryItemLimit([in] int limit);
       
   182 
       
   183     /*!
       
   184         @method historyItemLimit
       
   185         @result The maximum number of items that will be stored by the WebHistory.
       
   186         - (int)historyItemLimit;
       
   187     */
       
   188     HRESULT historyItemLimit([out, retval] int* limit);
       
   189 
       
   190     /*!
       
   191         @method setHistoryAgeInDaysLimit:
       
   192         @discussion setHistoryAgeInDaysLimit: sets the maximum number of days to be read from
       
   193         stored history.
       
   194         @param limit The maximum number of days to be read from stored history.
       
   195         - (void)setHistoryAgeInDaysLimit:(int)limit;
       
   196     */
       
   197     HRESULT setHistoryAgeInDaysLimit([in] int limit);
       
   198 
       
   199     /*!
       
   200         @method historyAgeInDaysLimit
       
   201         @return Returns the maximum number of days to be read from stored history.
       
   202         - (int)historyAgeInDaysLimit;
       
   203     */
       
   204     HRESULT historyAgeInDaysLimit([out, retval] int* limit);
       
   205 }