Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=2 et sw=2 tw=80: */
3 : /* This Source Code is subject to the terms of the Mozilla Public License
4 : * version 2.0 (the "License"). You can obtain a copy of the License at
5 : * http://mozilla.org/MPL/2.0/. */
6 :
7 : /* rendering object for CSS "display: ruby" */
8 :
9 : #ifndef nsRubyFrame_h___
10 : #define nsRubyFrame_h___
11 :
12 : #include "nsInlineFrame.h"
13 : #include "RubyUtils.h"
14 :
15 : /**
16 : * Factory function.
17 : * @return a newly allocated nsRubyFrame (infallible)
18 : */
19 : nsContainerFrame* NS_NewRubyFrame(nsIPresShell* aPresShell,
20 : nsStyleContext* aContext);
21 :
22 0 : class nsRubyFrame final : public nsInlineFrame
23 : {
24 : public:
25 0 : NS_DECL_FRAMEARENA_HELPERS(nsRubyFrame)
26 : NS_DECL_QUERYFRAME
27 :
28 : // nsIFrame overrides
29 : virtual bool IsFrameOfType(uint32_t aFlags) const override;
30 : virtual void AddInlineMinISize(gfxContext *aRenderingContext,
31 : InlineMinISizeData *aData) override;
32 : virtual void AddInlinePrefISize(gfxContext *aRenderingContext,
33 : InlinePrefISizeData *aData) override;
34 : virtual void Reflow(nsPresContext* aPresContext,
35 : ReflowOutput& aDesiredSize,
36 : const ReflowInput& aReflowInput,
37 : nsReflowStatus& aStatus) override;
38 :
39 : #ifdef DEBUG_FRAME_DUMP
40 : virtual nsresult GetFrameName(nsAString& aResult) const override;
41 : #endif
42 :
43 0 : mozilla::RubyBlockLeadings GetBlockLeadings() const {
44 0 : return mLeadings;
45 : }
46 :
47 : protected:
48 : friend nsContainerFrame* NS_NewRubyFrame(nsIPresShell* aPresShell,
49 : nsStyleContext* aContext);
50 0 : explicit nsRubyFrame(nsStyleContext* aContext)
51 0 : : nsInlineFrame(aContext, kClassID)
52 0 : {}
53 :
54 : void ReflowSegment(nsPresContext* aPresContext,
55 : const ReflowInput& aReflowInput,
56 : nsRubyBaseContainerFrame* aBaseContainer,
57 : nsReflowStatus& aStatus);
58 :
59 : nsRubyBaseContainerFrame* PullOneSegment(const nsLineLayout* aLineLayout,
60 : ContinuationTraversingState& aState);
61 :
62 : // The leadings required to put the annotations. They are dummy-
63 : // initialized to 0, and get meaningful values at first reflow.
64 : mozilla::RubyBlockLeadings mLeadings;
65 : };
66 :
67 : #endif /* nsRubyFrame_h___ */
|