Bug 1880216 - Migrate Fenix docs into Sphinx. r=owlish,geckoview-reviewers,android...
[gecko.git] / dom / flex / FlexLineValues.h
blob340af2e7e5bd982e6761def90283db977814988f
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/. */
7 #ifndef mozilla_dom_FlexLineValues_h
8 #define mozilla_dom_FlexLineValues_h
10 #include "mozilla/dom/FlexBinding.h"
11 #include "nsISupports.h"
12 #include "nsWrapperCache.h"
14 struct ComputedFlexLineInfo;
16 namespace mozilla::dom {
18 class Flex;
19 class FlexItemValues;
21 class FlexLineValues : public nsISupports, public nsWrapperCache {
22 public:
23 explicit FlexLineValues(Flex* aParent, const ComputedFlexLineInfo* aLine);
25 protected:
26 virtual ~FlexLineValues() = default;
28 public:
29 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
30 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FlexLineValues)
32 virtual JSObject* WrapObject(JSContext* aCx,
33 JS::Handle<JSObject*> aGivenProto) override;
34 Flex* GetParentObject() { return mParent; }
36 FlexLineGrowthState GrowthState() const;
37 double CrossStart() const;
38 double CrossSize() const;
39 double FirstBaselineOffset() const;
40 double LastBaselineOffset() const;
42 void GetItems(nsTArray<RefPtr<FlexItemValues>>& aResult);
44 protected:
45 RefPtr<Flex> mParent;
47 FlexLineGrowthState mGrowthState;
48 double mCrossStart;
49 double mCrossSize;
50 double mFirstBaselineOffset;
51 double mLastBaselineOffset;
53 nsTArray<RefPtr<FlexItemValues>> mItems;
56 } // namespace mozilla::dom
58 #endif /* mozilla_dom_FlexLineValues_h */