update dev300-m58
[ooovba.git] / sd / source / ui / inc / AccessibleViewForwarder.hxx
blob7ae006cb023f3b34df73fad08dfa85fe381c6752
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AccessibleViewForwarder.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SD_ACCESSIBILITY_ACCESSIBLE_VIEW_FORWARDER_HXX
32 #define _SD_ACCESSIBILITY_ACCESSIBLE_VIEW_FORWARDER_HXX
34 #include <svx/IAccessibleViewForwarder.hxx>
36 class SdrPaintView;
37 class OutputDevice;
39 namespace accessibility {
42 /** <p>This class provides the means to transform between internal coordinates
43 and screen coordinates without giving direct access to the underlying
44 view. It represents a certain window. A call to
45 <method>GetVisArea</method> returns the corresponding visible
46 rectangle.</p>
48 @attention
49 Note, that modifications of the underlying view that lead to
50 different transformations between internal and screen coordinates or
51 change the validity of the forwarder have to be signaled seperately.
53 class AccessibleViewForwarder
54 : public IAccessibleViewForwarder
56 public:
57 //===== internal ========================================================
59 AccessibleViewForwarder (SdrPaintView* pView, USHORT nWindowId);
60 AccessibleViewForwarder (SdrPaintView* pView, OutputDevice& rDevice);
62 virtual ~AccessibleViewForwarder (void);
64 void SetView (SdrPaintView* pView);
66 //===== IAccessibleViewforwarder ========================================
68 /** This method informs you about the state of the forwarder. Do not
69 use it when the returned value is <false/>.
71 @return
72 Return <true/> if the view forwarder is valid and <false/> else.
74 virtual BOOL IsValid (void) const;
76 /** Returns the area of the underlying document that is visible in the
77 * corresponding window.
79 @return
80 The rectangle of the visible part of the document.
82 virtual Rectangle GetVisibleArea() const;
84 /** Transform the specified point from internal coordinates to an
85 absolute screen position.
87 @param rPoint
88 Point in internal coordinates.
90 @return
91 The same point but in screen coordinates relative to the upper
92 left corner of the (current) screen.
94 virtual Point LogicToPixel (const Point& rPoint) const;
96 /** Transform the specified size from internal coordinates to a screen
97 * position.
99 @param rSize
100 Size in internal coordinates.
102 @return
103 The same size but in screen coordinates.
105 virtual Size LogicToPixel (const Size& rSize) const;
107 /** Transform the specified point from absolute screen coordinates to
108 internal coordinates.
110 @param rPoint
111 Point in screen coordinates relative to the upper left corner of
112 the (current) screen.
114 @return
115 The same point but in internal coordinates.
117 virtual Point PixelToLogic (const Point& rPoint) const;
119 /** Transform the specified Size from screen coordinates to internal
120 coordinates.
122 @param rSize
123 Size in screen coordinates.
125 @return
126 The same size but in internal coordinates.
128 virtual Size PixelToLogic (const Size& rSize) const;
130 protected:
131 SdrPaintView* mpView;
132 USHORT mnWindowId;
133 OutputDevice& mrDevice;
135 private:
136 AccessibleViewForwarder (AccessibleViewForwarder&);
137 AccessibleViewForwarder& operator= (AccessibleViewForwarder&);
140 } // end of namespace accessibility
142 #endif