1999-04-14 01:50:25 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The contents of this file are subject to the Netscape 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/NPL/
|
1999-04-14 01:50:25 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03: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-04-14 01:50:25 +04:00
|
|
|
*
|
1999-11-06 06:40:37 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-04-14 01:50:25 +04:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:40:37 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-04-14 01:50:25 +04:00
|
|
|
*/
|
|
|
|
#ifndef nsImageFrame_h___
|
|
|
|
#define nsImageFrame_h___
|
|
|
|
|
|
|
|
#include "nsLeafFrame.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsIPresContext.h"
|
|
|
|
#include "nsHTMLImageLoader.h"
|
|
|
|
|
|
|
|
class nsIFrame;
|
|
|
|
class nsImageMap;
|
|
|
|
class nsIImage;
|
1999-06-23 07:29:44 +04:00
|
|
|
class nsIURI;
|
1999-04-14 01:50:25 +04:00
|
|
|
struct nsHTMLReflowState;
|
|
|
|
struct nsHTMLReflowMetrics;
|
|
|
|
struct nsSize;
|
|
|
|
|
|
|
|
#define ImageFrameSuper nsLeafFrame
|
|
|
|
|
|
|
|
class nsImageFrame : public ImageFrameSuper {
|
|
|
|
public:
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD Destroy(nsIPresContext* aPresContext);
|
|
|
|
NS_IMETHOD Init(nsIPresContext* aPresContext,
|
1999-04-14 01:50:25 +04:00
|
|
|
nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIStyleContext* aContext,
|
|
|
|
nsIFrame* aPrevInFlow);
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD Paint(nsIPresContext* aPresContext,
|
1999-04-14 01:50:25 +04:00
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
nsFramePaintLayer aWhichLayer);
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_IMETHOD Reflow(nsIPresContext* aPresContext,
|
1999-04-14 01:50:25 +04:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus);
|
2000-02-11 04:24:59 +03:00
|
|
|
NS_IMETHOD GetContentForEvent(nsIPresContext* aPresContext,
|
|
|
|
nsEvent* aEvent,
|
|
|
|
nsIContent** aContent);
|
1999-11-24 09:03:41 +03:00
|
|
|
NS_METHOD HandleEvent(nsIPresContext* aPresContext,
|
1999-04-14 01:50:25 +04:00
|
|
|
nsGUIEvent* aEvent,
|
1999-11-24 09:03:41 +03:00
|
|
|
nsEventStatus* aEventStatus);
|
|
|
|
NS_IMETHOD GetCursor(nsIPresContext* aPresContext,
|
1999-04-14 01:50:25 +04:00
|
|
|
nsPoint& aPoint,
|
|
|
|
PRInt32& aCursor);
|
|
|
|
NS_IMETHOD AttributeChanged(nsIPresContext* aPresContext,
|
|
|
|
nsIContent* aChild,
|
1999-10-16 03:16:45 +04:00
|
|
|
PRInt32 aNameSpaceID,
|
1999-04-14 01:50:25 +04:00
|
|
|
nsIAtom* aAttribute,
|
|
|
|
PRInt32 aHint);
|
1999-08-31 07:09:40 +04:00
|
|
|
NS_IMETHOD GetFrameType(nsIAtom** aResult) const;
|
2000-01-04 06:06:13 +03:00
|
|
|
NS_IMETHOD GetIntrinsicImageSize(nsSize& aSize);
|
2000-01-07 02:41:14 +03:00
|
|
|
NS_IMETHOD IsImageComplete(PRBool* aComplete);
|
2000-01-04 06:06:13 +03:00
|
|
|
|
1999-09-01 05:02:16 +04:00
|
|
|
#ifdef DEBUG
|
1999-08-31 07:09:40 +04:00
|
|
|
NS_IMETHOD SizeOf(nsISizeOfHandler* aHandler, PRUint32* aResult) const;
|
1999-09-01 05:02:16 +04:00
|
|
|
#endif
|
1999-04-14 01:50:25 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~nsImageFrame();
|
|
|
|
|
|
|
|
virtual void GetDesiredSize(nsIPresContext* aPresContext,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize);
|
|
|
|
|
|
|
|
nsresult UpdateImage(nsIPresContext* aPresContext, PRUint32 aStatus);
|
|
|
|
|
|
|
|
nsImageMap* GetImageMap();
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
void TriggerLink(nsIPresContext* aPresContext,
|
1999-04-14 01:50:25 +04:00
|
|
|
const nsString& aURLSpec,
|
|
|
|
const nsString& aTargetSpec,
|
|
|
|
PRBool aClick);
|
|
|
|
|
|
|
|
PRBool IsServerImageMap();
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
void TranslateEventCoords(nsIPresContext* aPresContext,
|
1999-07-08 23:38:08 +04:00
|
|
|
const nsPoint& aPoint,
|
|
|
|
nsPoint& aResult);
|
|
|
|
|
1999-07-08 23:44:42 +04:00
|
|
|
PRBool GetAnchorHREF(nsString& aResult);
|
1999-07-08 23:38:08 +04:00
|
|
|
|
1999-04-14 01:50:25 +04:00
|
|
|
PRIntn GetSuppress();
|
|
|
|
|
|
|
|
void MeasureString(const PRUnichar* aString,
|
|
|
|
PRInt32 aLength,
|
|
|
|
nscoord aMaxWidth,
|
|
|
|
PRUint32& aMaxFit,
|
|
|
|
nsIRenderingContext& aContext);
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
void DisplayAltText(nsIPresContext* aPresContext,
|
1999-04-14 01:50:25 +04:00
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
const nsString& aAltText,
|
|
|
|
const nsRect& aRect);
|
|
|
|
|
1999-11-24 09:03:41 +03:00
|
|
|
void DisplayAltFeedback(nsIPresContext* aPresContext,
|
1999-04-14 01:50:25 +04:00
|
|
|
nsIRenderingContext& aRenderingContext,
|
|
|
|
PRInt32 aIconId);
|
|
|
|
|
|
|
|
void GetInnerArea(nsIPresContext* aPresContext,
|
|
|
|
nsRect& aInnerArea) const;
|
|
|
|
|
|
|
|
static nsresult UpdateImageFrame(nsIPresContext* aPresContext,
|
|
|
|
nsHTMLImageLoader* aLoader,
|
|
|
|
nsIFrame* aFrame,
|
|
|
|
void* aClosure,
|
|
|
|
PRUint32 aStatus);
|
|
|
|
|
|
|
|
nsHTMLImageLoader mImageLoader;
|
|
|
|
nsImageMap* mImageMap;
|
2000-04-01 04:13:51 +04:00
|
|
|
PRPackedBool mSizeFrozen;
|
|
|
|
PRPackedBool mInitialLoadCompleted;
|
1999-04-14 01:50:25 +04:00
|
|
|
nsMargin mBorderPadding;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsImageFrame_h___ */
|