1*4f506f19SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*4f506f19SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*4f506f19SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*4f506f19SAndrew Rist  * distributed with this work for additional information
6*4f506f19SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*4f506f19SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*4f506f19SAndrew Rist  * "License"); you may not use this file except in compliance
9*4f506f19SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*4f506f19SAndrew Rist  *
11*4f506f19SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*4f506f19SAndrew Rist  *
13*4f506f19SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*4f506f19SAndrew Rist  * software distributed under the License is distributed on an
15*4f506f19SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*4f506f19SAndrew Rist  * KIND, either express or implied.  See the License for the
17*4f506f19SAndrew Rist  * specific language governing permissions and limitations
18*4f506f19SAndrew Rist  * under the License.
19*4f506f19SAndrew Rist  *
20*4f506f19SAndrew Rist  *************************************************************/
21*4f506f19SAndrew Rist 
22*4f506f19SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
25cdf0e10cSrcweir #define INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir // the solaris compiler defines 'sun' as '1'. To avoid that (and to allow
28cdf0e10cSrcweir // pre-declarations of com/sun/star namespace), include sal/config.h here
29cdf0e10cSrcweir // where sun is redefined as 'sun' (so i guess the problem is known).
30090f0eb8SEike Rathke #include <drawinglayer/drawinglayerdllapi.h>
31cdf0e10cSrcweir #include <sal/config.h>
32cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.h>
33cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
34cdf0e10cSrcweir #include <com/sun/star/drawing/XDrawPage.hpp>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
37cdf0e10cSrcweir // predefines
38cdf0e10cSrcweir 
39cdf0e10cSrcweir namespace drawinglayer { namespace geometry {
40cdf0e10cSrcweir 	class ImpViewInformation2D;
41cdf0e10cSrcweir }}
42cdf0e10cSrcweir 
43cdf0e10cSrcweir namespace basegfx {
44cdf0e10cSrcweir 	class B2DHomMatrix;
45cdf0e10cSrcweir 	class B2DRange;
46cdf0e10cSrcweir }
47cdf0e10cSrcweir 
48cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
49cdf0e10cSrcweir 
50cdf0e10cSrcweir namespace drawinglayer
51cdf0e10cSrcweir {
52cdf0e10cSrcweir 	namespace geometry
53cdf0e10cSrcweir 	{
54cdf0e10cSrcweir         /** ViewInformation2D class
55cdf0e10cSrcweir 
56cdf0e10cSrcweir             This class holds all view-relevant information for a 2d geometry. It works
57cdf0e10cSrcweir             together with UNO API definitions and supports holding a sequence of PropertyValues.
58cdf0e10cSrcweir             The most used data is for convenience offered directly using basegfx tooling classes.
59cdf0e10cSrcweir             It is an implementation to support the sequence of PropertyValues used in a
60cdf0e10cSrcweir             ::com::sun::star::graphic::XPrimitive2D for C++ implementations working with those
61cdf0e10cSrcweir         */
62090f0eb8SEike Rathke 		class DRAWINGLAYER_DLLPUBLIC ViewInformation2D
63cdf0e10cSrcweir 		{
64cdf0e10cSrcweir 		private:
65cdf0e10cSrcweir 			/// pointer to private implementation class
66cdf0e10cSrcweir 			ImpViewInformation2D*					mpViewInformation2D;
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 		public:
69cdf0e10cSrcweir 			/** Constructor: Create a ViewInformation2D
70cdf0e10cSrcweir 
71cdf0e10cSrcweir                 @param rObjectTransformation
72cdf0e10cSrcweir                 The Transformation from Object to World coordinates (normally logic coordinates).
73cdf0e10cSrcweir 
74cdf0e10cSrcweir                 @param rViewTransformation
75cdf0e10cSrcweir                 The Transformation from World to View coordinates (normally logic coordinates
76cdf0e10cSrcweir                 to discrete units, e.g. pixels).
77cdf0e10cSrcweir 
78cdf0e10cSrcweir                 @param rViewport
79cdf0e10cSrcweir                 The visible part of the view in World coordinates. If empty (getViewport().isEmpty())
80cdf0e10cSrcweir                 everything is visible. The data is in World coordinates.
81cdf0e10cSrcweir 
82cdf0e10cSrcweir                 @param rxDrawPage
83cdf0e10cSrcweir                 The currently displaqyed page. This information is needed e.g. due to existing PageNumber
84cdf0e10cSrcweir                 fields which need to be interpreted.
85cdf0e10cSrcweir 
86cdf0e10cSrcweir                 @param fViewTime
87cdf0e10cSrcweir                 The time the view is defined for. Default is 0.0. This parameter is used e.g. for
88cdf0e10cSrcweir                 animated objects
89cdf0e10cSrcweir 
90cdf0e10cSrcweir                 @param rExtendedParameters
91cdf0e10cSrcweir                 A sequence of property values which allows holding various other parameters besides
92cdf0e10cSrcweir                 the obvious and needed ones above. For this constructor none of the other parameters
93cdf0e10cSrcweir                 should be added as data. The constructor will parse the given parameters and if
94cdf0e10cSrcweir                 data for the other parameters is given, the value in rExtendedParameters will
95cdf0e10cSrcweir                 be preferred and overwrite the given parameter
96cdf0e10cSrcweir             */
97cdf0e10cSrcweir 			ViewInformation2D(
98cdf0e10cSrcweir 				const basegfx::B2DHomMatrix& rObjectTransformation,
99cdf0e10cSrcweir 				const basegfx::B2DHomMatrix& rViewTransformation,
100cdf0e10cSrcweir 				const basegfx::B2DRange& rViewport,
101cdf0e10cSrcweir 				const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage,
102cdf0e10cSrcweir 				double fViewTime,
103cdf0e10cSrcweir 				const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rExtendedParameters);
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 			/** Constructor: Create a ViewInformation2D
106cdf0e10cSrcweir 
107cdf0e10cSrcweir                 @param rViewParameters
108cdf0e10cSrcweir                 A sequence of property values which allows holding any combination of local and various
109cdf0e10cSrcweir                 other parameters. This constructor is feeded completely with a sequence of PropertyValues
110cdf0e10cSrcweir                 which will be parsed to be able to offer the most used ones in a convenient way.
111cdf0e10cSrcweir             */
112cdf0e10cSrcweir 			ViewInformation2D(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rViewParameters);
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 			/// default (empty) constructor
115cdf0e10cSrcweir 			ViewInformation2D();
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 			/// copy constructor
118cdf0e10cSrcweir 			ViewInformation2D(const ViewInformation2D& rCandidate);
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 			/// destructor
121cdf0e10cSrcweir 			~ViewInformation2D();
122cdf0e10cSrcweir 
123cdf0e10cSrcweir             // checks if the incarnation is default constructed
124cdf0e10cSrcweir             bool isDefault() const;
125cdf0e10cSrcweir 
126cdf0e10cSrcweir 			/// assignment operator
127cdf0e10cSrcweir 			ViewInformation2D& operator=(const ViewInformation2D& rCandidate);
128cdf0e10cSrcweir 
129cdf0e10cSrcweir 			/// compare operators
130cdf0e10cSrcweir 			bool operator==(const ViewInformation2D& rCandidate) const;
operator !=(const ViewInformation2D & rCandidate) const131cdf0e10cSrcweir             bool operator!=(const ViewInformation2D& rCandidate) const { return !operator==(rCandidate); }
132cdf0e10cSrcweir 
133cdf0e10cSrcweir 			/// data access
134cdf0e10cSrcweir 			const basegfx::B2DHomMatrix& getObjectTransformation() const;
135cdf0e10cSrcweir 			const basegfx::B2DHomMatrix& getViewTransformation() const;
136cdf0e10cSrcweir 			const basegfx::B2DRange& getViewport() const;
137cdf0e10cSrcweir 			double getViewTime() const;
138cdf0e10cSrcweir 			const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& getVisualizedPage() const;
139cdf0e10cSrcweir 
140cdf0e10cSrcweir             /// On-demand prepared Object to View transformation and it's inerse for convenience
141cdf0e10cSrcweir 			const basegfx::B2DHomMatrix& getObjectToViewTransformation() const;
142cdf0e10cSrcweir 			const basegfx::B2DHomMatrix& getInverseObjectToViewTransformation() const;
143cdf0e10cSrcweir 
144cdf0e10cSrcweir             /// On-demand prepared Viewport in discrete units for convenience
145cdf0e10cSrcweir             const basegfx::B2DRange& getDiscreteViewport() const;
146cdf0e10cSrcweir 
147cdf0e10cSrcweir             /** support reduced DisplayQuality, PropertyName is 'ReducedDisplayQuality'. This
148cdf0e10cSrcweir                 is used e.g. to allow to lower display quality for OverlayPrimitives and
149cdf0e10cSrcweir                 may lead to simpler decompositions in the local create2DDecomposition
150cdf0e10cSrcweir                 implementations of the primitives
151cdf0e10cSrcweir              */
152cdf0e10cSrcweir             bool getReducedDisplayQuality() const;
153cdf0e10cSrcweir 
154cdf0e10cSrcweir             /** Get the uno::Sequence< beans::PropertyValue > which contains all ViewInformation
155cdf0e10cSrcweir 
156cdf0e10cSrcweir                 Use this call if You need to extract all contained ViewInformation. The ones
157cdf0e10cSrcweir                 directly supported for convenience will be added to the ones only available
158cdf0e10cSrcweir                 as PropertyValues. This set completely describes this ViewInformation2D and
159cdf0e10cSrcweir                 can be used for complete information transport over UNO API.
160cdf0e10cSrcweir             */
161cdf0e10cSrcweir 			const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& getViewInformationSequence() const;
162cdf0e10cSrcweir 
163cdf0e10cSrcweir             /** Get the uno::Sequence< beans::PropertyValue > which contains only ViewInformation
164cdf0e10cSrcweir                 not offered directly
165cdf0e10cSrcweir 
166cdf0e10cSrcweir                 Use this call if You only need ViewInformation which is not offered conveniently,
167cdf0e10cSrcweir                 but only exists as PropertyValue. This is e.g. used to create partially updated
168cdf0e10cSrcweir                 incarnations of ViewInformation2D without losing the only with PropertyValues
169cdf0e10cSrcweir                 defined data. It does not contain a complete description.
170cdf0e10cSrcweir             */
171cdf0e10cSrcweir 			const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& getExtendedInformationSequence() const;
172cdf0e10cSrcweir 		};
173cdf0e10cSrcweir 	} // end of namespace geometry
174cdf0e10cSrcweir } // end of namespace drawinglayer
175cdf0e10cSrcweir 
176cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
177cdf0e10cSrcweir 
178cdf0e10cSrcweir #endif //INCLUDED_DRAWINGLAYER_GEOMETRY_VIEWINFORMATION2D_HXX
179cdf0e10cSrcweir 
180cdf0e10cSrcweir // eof
181