1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVX_IACCESSIBLEVIEWFORWARDER_HXX
21 #define INCLUDED_SVX_IACCESSIBLEVIEWFORWARDER_HXX
23 #include <sal/types.h>
24 #include <tools/gen.hxx>
27 namespace accessibility
{
31 /** <p>This interface provides the means to transform between internal
32 coordinates in 100th of mm and screen coordinates without giving direct
33 access to the underlying view. Each view forwarder represents a
34 specific real or virtual window. A call to
35 <method>GetVisibleArea</method> returns the visible rectangle that
36 corresponds to this window.</p>
38 <p>This interface is similar to the SvxViewForwarder but
39 differs in two important points: Firstly the <member>GetVisArea</member>
40 method returns a rectangle in internal coordinates and secondly the
41 transformation methods do not require explicit mapmodes. These have to
42 be provided implicitly by the classes that implement this
43 interface. A third, less important, difference are the additional
44 transfomation methods for sizes. The reasons for their existence are
45 convenience and improved performance.</p>
48 Note, that modifications of the underlying view that lead to
49 different transformations between internal and screen coordinates or
50 change the validity of the forwarder have to be signaled separately.
52 class IAccessibleViewForwarder
55 virtual ~IAccessibleViewForwarder(){};
57 /** This method informs you about the state of the forwarder. Do not
58 use it when the returned value is <false/>.
61 Return <true/> if the view forwarder is valid and <false/> else.
63 virtual bool IsValid() const = 0;
65 /** Returns the area of the underlying document that is visible in the
66 * corresponding window.
69 The rectangle of the visible part of the document. The values
70 are, contrary to the base class, in internal coordinates of
73 virtual Rectangle
GetVisibleArea() const = 0;
75 /** Transform the specified point from internal coordinates in 100th of
76 mm to an absolute screen position.
79 Point in internal coordinates (100th of mm).
82 The same point but in screen coordinates relative to the upper
83 left corner of the (current) screen.
85 virtual Point
LogicToPixel (const Point
& rPoint
) const = 0;
87 /** Transform the specified size from internal coordinates in 100th of
88 mm to a screen oriented pixel size.
91 Size in internal coordinates (100th of mm).
94 The same size but in screen coordinates.
96 virtual Size
LogicToPixel (const Size
& rSize
) const = 0;
98 /** Transform the specified point from absolute screen coordinates to
99 internal coordinates (100th of mm).
102 Point in screen coordinates relative to the upper left corner of
103 the (current) screen.
106 The same point but in internal coordinates (100th of mm).
108 virtual Point
PixelToLogic (const Point
& rPoint
) const = 0;
110 /** Transform the specified size from screen coordinates to internal
111 coordinates (100th of mm).
114 Size in screen coordinates.
117 The same size but in internal coordinates (100th of mm).
119 virtual Size
PixelToLogic (const Size
& rSize
) const = 0;
122 } // end of namespace accessibility
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */