Bug 461269 - Remove TOK_RP nodes from the parse tree. r=brendan.
[mozilla-central.git] / layout / generic / nsHTMLCanvasFrame.h
blob8b0d49496f3ed0422201afa4c81b26eb65204fcc
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Vladimir Vukicevic <vladimir@pobox.com>
19 * Portions created by the Initial Developer are Copyright (C) 2005
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 /* rendering object for the HTML <canvas> element */
40 #ifndef nsHTMLCanvasFrame_h___
41 #define nsHTMLCanvasFrame_h___
43 #include "nsSplittableFrame.h"
44 #include "nsString.h"
45 #include "nsAString.h"
46 #include "nsPresContext.h"
47 #include "nsIIOService.h"
49 nsIFrame* NS_NewHTMLCanvasFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
51 class nsHTMLCanvasFrame : public nsSplittableFrame
53 public:
54 nsHTMLCanvasFrame(nsStyleContext* aContext) : nsSplittableFrame(aContext) {}
56 NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
57 const nsRect& aDirtyRect,
58 const nsDisplayListSet& aLists);
60 void PaintCanvas(nsIRenderingContext& aRenderingContext,
61 const nsRect& aDirtyRect, nsPoint aPt);
63 /* get the size of the canvas's image */
64 nsIntSize GetCanvasSize();
66 virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext);
67 virtual nscoord GetPrefWidth(nsIRenderingContext *aRenderingContext);
68 virtual nsSize GetIntrinsicRatio();
70 virtual nsSize ComputeSize(nsIRenderingContext *aRenderingContext,
71 nsSize aCBSize, nscoord aAvailableWidth,
72 nsSize aMargin, nsSize aBorder, nsSize aPadding,
73 PRBool aShrinkWrap);
75 NS_IMETHOD Reflow(nsPresContext* aPresContext,
76 nsHTMLReflowMetrics& aDesiredSize,
77 const nsHTMLReflowState& aReflowState,
78 nsReflowStatus& aStatus);
80 NS_IMETHOD GetContentForEvent(nsPresContext* aPresContext,
81 nsEvent* aEvent,
82 nsIContent** aContent);
84 nsRect GetInnerArea() const;
86 #ifdef ACCESSIBILITY
87 NS_IMETHOD GetAccessible(nsIAccessible** aAccessible);
88 #endif
90 virtual nsIAtom* GetType() const;
92 virtual PRBool IsFrameOfType(PRUint32 aFlags) const
94 return nsSplittableFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced));
97 #ifdef DEBUG
98 NS_IMETHOD GetFrameName(nsAString& aResult) const;
99 NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
100 #endif
102 protected:
103 virtual ~nsHTMLCanvasFrame();
105 nscoord GetContinuationOffset(nscoord* aWidth = 0) const;
107 nsMargin mBorderPadding;
110 #endif /* nsHTMLCanvasFrame_h___ */