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_GridArea_h
8 #define mozilla_dom_GridArea_h
9 
10 #include "mozilla/dom/GridBinding.h"
11 #include "nsWrapperCache.h"
12 
13 namespace mozilla {
14 namespace dom {
15 
16 class Grid;
17 
18 class GridArea : public nsISupports, public nsWrapperCache {
19  public:
20   explicit GridArea(Grid* aParent, nsAtom* aName, GridDeclaration aType,
21                     uint32_t aRowStart, uint32_t aRowEnd, uint32_t aColumnStart,
22                     uint32_t aColumnEnd);
23 
24  protected:
25   virtual ~GridArea();
26 
27  public:
28   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
29   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GridArea)
30 
31   virtual JSObject* WrapObject(JSContext* aCx,
32                                JS::Handle<JSObject*> aGivenProto) override;
GetParentObject()33   Grid* GetParentObject() { return mParent; }
34 
35   void GetName(nsString& aName) const;
36   GridDeclaration Type() const;
37   uint32_t RowStart() const;
38   uint32_t RowEnd() const;
39   uint32_t ColumnStart() const;
40   uint32_t ColumnEnd() const;
41 
42  protected:
43   RefPtr<Grid> mParent;
44   const RefPtr<nsAtom> mName;
45   const GridDeclaration mType;
46   const uint32_t mRowStart;
47   const uint32_t mRowEnd;
48   const uint32_t mColumnStart;
49   const uint32_t mColumnEnd;
50 };
51 
52 }  // namespace dom
53 }  // namespace mozilla
54 
55 #endif /* mozilla_dom_GridTrack_h */
56