nss: upgrade to release 3.73
[LibreOffice.git] / include / drawinglayer / primitive2d / Primitive2DContainer.hxx
blobcca3a0a9148535e232dd3d8f50333388450ada63
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <drawinglayer/drawinglayerdllapi.h>
24 #include <drawinglayer/primitive2d/CommonTypes.hxx>
25 #include <drawinglayer/primitive2d/Primitive2DVisitor.hxx>
27 #include <basegfx/range/b2drange.hxx>
28 #include <deque>
30 namespace drawinglayer::geometry
32 class ViewInformation2D;
35 namespace drawinglayer::primitive2d
37 class SAL_WARN_UNUSED DRAWINGLAYER_DLLPUBLIC Primitive2DContainer
38 : public std::deque<Primitive2DReference>,
39 public Primitive2DDecompositionVisitor
41 public:
42 // use zero because we allocate a lot of empty containers
43 explicit Primitive2DContainer()
44 : deque(0)
47 explicit Primitive2DContainer(size_type count)
48 : deque(count)
51 virtual ~Primitive2DContainer() override;
52 Primitive2DContainer(const Primitive2DContainer& other)
53 : deque(other)
56 Primitive2DContainer(Primitive2DContainer&& other) noexcept
57 : deque(std::move(other))
60 Primitive2DContainer(const std::deque<Primitive2DReference>& other)
61 : deque(other)
64 Primitive2DContainer(std::initializer_list<Primitive2DReference> init)
65 : deque(init)
68 template <class Iter>
69 Primitive2DContainer(Iter first, Iter last)
70 : deque(first, last)
74 virtual void append(const Primitive2DReference&) override;
75 virtual void append(const Primitive2DContainer& rSource) override;
76 virtual void append(Primitive2DContainer&& rSource) override;
77 void append(const Primitive2DSequence& rSource);
78 Primitive2DContainer& operator=(const Primitive2DContainer& r)
80 deque::operator=(r);
81 return *this;
83 Primitive2DContainer& operator=(Primitive2DContainer&& r) noexcept
85 deque::operator=(std::move(r));
86 return *this;
88 bool operator==(const Primitive2DContainer& rB) const;
89 bool operator!=(const Primitive2DContainer& rB) const { return !operator==(rB); }
90 basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& aViewInformation) const;
91 Primitive2DContainer maybeInvert(bool bInvert = false) const;
94 } // end of namespace drawinglayer::primitive2d
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */