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