2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 14:30:37 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
1999-01-09 00:18:08 +00:00
|
|
|
*
|
2004-04-18 14:30:37 +00: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/
|
1999-01-09 00:18:08 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00: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.
|
1999-01-09 00:18:08 +00:00
|
|
|
*
|
1999-11-06 03:40:37 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-18 14:30:37 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-28 20:14:13 +00:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 03:40:37 +00:00
|
|
|
*
|
2001-09-28 20:14:13 +00:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 14:30:37 +00: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-28 20:14:13 +00: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-18 14:30:37 +00:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-28 20:14:13 +00: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-18 14:30:37 +00:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-28 20:14:13 +00:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2006-03-29 18:29:03 +00:00
|
|
|
|
|
|
|
/* code for HTML client-side image maps */
|
|
|
|
|
1999-01-09 00:18:08 +00:00
|
|
|
#ifndef nsImageMap_h___
|
|
|
|
#define nsImageMap_h___
|
|
|
|
|
|
|
|
#include "nsISupports.h"
|
|
|
|
#include "nsCoord.h"
|
|
|
|
#include "nsVoidArray.h"
|
2006-07-02 07:23:10 +00:00
|
|
|
#include "nsStubMutationObserver.h"
|
massive landing of joki changes.
Relevant nsbeta3+ bugs 43309, 44503, 2634, 2504,5981, 24698, 25758, 33577,
36062, 36217, 41191, 41491, 42356, 42829, 43016
r=saari (joki code). also been tested by heikki and bryner
2000-08-08 21:31:05 +00:00
|
|
|
#include "nsIDOMFocusListener.h"
|
|
|
|
#include "nsIFrame.h"
|
2002-08-17 01:46:58 +00:00
|
|
|
#include "nsIImageMap.h"
|
1999-01-09 00:18:08 +00:00
|
|
|
|
|
|
|
class nsIDOMHTMLAreaElement;
|
|
|
|
class nsIDOMHTMLMapElement;
|
2004-07-31 23:15:21 +00:00
|
|
|
class nsPresContext;
|
1999-01-09 00:18:08 +00:00
|
|
|
class nsIRenderingContext;
|
1999-06-23 03:29:44 +00:00
|
|
|
class nsIURI;
|
1999-01-09 00:18:08 +00:00
|
|
|
class nsString;
|
massive landing of joki changes.
Relevant nsbeta3+ bugs 43309, 44503, 2634, 2504,5981, 24698, 25758, 33577,
36062, 36217, 41191, 41491, 42356, 42829, 43016
r=saari (joki code). also been tested by heikki and bryner
2000-08-08 21:31:05 +00:00
|
|
|
class nsIDOMEvent;
|
1999-01-09 00:18:08 +00:00
|
|
|
|
2006-07-02 07:23:10 +00:00
|
|
|
class nsImageMap : public nsStubMutationObserver, public nsIDOMFocusListener,
|
2002-08-17 01:46:58 +00:00
|
|
|
public nsIImageMap
|
1999-01-09 00:18:08 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsImageMap();
|
|
|
|
|
2000-08-18 06:27:42 +00:00
|
|
|
nsresult Init(nsIPresShell* aPresShell, nsIFrame* aImageFrame, nsIDOMHTMLMapElement* aMap);
|
1999-01-09 00:18:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* See if the given aX,aY <b>pixel</b> coordinates are in the image
|
2004-02-20 19:00:43 +00:00
|
|
|
* map. If they are then PR_TRUE is returned and aContent points to the
|
|
|
|
* found area. If the coordinates are not in the map then PR_FALSE
|
2002-11-28 23:02:31 +00:00
|
|
|
* is returned.
|
1999-01-09 00:18:08 +00:00
|
|
|
*/
|
|
|
|
PRBool IsInside(nscoord aX, nscoord aY,
|
2004-02-20 19:00:43 +00:00
|
|
|
nsIContent** aContent) const;
|
1999-01-09 00:18:08 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
void Draw(nsPresContext* aCX, nsIRenderingContext& aRC);
|
2000-08-12 00:38:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called just before the nsImageFrame releases us.
|
|
|
|
* Used to break the cycle caused by the DOM listener.
|
|
|
|
*/
|
|
|
|
void Destroy(void);
|
|
|
|
|
1999-01-09 00:18:08 +00:00
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
2006-07-02 07:23:10 +00:00
|
|
|
// nsIMutationObserver
|
2007-07-12 20:05:45 +00:00
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
|
|
|
|
NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
|
1999-01-09 00:18:08 +00:00
|
|
|
|
massive landing of joki changes.
Relevant nsbeta3+ bugs 43309, 44503, 2634, 2504,5981, 24698, 25758, 33577,
36062, 36217, 41191, 41491, 42356, 42829, 43016
r=saari (joki code). also been tested by heikki and bryner
2000-08-08 21:31:05 +00:00
|
|
|
//nsIDOMFocusListener
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 17:42:36 +00:00
|
|
|
NS_IMETHOD Focus(nsIDOMEvent* aEvent);
|
|
|
|
NS_IMETHOD Blur(nsIDOMEvent* aEvent);
|
|
|
|
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent);
|
massive landing of joki changes.
Relevant nsbeta3+ bugs 43309, 44503, 2634, 2504,5981, 24698, 25758, 33577,
36062, 36217, 41191, 41491, 42356, 42829, 43016
r=saari (joki code). also been tested by heikki and bryner
2000-08-08 21:31:05 +00:00
|
|
|
|
2002-08-17 01:46:58 +00:00
|
|
|
//nsIImageMap
|
|
|
|
NS_IMETHOD GetBoundsForAreaContent(nsIContent *aContent,
|
2004-07-31 23:15:21 +00:00
|
|
|
nsPresContext* aPresContext,
|
2002-08-17 01:46:58 +00:00
|
|
|
nsRect& aBounds);
|
|
|
|
|
1999-01-09 00:18:08 +00:00
|
|
|
protected:
|
1999-02-12 17:45:58 +00:00
|
|
|
virtual ~nsImageMap();
|
1999-01-09 00:18:08 +00:00
|
|
|
|
|
|
|
void FreeAreas();
|
|
|
|
|
|
|
|
nsresult UpdateAreas();
|
2005-11-10 15:51:10 +00:00
|
|
|
nsresult SearchForAreas(nsIContent* aParent, PRBool& aFoundArea,
|
|
|
|
PRBool& aFoundAnchor);
|
1999-01-09 00:18:08 +00:00
|
|
|
|
1999-03-01 16:57:35 +00:00
|
|
|
nsresult AddArea(nsIContent* aArea);
|
massive landing of joki changes.
Relevant nsbeta3+ bugs 43309, 44503, 2634, 2504,5981, 24698, 25758, 33577,
36062, 36217, 41191, 41491, 42356, 42829, 43016
r=saari (joki code). also been tested by heikki and bryner
2000-08-08 21:31:05 +00:00
|
|
|
|
|
|
|
nsresult ChangeFocus(nsIDOMEvent* aEvent, PRBool aFocus);
|
1999-01-09 00:18:08 +00:00
|
|
|
|
2004-01-24 00:46:17 +00:00
|
|
|
void MaybeUpdateAreas(nsIContent *aContent);
|
|
|
|
|
2000-08-18 06:27:42 +00:00
|
|
|
nsIPresShell* mPresShell; // WEAK - owns the frame that owns us
|
|
|
|
nsIFrame* mImageFrame; // the frame that owns us
|
2005-01-12 19:45:38 +00:00
|
|
|
nsCOMPtr<nsIContent> mMap;
|
2001-09-06 21:11:44 +00:00
|
|
|
nsAutoVoidArray mAreas; // almost always has some entries
|
1999-03-01 16:57:35 +00:00
|
|
|
PRBool mContainsBlockContents;
|
1999-01-09 00:18:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsImageMap_h___ */
|