1cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block/*
2cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * Copyright (C) 2009 Apple Inc.  All rights reserved.
3cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block *
4cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * Redistribution and use in source and binary forms, with or without
5cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * modification, are permitted provided that the following conditions
6cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * are met:
7cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * 1. Redistributions of source code must retain the above copyright
8cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block *    notice, this list of conditions and the following disclaimer.
9cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * 2. Redistributions in binary form must reproduce the above copyright
10cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block *    notice, this list of conditions and the following disclaimer in the
11cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block *    documentation and/or other materials provided with the distribution.
12cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block *
13cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block */
25cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block
26cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#ifndef WebNavigationData_h
27cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#define WebNavigationData_h
28cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block
29cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#include "WebKit.h"
30cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block
31cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#include <WebCore/BString.h>
322daae5fd11344eaa88a0d92b0f6d65f8d2255c00Ben Murdoch#include <WebCore/COMPtr.h>
33cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block
34cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Blockclass WebNavigationData : public IWebNavigationData {
35cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Blockpublic:
36dd8bb3de4f353a81954234999f1fea748aee2ea9Ben Murdoch    static WebNavigationData* createInstance(const WTF::String& url, const WTF::String& title, IWebURLRequest*, IWebURLResponse*, bool hasSubstituteData, const WTF::String& clientRedirectSource);
37cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Blockprivate:
38dd8bb3de4f353a81954234999f1fea748aee2ea9Ben Murdoch    WebNavigationData(const WTF::String& url, const WTF::String& title, IWebURLRequest*, IWebURLResponse*, bool hasSubstituteData, const WTF::String& clientRedirectSource);
39cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    ~WebNavigationData();
40cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block
41cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Blockpublic:
42cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    // IUnknown
43cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
44cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    virtual ULONG STDMETHODCALLTYPE AddRef(void);
45cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    virtual ULONG STDMETHODCALLTYPE Release(void);
46cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block
47cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    // IWebNavigationData
48cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    virtual HRESULT STDMETHODCALLTYPE url(
49cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block        /* [retval][out] */ BSTR*);
50cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block
51cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    virtual HRESULT STDMETHODCALLTYPE title(
52cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block        /* [retval][out] */ BSTR*);
53cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block
54cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    virtual HRESULT STDMETHODCALLTYPE originalRequest(
55cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block        /* [retval][out] */ IWebURLRequest**);
56cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block
57cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    virtual HRESULT STDMETHODCALLTYPE response(
58cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block        /* [retval][out] */ IWebURLResponse**);
59cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block
60cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    virtual HRESULT STDMETHODCALLTYPE hasSubstituteData(
61cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block        /* [retval][out] */ BOOL*);
62cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block
63cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    virtual HRESULT STDMETHODCALLTYPE clientRedirectSource(
64cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block        /* [retval][out] */ BSTR*);
65cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block
66cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Blockprivate:
67cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    ULONG m_refCount;
68cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    WebCore::BString m_url;
69cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    WebCore::BString m_title;
70cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    COMPtr<IWebURLRequest> m_request;
71cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    COMPtr<IWebURLResponse> m_response;
72cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    bool m_hasSubstituteData;
73cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    WebCore::BString m_clientRedirectSource;
74cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block
75cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block};
76cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block
77cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block#endif // WebNavigationData_h
78