layout/forms/nsHTMLButtonControlFrame.h

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef nsHTMLButtonControlFrame_h___
michael@0 7 #define nsHTMLButtonControlFrame_h___
michael@0 8
michael@0 9 #include "mozilla/Attributes.h"
michael@0 10 #include "nsContainerFrame.h"
michael@0 11 #include "nsIFormControlFrame.h"
michael@0 12 #include "nsButtonFrameRenderer.h"
michael@0 13
michael@0 14 class nsRenderingContext;
michael@0 15 class nsPresContext;
michael@0 16
michael@0 17 class nsHTMLButtonControlFrame : public nsContainerFrame,
michael@0 18 public nsIFormControlFrame
michael@0 19 {
michael@0 20 public:
michael@0 21 nsHTMLButtonControlFrame(nsStyleContext* aContext);
michael@0 22 ~nsHTMLButtonControlFrame();
michael@0 23
michael@0 24 virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
michael@0 25
michael@0 26 NS_DECL_QUERYFRAME
michael@0 27 NS_DECL_FRAMEARENA_HELPERS
michael@0 28
michael@0 29 virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
michael@0 30 const nsRect& aDirtyRect,
michael@0 31 const nsDisplayListSet& aLists) MOZ_OVERRIDE;
michael@0 32
michael@0 33 virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
michael@0 34
michael@0 35 virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
michael@0 36
michael@0 37 virtual nsresult Reflow(nsPresContext* aPresContext,
michael@0 38 nsHTMLReflowMetrics& aDesiredSize,
michael@0 39 const nsHTMLReflowState& aReflowState,
michael@0 40 nsReflowStatus& aStatus) MOZ_OVERRIDE;
michael@0 41
michael@0 42 virtual nsresult HandleEvent(nsPresContext* aPresContext,
michael@0 43 mozilla::WidgetGUIEvent* aEvent,
michael@0 44 nsEventStatus* aEventStatus) MOZ_OVERRIDE;
michael@0 45
michael@0 46 virtual void Init(nsIContent* aContent,
michael@0 47 nsIFrame* aParent,
michael@0 48 nsIFrame* asPrevInFlow) MOZ_OVERRIDE;
michael@0 49
michael@0 50 virtual nsStyleContext* GetAdditionalStyleContext(int32_t aIndex) const MOZ_OVERRIDE;
michael@0 51 virtual void SetAdditionalStyleContext(int32_t aIndex,
michael@0 52 nsStyleContext* aStyleContext) MOZ_OVERRIDE;
michael@0 53
michael@0 54 virtual nsresult AppendFrames(ChildListID aListID,
michael@0 55 nsFrameList& aFrameList) MOZ_OVERRIDE;
michael@0 56
michael@0 57 virtual nsresult InsertFrames(ChildListID aListID,
michael@0 58 nsIFrame* aPrevFrame,
michael@0 59 nsFrameList& aFrameList) MOZ_OVERRIDE;
michael@0 60
michael@0 61 virtual nsresult RemoveFrame(ChildListID aListID,
michael@0 62 nsIFrame* aOldFrame) MOZ_OVERRIDE;
michael@0 63
michael@0 64 #ifdef ACCESSIBILITY
michael@0 65 virtual mozilla::a11y::AccType AccessibleType() MOZ_OVERRIDE;
michael@0 66 #endif
michael@0 67
michael@0 68 virtual nsIAtom* GetType() const MOZ_OVERRIDE;
michael@0 69
michael@0 70 #ifdef DEBUG_FRAME_DUMP
michael@0 71 virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE {
michael@0 72 return MakeFrameName(NS_LITERAL_STRING("HTMLButtonControl"), aResult);
michael@0 73 }
michael@0 74 #endif
michael@0 75
michael@0 76 virtual bool HonorPrintBackgroundSettings() MOZ_OVERRIDE { return false; }
michael@0 77
michael@0 78 // nsIFormControlFrame
michael@0 79 void SetFocus(bool aOn, bool aRepaint) MOZ_OVERRIDE;
michael@0 80 virtual nsresult SetFormProperty(nsIAtom* aName, const nsAString& aValue) MOZ_OVERRIDE;
michael@0 81
michael@0 82 // Inserted child content gets its frames parented by our child block
michael@0 83 virtual nsIFrame* GetContentInsertionFrame() MOZ_OVERRIDE {
michael@0 84 return GetFirstPrincipalChild()->GetContentInsertionFrame();
michael@0 85 }
michael@0 86
michael@0 87 virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
michael@0 88 {
michael@0 89 return nsContainerFrame::IsFrameOfType(aFlags &
michael@0 90 ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
michael@0 91 }
michael@0 92
michael@0 93 protected:
michael@0 94 virtual bool IsInput() { return false; }
michael@0 95 // Reflows the button's sole child frame, and computes the desired size
michael@0 96 // of the button itself from the results.
michael@0 97 void ReflowButtonContents(nsPresContext* aPresContext,
michael@0 98 nsHTMLReflowMetrics& aButtonDesiredSize,
michael@0 99 const nsHTMLReflowState& aButtonReflowState,
michael@0 100 nsIFrame* aFirstKid);
michael@0 101
michael@0 102 nsButtonFrameRenderer mRenderer;
michael@0 103 };
michael@0 104
michael@0 105 #endif
michael@0 106
michael@0 107
michael@0 108
michael@0 109

mercurial