LibreOffice Module comphelper (master) 1
accessiblecomponenthelper.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
21
22
23namespace comphelper
24{
25
26
27 using namespace ::com::sun::star;
28 using namespace ::com::sun::star::uno;
29 using namespace ::com::sun::star::lang;
30 using namespace ::com::sun::star::accessibility;
31
33 {
34 }
35
36
38 {
39 }
40
41
42 bool OCommonAccessibleComponent::containsPoint( const awt::Point& _rPoint )
43 {
44 OExternalLockGuard aGuard( this );
45 awt::Rectangle aBounds( implGetBounds() );
46 return ( _rPoint.X >= 0 )
47 && ( _rPoint.Y >= 0 )
48 && ( _rPoint.X < aBounds.Width )
49 && ( _rPoint.Y < aBounds.Height );
50 }
51
52
54 {
55 OExternalLockGuard aGuard( this );
56 awt::Rectangle aBounds( implGetBounds() );
57 return awt::Point( aBounds.X, aBounds.Y );
58 }
59
60
62 {
63 OExternalLockGuard aGuard( this );
64
65 awt::Point aScreenLoc( 0, 0 );
66
67 Reference< XAccessibleComponent > xParentComponent( implGetParentContext(), UNO_QUERY );
68 OSL_ENSURE( xParentComponent.is(), "OCommonAccessibleComponent::getLocationOnScreen: no parent component!" );
69 if ( xParentComponent.is() )
70 {
71 awt::Point aParentScreenLoc( xParentComponent->getLocationOnScreen() );
72 awt::Point aOwnRelativeLoc( getLocation() );
73 aScreenLoc.X = aParentScreenLoc.X + aOwnRelativeLoc.X;
74 aScreenLoc.Y = aParentScreenLoc.Y + aOwnRelativeLoc.Y;
75 }
76
77 return aScreenLoc;
78 }
79
80
82 {
83 OExternalLockGuard aGuard( this );
84 awt::Rectangle aBounds( implGetBounds() );
85 return awt::Size( aBounds.Width, aBounds.Height );
86 }
87
88
90 {
91 OExternalLockGuard aGuard( this );
92 return implGetBounds();
93 }
94
96 {
97 }
98
99
102 // (order matters: the first is the class name, the second is the class doing the ref counting)
103
104
105 sal_Bool SAL_CALL OAccessibleComponentHelper::containsPoint( const awt::Point& _rPoint )
106 {
108 }
109
110
112 {
114 }
115
116
118 {
120 }
121
122
124 {
126 }
127
128
129 awt::Rectangle SAL_CALL OAccessibleComponentHelper::getBounds( )
130 {
132 }
133
135 {
136 }
137
138
141 // (order matters: the first is the class name, the second is the class doing the ref counting)
142
143
144 sal_Bool SAL_CALL OAccessibleExtendedComponentHelper::containsPoint( const awt::Point& _rPoint )
145 {
147 }
148
149
151 {
153 }
154
155
157 {
159 }
160
161
163 {
165 }
166
167
169 {
171 }
172
173
174} // namespace comphelper
175
176
177/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
a helper class for implementing an AccessibleContext which at the same time supports an XAccessibleCo...
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual css::awt::Size SAL_CALL getSize() override
virtual css::awt::Point SAL_CALL getLocation() override
virtual css::awt::Rectangle SAL_CALL getBounds() override
css::uno::Reference< css::accessibility::XAccessibleContext > implGetParentContext()
shortcut for retrieving the context of the parent (returned by getAccessibleParent)
a helper class for implementing an AccessibleContext which at the same time supports an XAccessibleEx...
virtual css::awt::Point SAL_CALL getLocation() override
virtual css::awt::Rectangle SAL_CALL getBounds() override
virtual css::awt::Size SAL_CALL getSize() override
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
base class encapsulating common functionality for the helper classes implementing the XAccessibleComp...
virtual css::awt::Rectangle implGetBounds()=0
implements the calculation of the bounding rectangle - still waiting to be overwritten
bool containsPoint(const css::awt::Point &aPoint)
non-virtual versions of the methods which can be implemented using <method>implGetBounds</method> not...
OCommonAccessibleComponent()
see the respective base class ctor for an extensive comment on this, please
unsigned char sal_Bool
#define IMPLEMENT_FORWARD_XTYPEPROVIDER2(classname, baseclass1, baseclass2)
Definition: uno3.hxx:136
#define IMPLEMENT_FORWARD_XINTERFACE2(classname, refcountbase, baseclass2)
Definition: uno3.hxx:99