13334a7e6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 33334a7e6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 43334a7e6SAndrew Rist * or more contributor license agreements. See the NOTICE file 53334a7e6SAndrew Rist * distributed with this work for additional information 63334a7e6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 73334a7e6SAndrew Rist * to you under the Apache License, Version 2.0 (the 83334a7e6SAndrew Rist * "License"); you may not use this file except in compliance 93334a7e6SAndrew Rist * with the License. You may obtain a copy of the License at 103334a7e6SAndrew Rist * 113334a7e6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 123334a7e6SAndrew Rist * 133334a7e6SAndrew Rist * Unless required by applicable law or agreed to in writing, 143334a7e6SAndrew Rist * software distributed under the License is distributed on an 153334a7e6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 163334a7e6SAndrew Rist * KIND, either express or implied. See the License for the 173334a7e6SAndrew Rist * specific language governing permissions and limitations 183334a7e6SAndrew Rist * under the License. 193334a7e6SAndrew Rist * 203334a7e6SAndrew Rist *************************************************************/ 213334a7e6SAndrew Rist 223334a7e6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _SVX_ACCESSIBILITY_IACCESSIBLE_VIEW_FORWARDER_HXX 25cdf0e10cSrcweir #define _SVX_ACCESSIBILITY_IACCESSIBLE_VIEW_FORWARDER_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <sal/types.h> 28cdf0e10cSrcweir #include <tools/gen.hxx> 29cdf0e10cSrcweir 30cdf0e10cSrcweir 31cdf0e10cSrcweir namespace accessibility { 32cdf0e10cSrcweir 33cdf0e10cSrcweir 34cdf0e10cSrcweir 35cdf0e10cSrcweir /** <p>This interface provides the means to transform between internal 36cdf0e10cSrcweir coordinates in 100th of mm and screen coordinates without giving direct 37cdf0e10cSrcweir access to the underlying view. Each view forwarder represents a 38cdf0e10cSrcweir specific real or virtual window. A call to 39cdf0e10cSrcweir <method>GetVisibleArea</method> returns the visible rectangle that 40cdf0e10cSrcweir corresponds to this window.</p> 41cdf0e10cSrcweir 42cdf0e10cSrcweir <p>This interface is similar to the <type>SvxViewForwarder</type> but 43cdf0e10cSrcweir differs in two important points: Firstly the <member>GetVisArea</member> 44cdf0e10cSrcweir method returns a rectangle in internal coordinates and secondly the 45cdf0e10cSrcweir transformation methods do not require explicit mapmodes. These have to 46*c47da6eaSmseidel be provided implicitly by the classes that implement this 47cdf0e10cSrcweir interface. A third, less important, difference are the additional 4886e1cf34SPedro Giffuni transfomation methods for sizes. The reasons for their existence are 49cdf0e10cSrcweir convenience and improved performance.</p> 50cdf0e10cSrcweir 51cdf0e10cSrcweir @attention 52cdf0e10cSrcweir Note, that modifications of the underlying view that lead to 53cdf0e10cSrcweir different transformations between internal and screen coordinates or 5486e1cf34SPedro Giffuni change the validity of the forwarder have to be signaled separately. 55cdf0e10cSrcweir */ 56cdf0e10cSrcweir class IAccessibleViewForwarder 57cdf0e10cSrcweir { 58cdf0e10cSrcweir public: ~IAccessibleViewForwarder(void)59cdf0e10cSrcweir virtual ~IAccessibleViewForwarder (void){}; 60cdf0e10cSrcweir 61cdf0e10cSrcweir /** This method informs you about the state of the forwarder. Do not 62cdf0e10cSrcweir use it when the returned value is <false/>. 63cdf0e10cSrcweir 64cdf0e10cSrcweir @return 65cdf0e10cSrcweir Return <true/> if the view forwarder is valid and <false/> else. 66cdf0e10cSrcweir */ 67cdf0e10cSrcweir virtual sal_Bool IsValid (void) const = 0; 68cdf0e10cSrcweir 69cdf0e10cSrcweir /** Returns the area of the underlying document that is visible in the 70cdf0e10cSrcweir * corresponding window. 71cdf0e10cSrcweir 72cdf0e10cSrcweir @return 73cdf0e10cSrcweir The rectangle of the visible part of the document. The values 74cdf0e10cSrcweir are, contrary to the base class, in internal coordinates of 75cdf0e10cSrcweir 100th of mm. 76cdf0e10cSrcweir */ 77cdf0e10cSrcweir virtual Rectangle GetVisibleArea() const = 0; 78cdf0e10cSrcweir 79cdf0e10cSrcweir /** Transform the specified point from internal coordinates in 100th of 80cdf0e10cSrcweir mm to an absolute screen position. 81cdf0e10cSrcweir 82cdf0e10cSrcweir @param rPoint 83cdf0e10cSrcweir Point in internal coordinates (100th of mm). 84cdf0e10cSrcweir 85cdf0e10cSrcweir @return 86cdf0e10cSrcweir The same point but in screen coordinates relative to the upper 87cdf0e10cSrcweir left corner of the (current) screen. 88cdf0e10cSrcweir */ 89cdf0e10cSrcweir virtual Point LogicToPixel (const Point& rPoint) const = 0; 90cdf0e10cSrcweir 91cdf0e10cSrcweir /** Transform the specified size from internal coordinates in 100th of 92cdf0e10cSrcweir mm to a screen oriented pixel size. 93cdf0e10cSrcweir 94cdf0e10cSrcweir @param rSize 95cdf0e10cSrcweir Size in internal coordinates (100th of mm). 96cdf0e10cSrcweir 97cdf0e10cSrcweir @return 98cdf0e10cSrcweir The same size but in screen coordinates. 99cdf0e10cSrcweir */ 100cdf0e10cSrcweir virtual Size LogicToPixel (const Size& rSize) const = 0; 101cdf0e10cSrcweir 102cdf0e10cSrcweir /** Transform the specified point from absolute screen coordinates to 103cdf0e10cSrcweir internal coordinates (100th of mm). 104cdf0e10cSrcweir 105cdf0e10cSrcweir @param rPoint 106cdf0e10cSrcweir Point in screen coordinates relative to the upper left corner of 107cdf0e10cSrcweir the (current) screen. 108cdf0e10cSrcweir 109cdf0e10cSrcweir @return 110cdf0e10cSrcweir The same point but in internal coordinates (100th of mm). 111cdf0e10cSrcweir */ 112cdf0e10cSrcweir virtual Point PixelToLogic (const Point& rPoint) const = 0; 113cdf0e10cSrcweir 114cdf0e10cSrcweir /** Transform the specified size from screen coordinates to internal 115cdf0e10cSrcweir coordinates (100th of mm). 116cdf0e10cSrcweir 117cdf0e10cSrcweir @param rSize 118cdf0e10cSrcweir Size in screen coordinates. 119cdf0e10cSrcweir 120cdf0e10cSrcweir @return 121cdf0e10cSrcweir The same size but in internal coordinates (100th of mm). 122cdf0e10cSrcweir */ 123cdf0e10cSrcweir virtual Size PixelToLogic (const Size& rSize) const = 0; 124cdf0e10cSrcweir }; 125cdf0e10cSrcweir 126cdf0e10cSrcweir } // end of namespace accessibility 127cdf0e10cSrcweir 128cdf0e10cSrcweir #endif 129