2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-17 20:52:41 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1998-04-14 00:24:54 +04:00
|
|
|
*
|
2004-04-17 20:52:41 +04:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
1998-04-14 00:24:54 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
1998-04-14 00:24:54 +04:00
|
|
|
*
|
1998-07-19 05:17:09 +04:00
|
|
|
* The Original Code is Mozilla Communicator client code.
|
|
|
|
*
|
2004-04-17 20:52:41 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-29 00:14:13 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 06:43:54 +03:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-17 20:52:41 +04:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2001-09-29 00:14:13 +04:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-17 20:52:41 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-29 00:14:13 +04:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-17 20:52:41 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-29 00:14:13 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1998-04-14 00:24:54 +04:00
|
|
|
#ifndef nsILinkHandler_h___
|
|
|
|
#define nsILinkHandler_h___
|
|
|
|
|
1998-07-19 01:49:03 +04:00
|
|
|
#include "nsISupports.h"
|
2009-07-13 15:48:06 +04:00
|
|
|
#include "nsIContent.h"
|
1998-07-19 05:17:09 +04:00
|
|
|
|
1999-08-04 00:51:41 +04:00
|
|
|
class nsIInputStream;
|
2002-03-13 09:08:56 +03:00
|
|
|
class nsIDocShell;
|
|
|
|
class nsIRequest;
|
2000-04-18 08:34:20 +04:00
|
|
|
class nsString;
|
2005-04-29 03:48:28 +04:00
|
|
|
class nsGUIEvent;
|
1998-04-14 00:24:54 +04:00
|
|
|
|
1998-07-19 05:17:09 +04:00
|
|
|
// Interface ID for nsILinkHandler
|
|
|
|
#define NS_ILINKHANDLER_IID \
|
2011-06-30 15:52:11 +04:00
|
|
|
{ 0xd85670a1, 0x224a, 0x4562, \
|
|
|
|
{ 0x87, 0xa9, 0x43, 0xa5, 0x24, 0xe7, 0xd0, 0x1b } }
|
1998-04-14 00:24:54 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface used for handling clicks on links
|
|
|
|
*/
|
|
|
|
class nsILinkHandler : public nsISupports {
|
|
|
|
public:
|
2005-11-11 17:36:26 +03:00
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILINKHANDLER_IID)
|
1999-06-21 01:51:06 +04:00
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
/**
|
2002-03-13 09:08:56 +03:00
|
|
|
* Process a click on a link.
|
|
|
|
*
|
|
|
|
* @param aContent the content for the frame that generated the trigger
|
2002-11-20 03:44:26 +03:00
|
|
|
* @param aURI a URI object that defines the destination for the link
|
2002-03-13 09:08:56 +03:00
|
|
|
* @param aTargetSpec indicates where the link is targeted (may be an empty
|
|
|
|
* string)
|
|
|
|
* @param aPostDataStream the POST data to send
|
|
|
|
* @param aHeadersDataStream ???
|
2011-10-17 18:59:28 +04:00
|
|
|
* @param aIsTrusted false if the triggerer is an untrusted DOM event.
|
1998-04-14 00:24:54 +04:00
|
|
|
*/
|
1998-11-14 03:21:19 +03:00
|
|
|
NS_IMETHOD OnLinkClick(nsIContent* aContent,
|
2002-11-20 03:44:26 +03:00
|
|
|
nsIURI* aURI,
|
1998-08-15 03:08:54 +04:00
|
|
|
const PRUnichar* aTargetSpec,
|
2011-06-30 15:52:11 +04:00
|
|
|
nsIInputStream* aPostDataStream,
|
|
|
|
nsIInputStream* aHeadersDataStream,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aIsTrusted) = 0;
|
1998-05-19 04:08:57 +04:00
|
|
|
|
1998-06-01 23:59:13 +04:00
|
|
|
/**
|
2002-03-13 09:08:56 +03: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 03:44:26 +03:00
|
|
|
* @param aURI a URI obect that defines the destination for the link
|
2002-03-13 09:08:56 +03:00
|
|
|
* @param aTargetSpec indicates where the link is targeted (may be an empty
|
|
|
|
* string)
|
|
|
|
* @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
|
|
|
|
*/
|
|
|
|
NS_IMETHOD OnLinkClickSync(nsIContent* aContent,
|
2002-11-20 03:44:26 +03:00
|
|
|
nsIURI* aURI,
|
2002-03-13 09:08:56 +03:00
|
|
|
const PRUnichar* aTargetSpec,
|
|
|
|
nsIInputStream* aPostDataStream = 0,
|
|
|
|
nsIInputStream* aHeadersDataStream = 0,
|
|
|
|
nsIDocShell** aDocShell = 0,
|
2010-10-01 03:55:11 +04:00
|
|
|
nsIRequest** aRequest = 0) = 0;
|
2002-03-13 09:08:56 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Process a mouse-over a link.
|
|
|
|
*
|
|
|
|
* @param aContent the linked content.
|
2002-11-20 03:44:26 +03:00
|
|
|
* @param aURI an URI object that defines the destination for the link
|
2002-03-13 09:08:56 +03:00
|
|
|
* @param aTargetSpec indicates where the link is targeted (it may be an empty
|
|
|
|
* string)
|
1998-06-01 23:59:13 +04:00
|
|
|
*/
|
1998-11-14 03:21:19 +03:00
|
|
|
NS_IMETHOD OnOverLink(nsIContent* aContent,
|
2002-11-20 03:44:26 +03:00
|
|
|
nsIURI* aURLSpec,
|
1998-08-15 03:08:54 +04:00
|
|
|
const PRUnichar* aTargetSpec) = 0;
|
1998-06-01 23:59:13 +04:00
|
|
|
|
2002-11-20 03:44:26 +03:00
|
|
|
/**
|
|
|
|
* Process the mouse leaving a link.
|
|
|
|
*/
|
|
|
|
NS_IMETHOD OnLeaveLink() = 0;
|
1998-04-14 00:24:54 +04:00
|
|
|
};
|
|
|
|
|
2005-11-11 17:36:26 +03:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsILinkHandler, NS_ILINKHANDLER_IID)
|
|
|
|
|
1998-04-14 00:24:54 +04:00
|
|
|
#endif /* nsILinkHandler_h___ */
|