/src/mozilla-central/dom/flex/FlexLine.h
Line | Count | Source (jump to first uncovered line) |
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 mozilla_dom_FlexLine_h |
8 | | #define mozilla_dom_FlexLine_h |
9 | | |
10 | | #include "mozilla/dom/FlexBinding.h" |
11 | | #include "nsISupports.h" |
12 | | #include "nsWrapperCache.h" |
13 | | |
14 | | struct ComputedFlexLineInfo; |
15 | | |
16 | | namespace mozilla { |
17 | | namespace dom { |
18 | | |
19 | | class Flex; |
20 | | class FlexItem; |
21 | | |
22 | | class FlexLine : public nsISupports |
23 | | , public nsWrapperCache |
24 | | { |
25 | | public: |
26 | | explicit FlexLine(Flex* aParent, |
27 | | const ComputedFlexLineInfo* aLine); |
28 | | |
29 | | protected: |
30 | 0 | virtual ~FlexLine() = default; |
31 | | |
32 | | public: |
33 | | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
34 | | NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FlexLine) |
35 | | |
36 | | virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; |
37 | | Flex* GetParentObject() |
38 | | { |
39 | | return mParent; |
40 | | } |
41 | | |
42 | | FlexLineGrowthState GrowthState() const; |
43 | | double CrossStart() const; |
44 | | double CrossSize() const; |
45 | | double FirstBaselineOffset() const; |
46 | | double LastBaselineOffset() const; |
47 | | |
48 | | void GetItems(nsTArray<RefPtr<FlexItem>>& aResult); |
49 | | |
50 | | protected: |
51 | | RefPtr<Flex> mParent; |
52 | | |
53 | | FlexLineGrowthState mGrowthState; |
54 | | double mCrossStart; |
55 | | double mCrossSize; |
56 | | double mFirstBaselineOffset; |
57 | | double mLastBaselineOffset; |
58 | | |
59 | | nsTArray<RefPtr<FlexItem>> mItems; |
60 | | }; |
61 | | |
62 | | } // namespace dom |
63 | | } // namespace mozilla |
64 | | |
65 | | #endif /* mozilla_dom_FlexLine_h */ |