LibreOffice Module drawinglayer (master) 1
baseprimitive2d.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
28#include <com/sun/star/util/XAccounting.hpp>
30#include <com/sun/star/graphic/XPrimitive2D.hpp>
33#include <rtl/ref.hxx>
34#include <deque>
35#include <utility>
36
38{
39class ViewInformation2D;
40}
41
44
46{
121{
124
125public:
126 // constructor/destructor
128 virtual ~BasePrimitive2D() override;
129
135 virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
136 bool operator!=(const BasePrimitive2D& rPrimitive) const { return !operator==(rPrimitive); }
137
139 virtual basegfx::B2DRange
140 getB2DRange(const geometry::ViewInformation2D& rViewInformation) const;
141
145 virtual sal_uInt32 getPrimitive2DID() const = 0;
146
148 virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor,
149 const geometry::ViewInformation2D& rViewInformation) const;
150
151 // Methods from XPrimitive2D
152
157 getDecomposition(const css::uno::Sequence<css::beans::PropertyValue>& rViewParameters);
158
162 css::geometry::RealRectangle2D
163 getRange(const css::uno::Sequence<css::beans::PropertyValue>& rViewParameters);
164
165 // XAccounting
166 virtual sal_Int64 estimateUsage();
167};
168
175{
178
179public:
180 // constructor/destructor
182 : mxPrimitive(std::move(xPrimitive))
183 {
184 }
185 virtual ~UnoPrimitive2D() override;
186
187 // Methods from XPrimitive2D
188
192 virtual css::uno::Sequence<::css::uno::Reference<::css::graphic::XPrimitive2D>> SAL_CALL
193 getDecomposition(const css::uno::Sequence<css::beans::PropertyValue>& rViewParameters) override;
194
198 virtual css::geometry::RealRectangle2D SAL_CALL
199 getRange(const css::uno::Sequence<css::beans::PropertyValue>& rViewParameters) override;
200
201 // XAccounting
202 virtual sal_Int64 SAL_CALL estimateUsage() override;
203
204 rtl::Reference<BasePrimitive2D> const& getBasePrimitive2D() const { return mxPrimitive; }
205
206private:
208};
209
210} // end of namespace drawinglayer::primitive2d
211
212/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
comphelper::WeakComponentImplHelper< css::graphic::XPrimitive2D, css::util::XAccounting > BasePrimitive2DImplBase
bool operator!=(const BasePrimitive2D &rPrimitive) const
virtual sal_uInt32 getPrimitive2DID() const =0
provide unique ID for fast identifying of known primitive implementations in renderers.
BasePrimitive2D(const BasePrimitive2D &)=delete
BasePrimitive2D & operator=(const BasePrimitive2D &)=delete
Rather than make all the BasePrimitive2D classes bear the cost of being an UNO object,...
rtl::Reference< BasePrimitive2D > const & getBasePrimitive2D() const
UnoPrimitive2D & operator=(const UnoPrimitive2D &)=delete
UnoPrimitive2D(const UnoPrimitive2D &)=delete
rtl::Reference< BasePrimitive2D > mxPrimitive
UnoPrimitive2D(rtl::Reference< BasePrimitive2D > xPrimitive)
#define DRAWINGLAYERCORE_DLLPUBLIC
B2DRange getRange(const B2DPolygon &rCandidate)
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)