2015-02-13 19:36:47 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1998-04-13 20:24:54 +00:00
|
|
|
#ifndef nsILinkHandler_h___
|
|
|
|
#define nsILinkHandler_h___
|
|
|
|
|
1998-07-18 21:49:03 +00:00
|
|
|
#include "nsISupports.h"
|
2013-09-24 10:04:14 +00:00
|
|
|
#include "mozilla/EventForwards.h"
|
1998-07-19 01:17:09 +00:00
|
|
|
|
2013-03-22 00:05:20 +00:00
|
|
|
class nsIContent;
|
2002-03-13 06:08:56 +00:00
|
|
|
class nsIDocShell;
|
2013-03-22 00:05:20 +00:00
|
|
|
class nsIInputStream;
|
2002-03-13 06:08:56 +00:00
|
|
|
class nsIRequest;
|
1998-04-13 20:24:54 +00:00
|
|
|
|
1998-07-19 01:17:09 +00:00
|
|
|
#define NS_ILINKHANDLER_IID \
|
2012-12-02 20:55:52 +00:00
|
|
|
{ 0xceb9aade, 0x43da, 0x4f1a, \
|
|
|
|
{ 0xac, 0x8a, 0xc7, 0x09, 0xfb, 0x22, 0x46, 0x64 } }
|
1998-04-13 20:24:54 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface used for handling clicks on links
|
|
|
|
*/
|
2015-02-13 19:36:37 +00:00
|
|
|
class nsILinkHandler : public nsISupports
|
|
|
|
{
|
1998-04-13 20:24:54 +00:00
|
|
|
public:
|
2005-11-11 14:36:26 +00:00
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILINKHANDLER_IID)
|
1999-06-20 21:51:06 +00:00
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
/**
|
2002-03-13 06:08:56 +00:00
|
|
|
* Process a click on a link.
|
|
|
|
*
|
|
|
|
* @param aContent the content for the frame that generated the trigger
|
2002-11-20 00:44:26 +00:00
|
|
|
* @param aURI a URI object that defines the destination for the link
|
2002-03-13 06:08:56 +00:00
|
|
|
* @param aTargetSpec indicates where the link is targeted (may be an empty
|
|
|
|
* string)
|
|
|
|
* @param aPostDataStream the POST data to send
|
2012-12-02 20:55:52 +00:00
|
|
|
* @param aFileName non-null when the link should be downloaded as the given file
|
2002-03-13 06:08:56 +00:00
|
|
|
* @param aHeadersDataStream ???
|
2011-10-17 14:59:28 +00:00
|
|
|
* @param aIsTrusted false if the triggerer is an untrusted DOM event.
|
1998-04-13 20:24:54 +00:00
|
|
|
*/
|
2012-12-02 20:55:52 +00:00
|
|
|
NS_IMETHOD OnLinkClick(nsIContent* aContent,
|
2002-11-20 00:44:26 +00:00
|
|
|
nsIURI* aURI,
|
2014-01-04 15:02:17 +00:00
|
|
|
const char16_t* aTargetSpec,
|
2012-12-02 20:55:52 +00:00
|
|
|
const nsAString& aFileName,
|
2011-06-30 11:52:11 +00:00
|
|
|
nsIInputStream* aPostDataStream,
|
|
|
|
nsIInputStream* aHeadersDataStream,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aIsTrusted) = 0;
|
1998-05-19 00:08:57 +00:00
|
|
|
|
1998-06-01 19:59:13 +00:00
|
|
|
/**
|
2002-03-13 06:08:56 +00:00
|
|
|
* Process a click on a link.
|
|
|
|
*
|
|
|
|
* Works the same as OnLinkClick() except it happens immediately rather than
|
|
|
|
* through an event.
|
|
|
|
*
|
|
|
|
* @param aContent the content for the frame that generated the trigger
|
2002-11-20 00:44:26 +00:00
|
|
|
* @param aURI a URI obect that defines the destination for the link
|
2002-03-13 06:08:56 +00:00
|
|
|
* @param aTargetSpec indicates where the link is targeted (may be an empty
|
|
|
|
* string)
|
2012-12-02 20:55:52 +00:00
|
|
|
* @param aFileName non-null when the link should be downloaded as the given file
|
2002-03-13 06:08:56 +00:00
|
|
|
* @param aPostDataStream the POST data to send
|
|
|
|
* @param aHeadersDataStream ???
|
|
|
|
* @param aDocShell (out-param) the DocShell that the request was opened on
|
|
|
|
* @param aRequest the request that was opened
|
|
|
|
*/
|
2012-12-02 20:55:52 +00:00
|
|
|
NS_IMETHOD OnLinkClickSync(nsIContent* aContent,
|
2002-11-20 00:44:26 +00:00
|
|
|
nsIURI* aURI,
|
2014-01-04 15:02:17 +00:00
|
|
|
const char16_t* aTargetSpec,
|
2012-12-02 20:55:52 +00:00
|
|
|
const nsAString& aFileName,
|
2002-03-13 06:08:56 +00:00
|
|
|
nsIInputStream* aPostDataStream = 0,
|
|
|
|
nsIInputStream* aHeadersDataStream = 0,
|
|
|
|
nsIDocShell** aDocShell = 0,
|
2010-09-30 23:55:11 +00:00
|
|
|
nsIRequest** aRequest = 0) = 0;
|
2002-03-13 06:08:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Process a mouse-over a link.
|
|
|
|
*
|
|
|
|
* @param aContent the linked content.
|
2002-11-20 00:44:26 +00:00
|
|
|
* @param aURI an URI object that defines the destination for the link
|
2002-03-13 06:08:56 +00:00
|
|
|
* @param aTargetSpec indicates where the link is targeted (it may be an empty
|
|
|
|
* string)
|
1998-06-01 19:59:13 +00:00
|
|
|
*/
|
2015-02-13 19:36:37 +00:00
|
|
|
NS_IMETHOD OnOverLink(nsIContent* aContent,
|
2002-11-20 00:44:26 +00:00
|
|
|
nsIURI* aURLSpec,
|
2014-01-04 15:02:17 +00:00
|
|
|
const char16_t* aTargetSpec) = 0;
|
1998-06-01 19:59:13 +00:00
|
|
|
|
2002-11-20 00:44:26 +00:00
|
|
|
/**
|
|
|
|
* Process the mouse leaving a link.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD OnLeaveLink() = 0;
|
1998-04-13 20:24:54 +00:00
|
|
|
};
|
|
|
|
|
2005-11-11 14:36:26 +00:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsILinkHandler, NS_ILINKHANDLER_IID)
|
|
|
|
|
1998-04-13 20:24:54 +00:00
|
|
|
#endif /* nsILinkHandler_h___ */
|