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