• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef WebBackForwardList_H
27 #define WebBackForwardList_H
28 
29 #include "WebKit.h"
30 
31 #include "WebHistoryItem.h"
32 
33 #include <WTF/PassRefPtr.h>
34 #include <WTF/RefPtr.h>
35 
36 namespace WebCore {
37     class BackForwardListImpl;
38 }
39 
40 class WebBackForwardList : public IWebBackForwardList, IWebBackForwardListPrivate
41 {
42 public:
43     static WebBackForwardList* createInstance(PassRefPtr<WebCore::BackForwardListImpl>);
44 protected:
45     WebBackForwardList(PassRefPtr<WebCore::BackForwardListImpl>);
46     ~WebBackForwardList();
47 
48 public:
49     // IUnknown
50     virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
51     virtual ULONG STDMETHODCALLTYPE AddRef(void);
52     virtual ULONG STDMETHODCALLTYPE Release(void);
53 
54     // IWebBackForwardList
55     virtual HRESULT STDMETHODCALLTYPE addItem(
56         /* [in] */ IWebHistoryItem *item);
57 
58     virtual HRESULT STDMETHODCALLTYPE goBack( void);
59 
60     virtual HRESULT STDMETHODCALLTYPE goForward( void);
61 
62     virtual HRESULT STDMETHODCALLTYPE goToItem(
63         /* [in] */ IWebHistoryItem *item);
64 
65     virtual HRESULT STDMETHODCALLTYPE backItem(
66         /* [retval][out] */ IWebHistoryItem **item);
67 
68     virtual HRESULT STDMETHODCALLTYPE currentItem(
69         /* [retval][out] */ IWebHistoryItem **item);
70 
71     virtual HRESULT STDMETHODCALLTYPE forwardItem(
72         /* [retval][out] */ IWebHistoryItem **item);
73 
74     virtual HRESULT STDMETHODCALLTYPE backListWithLimit(
75         /* [in] */ int limit,
76         /* [out] */ int *listCount,
77         /* [in] */ IWebHistoryItem **list);
78 
79     virtual HRESULT STDMETHODCALLTYPE forwardListWithLimit(
80         /* [in] */ int limit,
81         /* [out] */ int *listCount,
82         /* [in] */ IWebHistoryItem **list);
83 
84     virtual HRESULT STDMETHODCALLTYPE capacity(
85         /* [retval][out] */ int *result);
86 
87     virtual HRESULT STDMETHODCALLTYPE setCapacity(
88         /* [in] */ int size);
89 
90     virtual HRESULT STDMETHODCALLTYPE backListCount(
91         /* [retval][out] */ int *count);
92 
93     virtual HRESULT STDMETHODCALLTYPE forwardListCount(
94         /* [retval][out] */ int *sizecount);
95 
96     virtual HRESULT STDMETHODCALLTYPE containsItem(
97         /* [in] */ IWebHistoryItem *item,
98         /* [retval][out] */ BOOL *result);
99 
100     virtual HRESULT STDMETHODCALLTYPE itemAtIndex(
101         /* [in] */ int index,
102         /* [retval][out] */ IWebHistoryItem **item);
103 
104     // IWebBackForwardListPrivate
105     virtual HRESULT STDMETHODCALLTYPE removeItem(
106         /* [in] */ IWebHistoryItem* item);
107 
108     // WebBackForwardList
109 
110 protected:
111     ULONG m_refCount;
112     RefPtr<WebCore::BackForwardListImpl> m_backForwardList;
113 };
114 
115 #endif
116