Line data Source code
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_GridLines_h
8 : #define mozilla_dom_GridLines_h
9 :
10 : #include "nsTArray.h"
11 : #include "nsWrapperCache.h"
12 :
13 : namespace mozilla {
14 : namespace dom {
15 :
16 : class GridDimension;
17 : class GridLine;
18 :
19 : class GridLines : public nsISupports
20 : , public nsWrapperCache
21 : {
22 : public:
23 : explicit GridLines(GridDimension* aParent);
24 :
25 : protected:
26 : virtual ~GridLines();
27 :
28 : public:
29 : NS_DECL_CYCLE_COLLECTING_ISUPPORTS
30 0 : NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GridLines)
31 :
32 : virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
33 0 : GridDimension* GetParentObject()
34 : {
35 0 : return mParent;
36 : }
37 :
38 : uint32_t Length() const;
39 : GridLine* Item(uint32_t aIndex);
40 : GridLine* IndexedGetter(uint32_t aIndex, bool& aFound);
41 :
42 : void SetLineInfo(const ComputedGridTrackInfo* aTrackInfo,
43 : const ComputedGridLineInfo* aLineInfo,
44 : const nsTArray<RefPtr<GridArea>>& aAreas,
45 : bool aIsRow);
46 :
47 : protected:
48 : uint32_t AppendRemovedAutoFits(const ComputedGridTrackInfo* aTrackInfo,
49 : const ComputedGridLineInfo* aLineInfo,
50 : nscoord aLastTrackEdge,
51 : uint32_t& aRepeatIndex,
52 : uint32_t aNumRepeatTracks,
53 : nsTArray<nsString>& aLineNames);
54 :
55 : RefPtr<GridDimension> mParent;
56 : nsTArray<RefPtr<GridLine>> mLines;
57 : };
58 :
59 : } // namespace dom
60 : } // namespace mozilla
61 :
62 : #endif /* mozilla_dom_GridLines_h */
|