GridLine.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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_GridLine_h
  6. #define mozilla_dom_GridLine_h
  7. #include "mozilla/dom/GridBinding.h"
  8. #include "nsString.h"
  9. #include "nsTArray.h"
  10. #include "nsWrapperCache.h"
  11. namespace mozilla {
  12. namespace dom {
  13. class GridLines;
  14. class GridLine : public nsISupports
  15. , public nsWrapperCache
  16. {
  17. public:
  18. explicit GridLine(GridLines* aParent);
  19. protected:
  20. virtual ~GridLine();
  21. public:
  22. NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  23. NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GridLine)
  24. void GetNames(nsTArray<nsString>& aNames) const;
  25. virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
  26. GridLines* GetParentObject()
  27. {
  28. return mParent;
  29. }
  30. double Start() const;
  31. double Breadth() const;
  32. GridDeclaration Type() const;
  33. uint32_t Number() const;
  34. void SetLineValues(const nsTArray<nsString>& aNames,
  35. double aStart,
  36. double aBreadth,
  37. uint32_t aNumber,
  38. GridDeclaration aType);
  39. protected:
  40. RefPtr<GridLines> mParent;
  41. nsTArray<nsString> mNames;
  42. double mStart;
  43. double mBreadth;
  44. GridDeclaration mType;
  45. uint32_t mNumber;
  46. };
  47. } // namespace dom
  48. } // namespace mozilla
  49. #endif /* mozilla_dom_GridLine_h */