Bug 767636 - Expose plugin fallback type to extensions. r=josh
[gecko.git] / layout / forms / nsMeterFrame.h
blobad853dd2e6a805815460978d718cc831396862ab
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsMeterFrame_h___
7 #define nsMeterFrame_h___
9 #include "nsContainerFrame.h"
10 #include "nsIAnonymousContentCreator.h"
11 #include "nsCOMPtr.h"
13 class nsMeterFrame : public nsContainerFrame,
14 public nsIAnonymousContentCreator
17 public:
18 NS_DECL_QUERYFRAME_TARGET(nsMeterFrame)
19 NS_DECL_QUERYFRAME
20 NS_DECL_FRAMEARENA_HELPERS
22 nsMeterFrame(nsStyleContext* aContext);
23 virtual ~nsMeterFrame();
25 virtual void DestroyFrom(nsIFrame* aDestructRoot);
27 NS_IMETHOD Reflow(nsPresContext* aCX,
28 nsHTMLReflowMetrics& aDesiredSize,
29 const nsHTMLReflowState& aReflowState,
30 nsReflowStatus& aStatus);
32 #ifdef DEBUG
33 NS_IMETHOD GetFrameName(nsAString& aResult) const {
34 return MakeFrameName(NS_LITERAL_STRING("Meter"), aResult);
36 #endif
38 virtual bool IsLeaf() const { return true; }
40 // nsIAnonymousContentCreator
41 virtual nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements);
42 virtual void AppendAnonymousContentTo(nsBaseContentList& aElements,
43 PRUint32 aFilter);
45 NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
46 nsIAtom* aAttribute,
47 PRInt32 aModType);
49 virtual nsSize ComputeAutoSize(nsRenderingContext *aRenderingContext,
50 nsSize aCBSize, nscoord aAvailableWidth,
51 nsSize aMargin, nsSize aBorder,
52 nsSize aPadding, bool aShrinkWrap);
54 virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext);
55 virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext);
57 virtual bool IsFrameOfType(PRUint32 aFlags) const
59 return nsContainerFrame::IsFrameOfType(aFlags &
60 ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
63 /**
64 * Returns whether the frame and its child should use the native style.
66 bool ShouldUseNativeStyle() const;
68 protected:
69 // Helper function which reflow the anonymous div frame.
70 void ReflowBarFrame(nsIFrame* aBarFrame,
71 nsPresContext* aPresContext,
72 const nsHTMLReflowState& aReflowState,
73 nsReflowStatus& aStatus);
74 /**
75 * The div used to show the meter bar.
76 * @see nsMeterFrame::CreateAnonymousContent
78 nsCOMPtr<nsIContent> mBarDiv;
81 #endif