Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | #ifndef nsILinkHandler_h___ |
michael@0 | 6 | #define nsILinkHandler_h___ |
michael@0 | 7 | |
michael@0 | 8 | #include "nsISupports.h" |
michael@0 | 9 | #include "mozilla/EventForwards.h" |
michael@0 | 10 | |
michael@0 | 11 | class nsIContent; |
michael@0 | 12 | class nsIDocShell; |
michael@0 | 13 | class nsIInputStream; |
michael@0 | 14 | class nsIRequest; |
michael@0 | 15 | class nsString; |
michael@0 | 16 | |
michael@0 | 17 | // Interface ID for nsILinkHandler |
michael@0 | 18 | #define NS_ILINKHANDLER_IID \ |
michael@0 | 19 | { 0xceb9aade, 0x43da, 0x4f1a, \ |
michael@0 | 20 | { 0xac, 0x8a, 0xc7, 0x09, 0xfb, 0x22, 0x46, 0x64 } } |
michael@0 | 21 | |
michael@0 | 22 | /** |
michael@0 | 23 | * Interface used for handling clicks on links |
michael@0 | 24 | */ |
michael@0 | 25 | class nsILinkHandler : public nsISupports { |
michael@0 | 26 | public: |
michael@0 | 27 | NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILINKHANDLER_IID) |
michael@0 | 28 | |
michael@0 | 29 | /** |
michael@0 | 30 | * Process a click on a link. |
michael@0 | 31 | * |
michael@0 | 32 | * @param aContent the content for the frame that generated the trigger |
michael@0 | 33 | * @param aURI a URI object that defines the destination for the link |
michael@0 | 34 | * @param aTargetSpec indicates where the link is targeted (may be an empty |
michael@0 | 35 | * string) |
michael@0 | 36 | * @param aPostDataStream the POST data to send |
michael@0 | 37 | * @param aFileName non-null when the link should be downloaded as the given file |
michael@0 | 38 | * @param aHeadersDataStream ??? |
michael@0 | 39 | * @param aIsTrusted false if the triggerer is an untrusted DOM event. |
michael@0 | 40 | */ |
michael@0 | 41 | NS_IMETHOD OnLinkClick(nsIContent* aContent, |
michael@0 | 42 | nsIURI* aURI, |
michael@0 | 43 | const char16_t* aTargetSpec, |
michael@0 | 44 | const nsAString& aFileName, |
michael@0 | 45 | nsIInputStream* aPostDataStream, |
michael@0 | 46 | nsIInputStream* aHeadersDataStream, |
michael@0 | 47 | bool aIsTrusted) = 0; |
michael@0 | 48 | |
michael@0 | 49 | /** |
michael@0 | 50 | * Process a click on a link. |
michael@0 | 51 | * |
michael@0 | 52 | * Works the same as OnLinkClick() except it happens immediately rather than |
michael@0 | 53 | * through an event. |
michael@0 | 54 | * |
michael@0 | 55 | * @param aContent the content for the frame that generated the trigger |
michael@0 | 56 | * @param aURI a URI obect that defines the destination for the link |
michael@0 | 57 | * @param aTargetSpec indicates where the link is targeted (may be an empty |
michael@0 | 58 | * string) |
michael@0 | 59 | * @param aFileName non-null when the link should be downloaded as the given file |
michael@0 | 60 | * @param aPostDataStream the POST data to send |
michael@0 | 61 | * @param aHeadersDataStream ??? |
michael@0 | 62 | * @param aDocShell (out-param) the DocShell that the request was opened on |
michael@0 | 63 | * @param aRequest the request that was opened |
michael@0 | 64 | */ |
michael@0 | 65 | NS_IMETHOD OnLinkClickSync(nsIContent* aContent, |
michael@0 | 66 | nsIURI* aURI, |
michael@0 | 67 | const char16_t* aTargetSpec, |
michael@0 | 68 | const nsAString& aFileName, |
michael@0 | 69 | nsIInputStream* aPostDataStream = 0, |
michael@0 | 70 | nsIInputStream* aHeadersDataStream = 0, |
michael@0 | 71 | nsIDocShell** aDocShell = 0, |
michael@0 | 72 | nsIRequest** aRequest = 0) = 0; |
michael@0 | 73 | |
michael@0 | 74 | /** |
michael@0 | 75 | * Process a mouse-over a link. |
michael@0 | 76 | * |
michael@0 | 77 | * @param aContent the linked content. |
michael@0 | 78 | * @param aURI an URI object that defines the destination for the link |
michael@0 | 79 | * @param aTargetSpec indicates where the link is targeted (it may be an empty |
michael@0 | 80 | * string) |
michael@0 | 81 | */ |
michael@0 | 82 | NS_IMETHOD OnOverLink(nsIContent* aContent, |
michael@0 | 83 | nsIURI* aURLSpec, |
michael@0 | 84 | const char16_t* aTargetSpec) = 0; |
michael@0 | 85 | |
michael@0 | 86 | /** |
michael@0 | 87 | * Process the mouse leaving a link. |
michael@0 | 88 | */ |
michael@0 | 89 | NS_IMETHOD OnLeaveLink() = 0; |
michael@0 | 90 | }; |
michael@0 | 91 | |
michael@0 | 92 | NS_DEFINE_STATIC_IID_ACCESSOR(nsILinkHandler, NS_ILINKHANDLER_IID) |
michael@0 | 93 | |
michael@0 | 94 | #endif /* nsILinkHandler_h___ */ |