Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / gfx / layers / ZoomConstraints.h
blob51f9bfa0ec9be87e4c48d00c832305d2134af047
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 GFX_ZOOMCONSTRAINTS_H
8 #define GFX_ZOOMCONSTRAINTS_H
10 #include <iosfwd>
12 #include "Units.h" // for CSSRect, CSSPixel, etc
13 #include "mozilla/Maybe.h"
14 #include "mozilla/layers/ScrollableLayerGuid.h" // for ScrollableLayerGuid
16 namespace mozilla {
17 namespace layers {
19 struct ZoomConstraints {
20 bool mAllowZoom;
21 bool mAllowDoubleTapZoom;
22 CSSToParentLayerScale mMinZoom;
23 CSSToParentLayerScale mMaxZoom;
25 ZoomConstraints() : mAllowZoom(true), mAllowDoubleTapZoom(true) {
26 MOZ_COUNT_CTOR(ZoomConstraints);
29 ZoomConstraints(bool aAllowZoom, bool aAllowDoubleTapZoom,
30 const CSSToParentLayerScale& aMinZoom,
31 const CSSToParentLayerScale& aMaxZoom)
32 : mAllowZoom(aAllowZoom),
33 mAllowDoubleTapZoom(aAllowDoubleTapZoom),
34 mMinZoom(aMinZoom),
35 mMaxZoom(aMaxZoom) {
36 MOZ_COUNT_CTOR(ZoomConstraints);
39 ZoomConstraints(const ZoomConstraints& other)
40 : mAllowZoom(other.mAllowZoom),
41 mAllowDoubleTapZoom(other.mAllowDoubleTapZoom),
42 mMinZoom(other.mMinZoom),
43 mMaxZoom(other.mMaxZoom) {
44 MOZ_COUNT_CTOR(ZoomConstraints);
47 MOZ_COUNTED_DTOR(ZoomConstraints)
49 bool operator==(const ZoomConstraints& other) const {
50 return mAllowZoom == other.mAllowZoom &&
51 mAllowDoubleTapZoom == other.mAllowDoubleTapZoom &&
52 mMinZoom == other.mMinZoom && mMaxZoom == other.mMaxZoom;
55 bool operator!=(const ZoomConstraints& other) const {
56 return !(*this == other);
59 friend std::ostream& operator<<(std::ostream& aStream,
60 const ZoomConstraints& z);
63 } // namespace layers
64 } // namespace mozilla
66 #endif /* GFX_ZOOMCONSTRAINTS_H */