2017-10-27 20:33:53 +03: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: */
|
2014-03-12 05:11:38 +04:00
|
|
|
/* 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_GEOMETRYUTILS_H_
|
|
|
|
#define MOZILLA_GEOMETRYUTILS_H_
|
|
|
|
|
|
|
|
#include "mozilla/ErrorResult.h"
|
|
|
|
#include "nsTArray.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This file defines utility functions for converting between layout
|
|
|
|
* coordinate systems.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class nsINode;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace dom {
|
|
|
|
struct BoxQuadOptions;
|
2014-03-12 05:11:38 +04:00
|
|
|
struct ConvertCoordinateOptions;
|
2014-03-12 05:11:38 +04:00
|
|
|
class DOMQuad;
|
2014-03-12 05:11:38 +04:00
|
|
|
class DOMRectReadOnly;
|
|
|
|
class DOMPoint;
|
2014-06-19 04:57:51 +04:00
|
|
|
struct DOMPointInit;
|
2014-03-12 05:11:38 +04:00
|
|
|
class OwningTextOrElementOrDocument;
|
|
|
|
class TextOrElementOrDocument;
|
2017-02-01 23:43:59 +03:00
|
|
|
enum class CallerType : uint32_t;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
2014-03-12 05:11:38 +04:00
|
|
|
|
2014-03-12 05:11:38 +04:00
|
|
|
typedef dom::TextOrElementOrDocument GeometryNode;
|
|
|
|
typedef dom::OwningTextOrElementOrDocument OwningGeometryNode;
|
|
|
|
|
2014-03-12 05:11:38 +04:00
|
|
|
/**
|
|
|
|
* Computes quads for aNode using aOptions, according to
|
|
|
|
* GeometryUtils.getBoxQuads. May set an error in aRv.
|
|
|
|
*/
|
|
|
|
void GetBoxQuads(nsINode* aNode, const dom::BoxQuadOptions& aOptions,
|
2015-10-18 08:24:48 +03:00
|
|
|
nsTArray<RefPtr<dom::DOMQuad> >& aResult,
|
2017-02-01 23:43:59 +03:00
|
|
|
dom::CallerType aCallerType, ErrorResult& aRv);
|
2014-03-12 05:11:38 +04:00
|
|
|
|
2014-03-12 05:11:38 +04:00
|
|
|
already_AddRefed<dom::DOMQuad> ConvertQuadFromNode(
|
|
|
|
nsINode* aTo, dom::DOMQuad& aQuad, const GeometryNode& aFrom,
|
|
|
|
const dom::ConvertCoordinateOptions& aOptions, dom::CallerType aCallerType,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
|
|
|
|
already_AddRefed<dom::DOMQuad> ConvertRectFromNode(
|
|
|
|
nsINode* aTo, dom::DOMRectReadOnly& aRect, const GeometryNode& aFrom,
|
|
|
|
const dom::ConvertCoordinateOptions& aOptions, dom::CallerType aCallerType,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
|
|
|
|
already_AddRefed<dom::DOMPoint> ConvertPointFromNode(
|
|
|
|
nsINode* aTo, const dom::DOMPointInit& aPoint, const GeometryNode& aFrom,
|
|
|
|
const dom::ConvertCoordinateOptions& aOptions, dom::CallerType aCallerType,
|
|
|
|
ErrorResult& aRv);
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace mozilla
|
2014-03-12 05:11:38 +04:00
|
|
|
|
|
|
|
#endif /* MOZILLA_GEOMETRYUTILS_H_ */
|