xref: /AOO41X/main/sd/source/ui/inc/AccessibleViewForwarder.hxx (revision 67e470dafe1997e73f56ff7ff4878983707e3e07)
1*c45d927aSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*c45d927aSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*c45d927aSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*c45d927aSAndrew Rist  * distributed with this work for additional information
6*c45d927aSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*c45d927aSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*c45d927aSAndrew Rist  * "License"); you may not use this file except in compliance
9*c45d927aSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*c45d927aSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*c45d927aSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*c45d927aSAndrew Rist  * software distributed under the License is distributed on an
15*c45d927aSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c45d927aSAndrew Rist  * KIND, either express or implied.  See the License for the
17*c45d927aSAndrew Rist  * specific language governing permissions and limitations
18*c45d927aSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*c45d927aSAndrew Rist  *************************************************************/
21*c45d927aSAndrew Rist 
22*c45d927aSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SD_ACCESSIBILITY_ACCESSIBLE_VIEW_FORWARDER_HXX
25cdf0e10cSrcweir #define _SD_ACCESSIBILITY_ACCESSIBLE_VIEW_FORWARDER_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svx/IAccessibleViewForwarder.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir class SdrPaintView;
30cdf0e10cSrcweir class OutputDevice;
31cdf0e10cSrcweir 
32cdf0e10cSrcweir namespace accessibility {
33cdf0e10cSrcweir 
34cdf0e10cSrcweir 
35cdf0e10cSrcweir /**	<p>This class provides the means to transform between internal coordinates
36cdf0e10cSrcweir     and screen coordinates without giving direct access to the underlying
37cdf0e10cSrcweir     view.  It represents a certain window.  A call to
38cdf0e10cSrcweir     <method>GetVisArea</method> returns the corresponding visible
39cdf0e10cSrcweir     rectangle.</p>
40cdf0e10cSrcweir 
41cdf0e10cSrcweir     @attention
42cdf0e10cSrcweir         Note, that modifications of the underlying view that lead to
43cdf0e10cSrcweir         different transformations between internal and screen coordinates or
44cdf0e10cSrcweir         change the validity of the forwarder have to be signaled seperately.
45cdf0e10cSrcweir */
46cdf0e10cSrcweir class AccessibleViewForwarder
47cdf0e10cSrcweir     :	public IAccessibleViewForwarder
48cdf0e10cSrcweir {
49cdf0e10cSrcweir public:
50cdf0e10cSrcweir     //=====  internal  ========================================================
51cdf0e10cSrcweir 
52cdf0e10cSrcweir     AccessibleViewForwarder (SdrPaintView* pView, OutputDevice& rDevice);
53cdf0e10cSrcweir 
54cdf0e10cSrcweir 	virtual ~AccessibleViewForwarder (void);
55cdf0e10cSrcweir 
56cdf0e10cSrcweir     //=====  IAccessibleViewforwarder  ========================================
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     /** This method informs you about the state of the forwarder.  Do not
59cdf0e10cSrcweir         use it when the returned value is <false/>.
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     	@return
62cdf0e10cSrcweir             Return <true/> if the view forwarder is valid and <false/> else.
63cdf0e10cSrcweir      */
64cdf0e10cSrcweir 	virtual sal_Bool IsValid (void) const;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir     /** Returns the area of the underlying document that is visible in the
67cdf0e10cSrcweir     * corresponding window.
68cdf0e10cSrcweir 
69cdf0e10cSrcweir     	@return
70cdf0e10cSrcweir             The rectangle of the visible part of the document.
71cdf0e10cSrcweir      */
72cdf0e10cSrcweir     virtual Rectangle GetVisibleArea() const;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     /** Transform the specified point from internal coordinates to an
75cdf0e10cSrcweir         absolute screen position.
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     	@param rPoint
78cdf0e10cSrcweir             Point in internal coordinates.
79cdf0e10cSrcweir 
80cdf0e10cSrcweir         @return
81cdf0e10cSrcweir             The same point but in screen coordinates relative to the upper
82cdf0e10cSrcweir             left corner of the (current) screen.
83cdf0e10cSrcweir      */
84cdf0e10cSrcweir     virtual Point LogicToPixel (const Point& rPoint) const;
85cdf0e10cSrcweir 
86cdf0e10cSrcweir     /** Transform the specified size from internal coordinates to a screen
87cdf0e10cSrcweir     * position.
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     	@param rSize
90cdf0e10cSrcweir             Size in internal coordinates.
91cdf0e10cSrcweir 
92cdf0e10cSrcweir         @return
93cdf0e10cSrcweir             The same size but in screen coordinates.
94cdf0e10cSrcweir      */
95cdf0e10cSrcweir     virtual Size LogicToPixel (const Size& rSize) const;
96cdf0e10cSrcweir 
97cdf0e10cSrcweir     /** Transform the specified point from absolute screen coordinates to
98cdf0e10cSrcweir         internal coordinates.
99cdf0e10cSrcweir 
100cdf0e10cSrcweir     	@param rPoint
101cdf0e10cSrcweir             Point in screen coordinates relative to the upper left corner of
102cdf0e10cSrcweir             the (current) screen.
103cdf0e10cSrcweir 
104cdf0e10cSrcweir         @return
105cdf0e10cSrcweir             The same point but in internal coordinates.
106cdf0e10cSrcweir      */
107cdf0e10cSrcweir     virtual Point PixelToLogic (const Point& rPoint) const;
108cdf0e10cSrcweir 
109cdf0e10cSrcweir     /** Transform the specified Size from screen coordinates to internal
110cdf0e10cSrcweir         coordinates.
111cdf0e10cSrcweir 
112cdf0e10cSrcweir     	@param rSize
113cdf0e10cSrcweir             Size in screen coordinates.
114cdf0e10cSrcweir 
115cdf0e10cSrcweir         @return
116cdf0e10cSrcweir             The same size but in internal coordinates.
117cdf0e10cSrcweir      */
118cdf0e10cSrcweir     virtual Size PixelToLogic (const Size& rSize) const;
119cdf0e10cSrcweir 
120cdf0e10cSrcweir protected:
121cdf0e10cSrcweir     SdrPaintView* mpView;
122cdf0e10cSrcweir     sal_uInt16 mnWindowId;
123cdf0e10cSrcweir     OutputDevice& mrDevice;
124cdf0e10cSrcweir 
125cdf0e10cSrcweir private:
126cdf0e10cSrcweir     AccessibleViewForwarder (AccessibleViewForwarder&);
127cdf0e10cSrcweir     AccessibleViewForwarder& operator= (AccessibleViewForwarder&);
128cdf0e10cSrcweir };
129cdf0e10cSrcweir 
130cdf0e10cSrcweir } // end of namespace accessibility
131cdf0e10cSrcweir 
132cdf0e10cSrcweir #endif
133