LibreOffice Module drawinglayer (master) 1
Primitive2DContainer.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
23
27
29#include <deque>
30
32{
33class ViewInformation2D;
34}
35
37{
39 : public std::deque<Primitive2DReference>,
41{
42public:
43 // use zero because we allocate a lot of empty containers
45 : deque(0)
46 {
47 }
48 explicit Primitive2DContainer(size_type count)
49 : deque(count)
50 {
51 }
52 virtual ~Primitive2DContainer() override;
54 : deque(other)
55 {
56 }
58 : deque(std::move(other))
59 {
60 }
61 Primitive2DContainer(std::initializer_list<Primitive2DReference> init)
62 : deque(init)
63 {
64 }
66 const css::uno::Sequence<css::uno::Reference<css::graphic::XPrimitive2D>>&);
67 Primitive2DContainer(const std::deque<css::uno::Reference<css::graphic::XPrimitive2D>>&);
68
69 virtual void visit(const Primitive2DReference& rSource) override { append(rSource); }
70 virtual void visit(const Primitive2DContainer& rSource) override { append(rSource); }
71 virtual void visit(Primitive2DContainer&& rSource) override { append(std::move(rSource)); }
72
73 void append(const Primitive2DReference&);
74 void append(const Primitive2DContainer& rSource);
75 void append(Primitive2DContainer&& rSource);
77 {
78 deque::operator=(r);
79 return *this;
80 }
82 {
83 deque::operator=(std::move(r));
84 return *this;
85 }
86 bool operator==(const Primitive2DContainer& rB) const;
87 bool operator!=(const Primitive2DContainer& rB) const { return !operator==(rB); }
88 basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& aViewInformation) const;
89 Primitive2DContainer maybeInvert(bool bInvert = false);
90
91 css::uno::Sequence<css::uno::Reference<css::graphic::XPrimitive2D>> toSequence() const;
92};
93
94} // end of namespace drawinglayer::primitive2d
95
96/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FILE * init(int, char **)
virtual void visit(const Primitive2DContainer &rSource) override
virtual void visit(const Primitive2DReference &rSource) override
Primitive2DContainer(Primitive2DContainer &&other) noexcept
bool operator!=(const Primitive2DContainer &rB) const
Primitive2DContainer & operator=(const Primitive2DContainer &r)
Primitive2DContainer & operator=(Primitive2DContainer &&r) noexcept
Primitive2DContainer(std::initializer_list< Primitive2DReference > init)
virtual void visit(Primitive2DContainer &&rSource) override
Primitive2DContainer(const Primitive2DContainer &other)
#define DRAWINGLAYERCORE_DLLPUBLIC
#define SAL_WARN_UNUSED
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)