2016-07-06 18:45:18 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_Grid_h
|
|
|
|
#define mozilla_dom_Grid_h
|
|
|
|
|
2016-08-23 20:34:51 +00:00
|
|
|
#include "GridArea.h"
|
2016-07-06 18:45:18 +00:00
|
|
|
#include "nsGridContainerFrame.h"
|
|
|
|
#include "nsISupports.h"
|
|
|
|
#include "nsWrapperCache.h"
|
|
|
|
|
2022-05-09 20:41:07 +00:00
|
|
|
namespace mozilla::dom {
|
2016-07-06 18:45:18 +00:00
|
|
|
|
2020-11-23 16:08:40 +00:00
|
|
|
class Element;
|
2016-07-06 18:45:18 +00:00
|
|
|
class GridDimension;
|
|
|
|
|
|
|
|
class Grid : public nsISupports, public nsWrapperCache {
|
|
|
|
public:
|
|
|
|
explicit Grid(nsISupports* aParent, nsGridContainerFrame* aFrame);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~Grid();
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2022-09-07 11:22:51 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Grid)
|
2016-07-06 18:45:18 +00:00
|
|
|
|
|
|
|
virtual JSObject* WrapObject(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aGivenProto) override;
|
|
|
|
Element* GetParentObject() { return mParent; }
|
|
|
|
|
2023-02-23 01:07:34 +00:00
|
|
|
void ForgetFrame();
|
|
|
|
|
2016-07-06 18:45:18 +00:00
|
|
|
GridDimension* Rows() const;
|
|
|
|
GridDimension* Cols() const;
|
2016-08-23 20:34:51 +00:00
|
|
|
void GetAreas(nsTArray<RefPtr<GridArea>>& aAreas) const;
|
2016-07-06 18:45:18 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
nsCOMPtr<Element> mParent;
|
2023-02-23 01:07:34 +00:00
|
|
|
WeakFrame mFrame;
|
2016-07-06 18:45:18 +00:00
|
|
|
RefPtr<GridDimension> mRows;
|
|
|
|
RefPtr<GridDimension> mCols;
|
2016-08-23 20:34:51 +00:00
|
|
|
nsTArray<RefPtr<GridArea>> mAreas;
|
2016-07-06 18:45:18 +00:00
|
|
|
};
|
|
|
|
|
2022-05-09 20:41:07 +00:00
|
|
|
} // namespace mozilla::dom
|
2016-07-06 18:45:18 +00:00
|
|
|
|
|
|
|
#endif /* mozilla_dom_Grid_h */
|