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