Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* -*- Mode: C++; tab-width: 2; 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/. */
6 #ifndef MOZILLA_GEOMETRYUTILS_H_
7 #define MOZILLA_GEOMETRYUTILS_H_
9 #include "mozilla/ErrorResult.h"
10 #include "nsTArray.h"
11 #include "nsCOMPtr.h"
13 /**
14 * This file defines utility functions for converting between layout
15 * coordinate systems.
16 */
18 class nsINode;
19 class nsIDocument;
21 namespace mozilla {
23 namespace dom {
24 struct BoxQuadOptions;
25 struct ConvertCoordinateOptions;
26 class DOMQuad;
27 class DOMRectReadOnly;
28 class DOMPoint;
29 class DOMPointInit;
30 class OwningTextOrElementOrDocument;
31 class TextOrElementOrDocument;
32 }
34 typedef dom::TextOrElementOrDocument GeometryNode;
35 typedef dom::OwningTextOrElementOrDocument OwningGeometryNode;
37 /**
38 * Computes quads for aNode using aOptions, according to GeometryUtils.getBoxQuads.
39 * May set an error in aRv.
40 */
41 void GetBoxQuads(nsINode* aNode,
42 const dom::BoxQuadOptions& aOptions,
43 nsTArray<nsRefPtr<dom::DOMQuad> >& aResult,
44 ErrorResult& aRv);
46 already_AddRefed<dom::DOMQuad>
47 ConvertQuadFromNode(nsINode* aTo, dom::DOMQuad& aQuad,
48 const GeometryNode& aFrom,
49 const dom::ConvertCoordinateOptions& aOptions,
50 ErrorResult& aRv);
52 already_AddRefed<dom::DOMQuad>
53 ConvertRectFromNode(nsINode* aTo, dom::DOMRectReadOnly& aRect,
54 const GeometryNode& aFrom,
55 const dom::ConvertCoordinateOptions& aOptions,
56 ErrorResult& aRv);
58 already_AddRefed<dom::DOMPoint>
59 ConvertPointFromNode(nsINode* aTo, const dom::DOMPointInit& aPoint,
60 const GeometryNode& aFrom,
61 const dom::ConvertCoordinateOptions& aOptions,
62 ErrorResult& aRv);
64 }
66 #endif /* MOZILLA_GEOMETRYUTILS_H_ */