layout/forms/nsFormControlFrame.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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 nsFormControlFrame_h___
michael@0 7 #define nsFormControlFrame_h___
michael@0 8
michael@0 9 #include "mozilla/Attributes.h"
michael@0 10 #include "nsIFormControlFrame.h"
michael@0 11 #include "nsLeafFrame.h"
michael@0 12
michael@0 13 /**
michael@0 14 * nsFormControlFrame is the base class for radio buttons and
michael@0 15 * checkboxes. It also has two static methods (RegUnRegAccessKey and
michael@0 16 * GetScreenHeight) that are used by other form controls.
michael@0 17 */
michael@0 18 class nsFormControlFrame : public nsLeafFrame,
michael@0 19 public nsIFormControlFrame
michael@0 20 {
michael@0 21 public:
michael@0 22 /**
michael@0 23 * Main constructor
michael@0 24 * @param aContent the content representing this frame
michael@0 25 * @param aParentFrame the parent frame
michael@0 26 */
michael@0 27 nsFormControlFrame(nsStyleContext*);
michael@0 28
michael@0 29 virtual nsIAtom* GetType() const MOZ_OVERRIDE;
michael@0 30
michael@0 31 virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
michael@0 32 {
michael@0 33 return nsLeafFrame::IsFrameOfType(aFlags &
michael@0 34 ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
michael@0 35 }
michael@0 36
michael@0 37 NS_DECL_QUERYFRAME
michael@0 38 NS_DECL_FRAMEARENA_HELPERS
michael@0 39
michael@0 40 /**
michael@0 41 * Respond to a gui event
michael@0 42 * @see nsIFrame::HandleEvent
michael@0 43 */
michael@0 44 virtual nsresult HandleEvent(nsPresContext* aPresContext,
michael@0 45 mozilla::WidgetGUIEvent* aEvent,
michael@0 46 nsEventStatus* aEventStatus) MOZ_OVERRIDE;
michael@0 47
michael@0 48 virtual nscoord GetBaseline() const MOZ_OVERRIDE;
michael@0 49
michael@0 50 /**
michael@0 51 * Respond to the request to resize and/or reflow
michael@0 52 * @see nsIFrame::Reflow
michael@0 53 */
michael@0 54 virtual nsresult Reflow(nsPresContext* aCX,
michael@0 55 nsHTMLReflowMetrics& aDesiredSize,
michael@0 56 const nsHTMLReflowState& aReflowState,
michael@0 57 nsReflowStatus& aStatus) MOZ_OVERRIDE;
michael@0 58
michael@0 59 virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
michael@0 60
michael@0 61 // new behavior
michael@0 62
michael@0 63 virtual void SetFocus(bool aOn = true, bool aRepaint = false) MOZ_OVERRIDE;
michael@0 64
michael@0 65 // nsIFormControlFrame
michael@0 66 virtual nsresult SetFormProperty(nsIAtom* aName, const nsAString& aValue) MOZ_OVERRIDE;
michael@0 67
michael@0 68 // AccessKey Helper function
michael@0 69 static nsresult RegUnRegAccessKey(nsIFrame * aFrame, bool aDoReg);
michael@0 70
michael@0 71 /**
michael@0 72 * Returns the usable screen rect in app units, eg the rect where we can
michael@0 73 * draw dropdowns.
michael@0 74 */
michael@0 75 static nsRect GetUsableScreenRect(nsPresContext* aPresContext);
michael@0 76
michael@0 77 protected:
michael@0 78
michael@0 79 virtual ~nsFormControlFrame();
michael@0 80
michael@0 81 virtual nscoord GetIntrinsicWidth() MOZ_OVERRIDE;
michael@0 82 virtual nscoord GetIntrinsicHeight() MOZ_OVERRIDE;
michael@0 83
michael@0 84 //
michael@0 85 //-------------------------------------------------------------------------------------
michael@0 86 // Utility methods for managing checkboxes and radiobuttons
michael@0 87 //-------------------------------------------------------------------------------------
michael@0 88 //
michael@0 89 /**
michael@0 90 * Get the state of the checked attribute.
michael@0 91 * @param aState set to true if the checked attribute is set,
michael@0 92 * false if the checked attribute has been removed
michael@0 93 */
michael@0 94
michael@0 95 void GetCurrentCheckState(bool* aState);
michael@0 96 };
michael@0 97
michael@0 98 #endif
michael@0 99

mercurial