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_GridTrack_h
8 #define mozilla_dom_GridTrack_h
9 
10 #include "mozilla/dom/GridBinding.h"
11 #include "nsWrapperCache.h"
12 
13 namespace mozilla {
14 namespace dom {
15 
16 class GridTracks;
17 
18 class GridTrack : public nsISupports, public nsWrapperCache {
19  public:
20   explicit GridTrack(GridTracks* parent);
21 
22  protected:
23   virtual ~GridTrack();
24 
25  public:
26   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
27   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GridTrack)
28 
29   virtual JSObject* WrapObject(JSContext* aCx,
30                                JS::Handle<JSObject*> aGivenProto) override;
GetParentObject()31   GridTracks* GetParentObject() { return mParent; }
32 
33   double Start() const;
34   double Breadth() const;
35   GridDeclaration Type() const;
36   GridTrackState State() const;
37 
38   void SetTrackValues(double aStart, double aBreadth, GridDeclaration aType,
39                       GridTrackState aState);
40 
41  protected:
42   RefPtr<GridTracks> mParent;
43   double mStart;
44   double mBreadth;
45   GridDeclaration mType;
46   GridTrackState mState;
47 };
48 
49 }  // namespace dom
50 }  // namespace mozilla
51 
52 #endif /* mozilla_dom_GridTrack_h */
53