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/. */
7 #ifndef MOZILLA_GEOMETRYUTILS_H_
8 #define MOZILLA_GEOMETRYUTILS_H_
10 #include "mozilla/ErrorResult.h"
15 * This file defines utility functions for converting between layout
24 struct BoxQuadOptions
;
25 struct ConvertCoordinateOptions
;
27 class DOMRectReadOnly
;
30 class OwningTextOrElementOrDocument
;
31 class TextOrElementOrDocument
;
32 enum class CallerType
: uint32_t;
35 typedef dom::TextOrElementOrDocument GeometryNode
;
36 typedef dom::OwningTextOrElementOrDocument OwningGeometryNode
;
39 * Computes quads for aNode using aOptions, according to
40 * GeometryUtils.getBoxQuads. May set an error in aRv.
42 void GetBoxQuads(nsINode
* aNode
, const dom::BoxQuadOptions
& aOptions
,
43 nsTArray
<RefPtr
<dom::DOMQuad
> >& aResult
,
44 dom::CallerType aCallerType
, ErrorResult
& aRv
);
46 already_AddRefed
<dom::DOMQuad
> ConvertQuadFromNode(
47 nsINode
* aTo
, dom::DOMQuad
& aQuad
, const GeometryNode
& aFrom
,
48 const dom::ConvertCoordinateOptions
& aOptions
, dom::CallerType aCallerType
,
51 already_AddRefed
<dom::DOMQuad
> ConvertRectFromNode(
52 nsINode
* aTo
, dom::DOMRectReadOnly
& aRect
, const GeometryNode
& aFrom
,
53 const dom::ConvertCoordinateOptions
& aOptions
, dom::CallerType aCallerType
,
56 already_AddRefed
<dom::DOMPoint
> ConvertPointFromNode(
57 nsINode
* aTo
, const dom::DOMPointInit
& aPoint
, const GeometryNode
& aFrom
,
58 const dom::ConvertCoordinateOptions
& aOptions
, dom::CallerType aCallerType
,
61 } // namespace mozilla
63 #endif /* MOZILLA_GEOMETRYUTILS_H_ */