bump product version to 4.1.6.2
[LibreOffice.git] / include / drawinglayer / geometry / viewinformation2d.hxx
blobf8e0d6699448e2fc54d2dce024e6c7d8bda81c3d
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 #ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
21 #define INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
23 #include <drawinglayer/drawinglayerdllapi.h>
25 // the solaris compiler defines 'sun' as '1'. To avoid that (and to allow
26 // pre-declarations of com/sun/star namespace), include sal/config.h here
27 // where sun is redefined as 'sun' (so i guess the problem is known).
28 #include <sal/config.h>
29 #include <com/sun/star/uno/Sequence.h>
30 #include <com/sun/star/beans/PropertyValue.hpp>
31 #include <com/sun/star/drawing/XDrawPage.hpp>
32 #include <o3tl/cow_wrapper.hxx>
34 //////////////////////////////////////////////////////////////////////////////
35 // predefines
37 namespace drawinglayer { namespace geometry {
38 class ImpViewInformation2D;
41 namespace basegfx {
42 class B2DHomMatrix;
43 class B2DRange;
46 //////////////////////////////////////////////////////////////////////////////
48 namespace drawinglayer
50 namespace geometry
52 /** ViewInformation2D class
54 This class holds all view-relevant information for a 2d geometry. It works
55 together with UNO API definitions and supports holding a sequence of PropertyValues.
56 The most used data is for convenience offered directly using basegfx tooling classes.
57 It is an implementation to support the sequence of PropertyValues used in a
58 ::com::sun::star::graphic::XPrimitive2D for C++ implementations working with those
60 class DRAWINGLAYER_DLLPUBLIC ViewInformation2D
62 public:
63 typedef o3tl::cow_wrapper< ImpViewInformation2D, o3tl::ThreadSafeRefCountingPolicy > ImplType;
65 private:
66 /// pointer to private implementation class
67 ImplType mpViewInformation2D;
69 public:
70 /** Constructor: Create a ViewInformation2D
72 @param rObjectTransformation
73 The Transformation from Object to World coordinates (normally logic coordinates).
75 @param rViewTransformation
76 The Transformation from World to View coordinates (normally logic coordinates
77 to discrete units, e.g. pixels).
79 @param rViewport
80 The visible part of the view in World coordinates. If empty (getViewport().isEmpty())
81 everything is visible. The data is in World coordinates.
83 @param rxDrawPage
84 The currently displaqyed page. This information is needed e.g. due to existing PageNumber
85 fields which need to be interpreted.
87 @param fViewTime
88 The time the view is defined for. Default is 0.0. This parameter is used e.g. for
89 animated objects
91 @param rExtendedParameters
92 A sequence of property values which allows holding various other parameters besides
93 the obvious and needed ones above. For this constructor none of the other parameters
94 should be added as data. The constructor will parse the given parameters and if
95 data for the other parameters is given, the value in rExtendedParameters will
96 be preferred and overwrite the given parameter
98 ViewInformation2D(
99 const basegfx::B2DHomMatrix& rObjectTransformation,
100 const basegfx::B2DHomMatrix& rViewTransformation,
101 const basegfx::B2DRange& rViewport,
102 const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage,
103 double fViewTime,
104 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rExtendedParameters);
106 /** Constructor: Create a ViewInformation2D
108 @param rViewParameters
109 A sequence of property values which allows holding any combination of local and various
110 other parameters. This constructor is feeded completely with a sequence of PropertyValues
111 which will be parsed to be able to offer the most used ones in a convenient way.
113 explicit ViewInformation2D(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters);
115 /// default (empty) constructor
116 ViewInformation2D();
118 /// copy constructor
119 ViewInformation2D(const ViewInformation2D& rCandidate);
121 /// destructor
122 ~ViewInformation2D();
124 // checks if the incarnation is default constructed
125 bool isDefault() const;
127 /// assignment operator
128 ViewInformation2D& operator=(const ViewInformation2D& rCandidate);
130 /// compare operators
131 bool operator==(const ViewInformation2D& rCandidate) const;
132 bool operator!=(const ViewInformation2D& rCandidate) const { return !operator==(rCandidate); }
134 /// data access
135 const basegfx::B2DHomMatrix& getObjectTransformation() const;
136 const basegfx::B2DHomMatrix& getViewTransformation() const;
137 const basegfx::B2DRange& getViewport() const;
138 double getViewTime() const;
139 const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& getVisualizedPage() const;
141 /// On-demand prepared Object to View transformation and it's inerse for convenience
142 const basegfx::B2DHomMatrix& getObjectToViewTransformation() const;
143 const basegfx::B2DHomMatrix& getInverseObjectToViewTransformation() const;
145 /// On-demand prepared Viewport in discrete units for convenience
146 const basegfx::B2DRange& getDiscreteViewport() const;
148 /** support reduced DisplayQuality, PropertyName is 'ReducedDisplayQuality'. This
149 is used e.g. to allow to lower display quality for OverlayPrimitives and
150 may lead to simpler decompositions in the local create2DDecomposition
151 implementations of the primitives
153 bool getReducedDisplayQuality() const;
155 /** Get the uno::Sequence< beans::PropertyValue > which contains all ViewInformation
157 Use this call if You need to extract all contained ViewInformation. The ones
158 directly supported for convenience will be added to the ones only available
159 as PropertyValues. This set completely describes this ViewInformation2D and
160 can be used for complete information transport over UNO API.
162 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& getViewInformationSequence() const;
164 /** Get the uno::Sequence< beans::PropertyValue > which contains only ViewInformation
165 not offered directly
167 Use this call if You only need ViewInformation which is not offered conveniently,
168 but only exists as PropertyValue. This is e.g. used to create partially updated
169 incarnations of ViewInformation2D without losing the only with PropertyValues
170 defined data. It does not contain a complete description.
172 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& getExtendedInformationSequence() const;
174 } // end of namespace geometry
175 } // end of namespace drawinglayer
177 //////////////////////////////////////////////////////////////////////////////
179 #endif //INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
181 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */