nsCheckboxRadioFrame.h (2335B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef nsCheckboxRadioFrame_h___ 8 #define nsCheckboxRadioFrame_h___ 9 10 #include "nsAtomicContainerFrame.h" 11 #include "nsDisplayList.h" 12 13 /** 14 * nsCheckboxRadioFrame is used for radio buttons and checkboxes. 15 */ 16 class nsCheckboxRadioFrame final : public nsAtomicContainerFrame { 17 public: 18 NS_DECL_QUERYFRAME 19 NS_DECL_FRAMEARENA_HELPERS(nsCheckboxRadioFrame) 20 21 explicit nsCheckboxRadioFrame(ComputedStyle* aStyle, 22 nsPresContext* aPresContext); 23 24 void BuildDisplayList(nsDisplayListBuilder* aBuilder, 25 const nsDisplayListSet& aLists) override; 26 27 nscoord IntrinsicISize(const mozilla::IntrinsicSizeInput& aInput, 28 mozilla::IntrinsicISizeType aType) override; 29 30 mozilla::LogicalSize ComputeAutoSize( 31 const SizeComputationInput& aSizingInput, mozilla::WritingMode aWM, 32 const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, 33 const mozilla::LogicalSize& aMargin, 34 const mozilla::LogicalSize& aBorderPadding, 35 const mozilla::StyleSizeOverrides& aSizeOverrides, 36 mozilla::ComputeSizeFlags aFlags) override; 37 38 /** 39 * Respond to a gui event 40 * @see nsIFrame::HandleEvent 41 */ 42 nsresult HandleEvent(nsPresContext* aPresContext, 43 mozilla::WidgetGUIEvent* aEvent, 44 nsEventStatus* aEventStatus) override; 45 46 Maybe<nscoord> GetNaturalBaselineBOffset( 47 mozilla::WritingMode aWM, BaselineSharingGroup aBaselineGroup, 48 BaselineExportContext) const override; 49 50 /** 51 * Respond to the request to resize and/or reflow 52 * @see nsIFrame::Reflow 53 */ 54 void Reflow(nsPresContext* aCX, ReflowOutput& aDesiredSize, 55 const ReflowInput& aReflowInput, 56 nsReflowStatus& aStatus) override; 57 58 #ifdef DEBUG_FRAME_DUMP 59 nsresult GetFrameName(nsAString& aResult) const override { 60 return MakeFrameName(u"CheckboxRadio"_ns, aResult); 61 } 62 #endif 63 64 protected: 65 virtual ~nsCheckboxRadioFrame(); 66 67 nscoord DefaultSize(); 68 }; 69 70 #endif