2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-04-21 22:46:15 +00:00
|
|
|
|
|
|
|
#ifndef nsHTMLButtonControlFrame_h___
|
|
|
|
#define nsHTMLButtonControlFrame_h___
|
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
1999-04-21 22:46:15 +00:00
|
|
|
#include "nsCOMPtr.h"
|
2011-12-27 20:18:48 +00:00
|
|
|
#include "nsContainerFrame.h"
|
1999-04-21 22:46:15 +00:00
|
|
|
#include "nsIFormControlFrame.h"
|
|
|
|
#include "nsHTMLParts.h"
|
|
|
|
|
2003-02-22 00:32:13 +00:00
|
|
|
#include "nsStyleContext.h"
|
1999-04-21 22:46:15 +00:00
|
|
|
#include "nsLeafFrame.h"
|
|
|
|
#include "nsCSSRendering.h"
|
|
|
|
#include "nsISupports.h"
|
|
|
|
#include "nsStyleConsts.h"
|
|
|
|
#include "nsIComponentManager.h"
|
|
|
|
#include "nsButtonFrameRenderer.h"
|
|
|
|
|
2011-04-08 01:04:40 +00:00
|
|
|
class nsRenderingContext;
|
2010-04-10 20:10:12 +00:00
|
|
|
class nsPresContext;
|
2004-10-14 18:48:42 +00:00
|
|
|
|
2011-12-27 20:18:48 +00:00
|
|
|
class nsHTMLButtonControlFrame : public nsContainerFrame,
|
1999-04-21 22:46:15 +00:00
|
|
|
public nsIFormControlFrame
|
|
|
|
{
|
|
|
|
public:
|
2006-03-26 21:30:36 +00:00
|
|
|
nsHTMLButtonControlFrame(nsStyleContext* aContext);
|
1999-11-04 23:16:47 +00:00
|
|
|
~nsHTMLButtonControlFrame();
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2009-01-12 19:20:59 +00:00
|
|
|
NS_DECL_QUERYFRAME
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2006-01-26 02:29:17 +00:00
|
|
|
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
2012-09-14 16:10:08 +00:00
|
|
|
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 05:38:33 +00:00
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext) MOZ_OVERRIDE;
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 05:38:33 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD Reflow(nsPresContext* aPresContext,
|
1999-04-21 22:46:15 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
2012-09-14 16:10:08 +00:00
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2004-07-31 23:15:21 +00:00
|
|
|
NS_IMETHOD HandleEvent(nsPresContext* aPresContext,
|
1999-04-21 22:46:15 +00:00
|
|
|
nsGUIEvent* aEvent,
|
2012-09-14 16:10:08 +00:00
|
|
|
nsEventStatus* aEventStatus) MOZ_OVERRIDE;
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2006-03-09 18:55:21 +00:00
|
|
|
NS_IMETHOD Init(nsIContent* aContent,
|
1999-04-21 22:46:15 +00:00
|
|
|
nsIFrame* aParent,
|
2012-09-14 16:10:08 +00:00
|
|
|
nsIFrame* asPrevInFlow) MOZ_OVERRIDE;
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual nsStyleContext* GetAdditionalStyleContext(int32_t aIndex) const;
|
|
|
|
virtual void SetAdditionalStyleContext(int32_t aIndex,
|
2012-09-14 16:10:08 +00:00
|
|
|
nsStyleContext* aStyleContext) MOZ_OVERRIDE;
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2011-08-24 20:54:30 +00:00
|
|
|
NS_IMETHOD AppendFrames(ChildListID aListID,
|
2012-09-14 16:10:08 +00:00
|
|
|
nsFrameList& aFrameList) MOZ_OVERRIDE;
|
2003-11-18 02:12:24 +00:00
|
|
|
|
2011-08-24 20:54:30 +00:00
|
|
|
NS_IMETHOD InsertFrames(ChildListID aListID,
|
2003-11-18 02:12:24 +00:00
|
|
|
nsIFrame* aPrevFrame,
|
2012-09-14 16:10:08 +00:00
|
|
|
nsFrameList& aFrameList) MOZ_OVERRIDE;
|
2003-11-18 02:12:24 +00:00
|
|
|
|
2011-08-24 20:54:30 +00:00
|
|
|
NS_IMETHOD RemoveFrame(ChildListID aListID,
|
2012-09-14 16:10:08 +00:00
|
|
|
nsIFrame* aOldFrame) MOZ_OVERRIDE;
|
2003-11-18 02:12:24 +00:00
|
|
|
|
2001-08-17 03:13:07 +00:00
|
|
|
#ifdef ACCESSIBILITY
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual already_AddRefed<Accessible> CreateAccessible() MOZ_OVERRIDE;
|
2001-08-17 03:13:07 +00:00
|
|
|
#endif
|
2001-05-17 23:52:32 +00:00
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
2006-04-25 19:56:45 +00:00
|
|
|
|
1999-11-01 22:12:45 +00:00
|
|
|
#ifdef DEBUG
|
2012-09-14 16:10:08 +00:00
|
|
|
NS_IMETHOD GetFrameName(nsAString& aResult) const MOZ_OVERRIDE {
|
2006-04-25 19:56:45 +00:00
|
|
|
return MakeFrameName(NS_LITERAL_STRING("HTMLButtonControl"), aResult);
|
1999-04-21 22:46:15 +00:00
|
|
|
}
|
1999-11-01 22:12:45 +00:00
|
|
|
#endif
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual bool HonorPrintBackgroundSettings() { return false; }
|
2009-05-28 05:01:42 +00:00
|
|
|
|
2002-09-16 06:23:52 +00:00
|
|
|
// nsIFormControlFrame
|
2011-09-29 06:19:26 +00:00
|
|
|
void SetFocus(bool aOn, bool aRepaint);
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual nsresult SetFormProperty(nsIAtom* aName, const nsAString& aValue) MOZ_OVERRIDE;
|
|
|
|
virtual nsresult GetFormProperty(nsIAtom* aName, nsAString& aValue) const MOZ_OVERRIDE;
|
1999-04-21 22:46:15 +00:00
|
|
|
|
2005-03-07 19:08:26 +00:00
|
|
|
// Inserted child content gets its frames parented by our child block
|
|
|
|
virtual nsIFrame* GetContentInsertionFrame() {
|
2011-08-24 20:54:30 +00:00
|
|
|
return GetFirstPrincipalChild()->GetContentInsertionFrame();
|
2005-03-07 19:08:26 +00:00
|
|
|
}
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const
|
2007-02-24 18:33:33 +00:00
|
|
|
{
|
2011-12-27 20:18:48 +00:00
|
|
|
return nsContainerFrame::IsFrameOfType(aFlags &
|
2007-02-24 18:33:33 +00:00
|
|
|
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
|
|
|
|
}
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 05:38:33 +00:00
|
|
|
|
1999-04-21 22:46:15 +00:00
|
|
|
protected:
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual bool IsInput() { return false; }
|
2004-07-31 23:15:21 +00:00
|
|
|
void ReflowButtonContents(nsPresContext* aPresContext,
|
2003-02-22 19:48:29 +00:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsIFrame* aFirstKid,
|
|
|
|
nsMargin aFocusPadding,
|
|
|
|
nsReflowStatus& aStatus);
|
2006-01-13 07:58:12 +00:00
|
|
|
|
2012-08-09 07:09:40 +00:00
|
|
|
int GetSkipSides() const;
|
1999-04-21 22:46:15 +00:00
|
|
|
nsButtonFrameRenderer mRenderer;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|