GridDimension.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef mozilla_dom_GridDimension_h
  6. #define mozilla_dom_GridDimension_h
  7. #include "mozilla/dom/GridBinding.h"
  8. #include "nsWrapperCache.h"
  9. namespace mozilla {
  10. struct ComputedGridTrackInfo;
  11. struct ComputedGridLineInfo;
  12. namespace dom {
  13. class Grid;
  14. class GridLines;
  15. class GridTracks;
  16. class GridDimension : public nsISupports
  17. , public nsWrapperCache
  18. {
  19. public:
  20. explicit GridDimension(Grid* aParent);
  21. protected:
  22. virtual ~GridDimension();
  23. public:
  24. NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  25. NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GridDimension)
  26. virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
  27. Grid* GetParentObject()
  28. {
  29. return mParent;
  30. }
  31. GridLines* Lines() const;
  32. GridTracks* Tracks() const;
  33. void SetTrackInfo(const ComputedGridTrackInfo* aTrackInfo);
  34. void SetLineInfo(const ComputedGridTrackInfo* aTrackInfo,
  35. const ComputedGridLineInfo* aLineInfo,
  36. const nsTArray<RefPtr<GridArea>>& aAreas,
  37. bool aIsRow);
  38. protected:
  39. RefPtr<Grid> mParent;
  40. RefPtr<GridLines> mLines;
  41. RefPtr<GridTracks> mTracks;
  42. };
  43. } // namespace dom
  44. } // namespace mozilla
  45. #endif /* mozilla_dom_GridDimension_h */