michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #ifndef nsILinkHandler_h___ michael@0: #define nsILinkHandler_h___ michael@0: michael@0: #include "nsISupports.h" michael@0: #include "mozilla/EventForwards.h" michael@0: michael@0: class nsIContent; michael@0: class nsIDocShell; michael@0: class nsIInputStream; michael@0: class nsIRequest; michael@0: class nsString; michael@0: michael@0: // Interface ID for nsILinkHandler michael@0: #define NS_ILINKHANDLER_IID \ michael@0: { 0xceb9aade, 0x43da, 0x4f1a, \ michael@0: { 0xac, 0x8a, 0xc7, 0x09, 0xfb, 0x22, 0x46, 0x64 } } michael@0: michael@0: /** michael@0: * Interface used for handling clicks on links michael@0: */ michael@0: class nsILinkHandler : public nsISupports { michael@0: public: michael@0: NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILINKHANDLER_IID) michael@0: michael@0: /** michael@0: * Process a click on a link. michael@0: * michael@0: * @param aContent the content for the frame that generated the trigger michael@0: * @param aURI a URI object that defines the destination for the link michael@0: * @param aTargetSpec indicates where the link is targeted (may be an empty michael@0: * string) michael@0: * @param aPostDataStream the POST data to send michael@0: * @param aFileName non-null when the link should be downloaded as the given file michael@0: * @param aHeadersDataStream ??? michael@0: * @param aIsTrusted false if the triggerer is an untrusted DOM event. michael@0: */ michael@0: NS_IMETHOD OnLinkClick(nsIContent* aContent, michael@0: nsIURI* aURI, michael@0: const char16_t* aTargetSpec, michael@0: const nsAString& aFileName, michael@0: nsIInputStream* aPostDataStream, michael@0: nsIInputStream* aHeadersDataStream, michael@0: bool aIsTrusted) = 0; michael@0: michael@0: /** michael@0: * Process a click on a link. michael@0: * michael@0: * Works the same as OnLinkClick() except it happens immediately rather than michael@0: * through an event. michael@0: * michael@0: * @param aContent the content for the frame that generated the trigger michael@0: * @param aURI a URI obect that defines the destination for the link michael@0: * @param aTargetSpec indicates where the link is targeted (may be an empty michael@0: * string) michael@0: * @param aFileName non-null when the link should be downloaded as the given file michael@0: * @param aPostDataStream the POST data to send michael@0: * @param aHeadersDataStream ??? michael@0: * @param aDocShell (out-param) the DocShell that the request was opened on michael@0: * @param aRequest the request that was opened michael@0: */ michael@0: NS_IMETHOD OnLinkClickSync(nsIContent* aContent, michael@0: nsIURI* aURI, michael@0: const char16_t* aTargetSpec, michael@0: const nsAString& aFileName, michael@0: nsIInputStream* aPostDataStream = 0, michael@0: nsIInputStream* aHeadersDataStream = 0, michael@0: nsIDocShell** aDocShell = 0, michael@0: nsIRequest** aRequest = 0) = 0; michael@0: michael@0: /** michael@0: * Process a mouse-over a link. michael@0: * michael@0: * @param aContent the linked content. michael@0: * @param aURI an URI object that defines the destination for the link michael@0: * @param aTargetSpec indicates where the link is targeted (it may be an empty michael@0: * string) michael@0: */ michael@0: NS_IMETHOD OnOverLink(nsIContent* aContent, michael@0: nsIURI* aURLSpec, michael@0: const char16_t* aTargetSpec) = 0; michael@0: michael@0: /** michael@0: * Process the mouse leaving a link. michael@0: */ michael@0: NS_IMETHOD OnLeaveLink() = 0; michael@0: }; michael@0: michael@0: NS_DEFINE_STATIC_IID_ACCESSOR(nsILinkHandler, NS_ILINKHANDLER_IID) michael@0: michael@0: #endif /* nsILinkHandler_h___ */