nsRubyTextFrame.h (1759B)
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 /* rendering object for CSS "display: ruby-text" */ 8 9 #ifndef nsRubyTextFrame_h___ 10 #define nsRubyTextFrame_h___ 11 12 #include "nsRubyContentFrame.h" 13 14 namespace mozilla { 15 class PresShell; 16 } // namespace mozilla 17 18 /** 19 * Factory function. 20 * @return a newly allocated nsRubyTextFrame (infallible) 21 */ 22 nsContainerFrame* NS_NewRubyTextFrame(mozilla::PresShell* aPresShell, 23 mozilla::ComputedStyle* aStyle); 24 25 class nsRubyTextFrame final : public nsRubyContentFrame { 26 public: 27 NS_DECL_FRAMEARENA_HELPERS(nsRubyTextFrame) 28 NS_DECL_QUERYFRAME 29 30 bool CanContinueTextRun() const override; 31 32 #ifdef DEBUG_FRAME_DUMP 33 nsresult GetFrameName(nsAString& aResult) const override; 34 #endif 35 36 void BuildDisplayList(nsDisplayListBuilder* aBuilder, 37 const nsDisplayListSet& aLists) override; 38 39 void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize, 40 const ReflowInput& aReflowInput, 41 nsReflowStatus& aStatus) override; 42 43 bool IsCollapsed() const { 44 return HasAnyStateBits(NS_RUBY_TEXT_FRAME_COLLAPSED); 45 } 46 47 protected: 48 friend nsContainerFrame* NS_NewRubyTextFrame(mozilla::PresShell* aPresShell, 49 ComputedStyle* aStyle); 50 explicit nsRubyTextFrame(ComputedStyle* aStyle, nsPresContext* aPresContext) 51 : nsRubyContentFrame(aStyle, aPresContext, kClassID) {} 52 }; 53 54 #endif /* nsRubyTextFrame_h___ */