michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef MOZILLA_GEOMETRYUTILS_H_ michael@0: #define MOZILLA_GEOMETRYUTILS_H_ michael@0: michael@0: #include "mozilla/ErrorResult.h" michael@0: #include "nsTArray.h" michael@0: #include "nsCOMPtr.h" michael@0: michael@0: /** michael@0: * This file defines utility functions for converting between layout michael@0: * coordinate systems. michael@0: */ michael@0: michael@0: class nsINode; michael@0: class nsIDocument; michael@0: michael@0: namespace mozilla { michael@0: michael@0: namespace dom { michael@0: struct BoxQuadOptions; michael@0: struct ConvertCoordinateOptions; michael@0: class DOMQuad; michael@0: class DOMRectReadOnly; michael@0: class DOMPoint; michael@0: class DOMPointInit; michael@0: class OwningTextOrElementOrDocument; michael@0: class TextOrElementOrDocument; michael@0: } michael@0: michael@0: typedef dom::TextOrElementOrDocument GeometryNode; michael@0: typedef dom::OwningTextOrElementOrDocument OwningGeometryNode; michael@0: michael@0: /** michael@0: * Computes quads for aNode using aOptions, according to GeometryUtils.getBoxQuads. michael@0: * May set an error in aRv. michael@0: */ michael@0: void GetBoxQuads(nsINode* aNode, michael@0: const dom::BoxQuadOptions& aOptions, michael@0: nsTArray >& aResult, michael@0: ErrorResult& aRv); michael@0: michael@0: already_AddRefed michael@0: ConvertQuadFromNode(nsINode* aTo, dom::DOMQuad& aQuad, michael@0: const GeometryNode& aFrom, michael@0: const dom::ConvertCoordinateOptions& aOptions, michael@0: ErrorResult& aRv); michael@0: michael@0: already_AddRefed michael@0: ConvertRectFromNode(nsINode* aTo, dom::DOMRectReadOnly& aRect, michael@0: const GeometryNode& aFrom, michael@0: const dom::ConvertCoordinateOptions& aOptions, michael@0: ErrorResult& aRv); michael@0: michael@0: already_AddRefed michael@0: ConvertPointFromNode(nsINode* aTo, const dom::DOMPointInit& aPoint, michael@0: const GeometryNode& aFrom, michael@0: const dom::ConvertCoordinateOptions& aOptions, michael@0: ErrorResult& aRv); michael@0: michael@0: } michael@0: michael@0: #endif /* MOZILLA_GEOMETRYUTILS_H_ */