nsLeafFrame.h (1844B)
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 /* base class for rendering objects that do not have child lists */ 8 9 #ifndef nsLeafFrame_h___ 10 #define nsLeafFrame_h___ 11 12 #include "nsDisplayList.h" 13 #include "nsIFrame.h" 14 15 /** 16 * Abstract class that provides simple fixed-size layout for leaf objects. 17 */ 18 class nsLeafFrame : public nsIFrame { 19 public: 20 NS_DECL_ABSTRACT_FRAME(nsLeafFrame) 21 22 // nsIFrame replacements 23 void BuildDisplayList(nsDisplayListBuilder* aBuilder, 24 const nsDisplayListSet& aLists) override; 25 26 nscoord IntrinsicISize(const mozilla::IntrinsicSizeInput& aInput, 27 mozilla::IntrinsicISizeType aType) override; 28 29 /** 30 * Our auto size is just the intrinsic size. 31 */ 32 mozilla::LogicalSize ComputeAutoSize( 33 const SizeComputationInput& aSizingInput, mozilla::WritingMode aWM, 34 const mozilla::LogicalSize& aCBSize, nscoord aAvailableISize, 35 const mozilla::LogicalSize& aMargin, 36 const mozilla::LogicalSize& aBorderPadding, 37 const mozilla::StyleSizeOverrides& aSizeOverrides, 38 mozilla::ComputeSizeFlags aFlags) override; 39 40 /** 41 * Each of our subclasses should provide its own Reflow impl: 42 */ 43 void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize, 44 const ReflowInput& aReflowInput, 45 nsReflowStatus& aStatus) override = 0; 46 47 protected: 48 nsLeafFrame(ComputedStyle* aStyle, nsPresContext* aPresContext, ClassID aID) 49 : nsIFrame(aStyle, aPresContext, aID) {} 50 51 virtual ~nsLeafFrame(); 52 }; 53 54 #endif /* nsLeafFrame_h___ */