vclxaccessiblemenu.cxx (21075d77) vclxaccessiblemenu.cxx (15466770)
1/**************************************************************
1/**************************************************************
2 *
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
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 *
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
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.
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 *
19 *
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_accessibility.hxx"
26
27// includes --------------------------------------------------------------

--- 24 unchanged lines hidden (view full) ---

52VCLXAccessibleMenu::~VCLXAccessibleMenu()
53{
54}
55
56// -----------------------------------------------------------------------------
57
58sal_Bool VCLXAccessibleMenu::IsFocused()
59{
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_accessibility.hxx"
26
27// includes --------------------------------------------------------------

--- 24 unchanged lines hidden (view full) ---

52VCLXAccessibleMenu::~VCLXAccessibleMenu()
53{
54}
55
56// -----------------------------------------------------------------------------
57
58sal_Bool VCLXAccessibleMenu::IsFocused()
59{
60 sal_Bool bFocused = sal_False;
60 sal_Bool bFocused = sal_False;
61
61
62 if ( IsHighlighted() && !IsChildHighlighted() )
63 bFocused = sal_True;
62 if ( IsHighlighted() && !IsChildHighlighted() )
63 bFocused = sal_True;
64
64
65 return bFocused;
65 return bFocused;
66}
67
68// -----------------------------------------------------------------------------
69
70sal_Bool VCLXAccessibleMenu::IsPopupMenuOpen()
71{
66}
67
68// -----------------------------------------------------------------------------
69
70sal_Bool VCLXAccessibleMenu::IsPopupMenuOpen()
71{
72 sal_Bool bPopupMenuOpen = sal_False;
72 sal_Bool bPopupMenuOpen = sal_False;
73
73
74 if ( m_pParent )
75 {
76 PopupMenu* pPopupMenu = m_pParent->GetPopupMenu( m_pParent->GetItemId( m_nItemPos ) );
77 if ( pPopupMenu && pPopupMenu->IsMenuVisible() )
78 bPopupMenuOpen = sal_True;
79 }
74 if ( m_pParent )
75 {
76 PopupMenu* pPopupMenu = m_pParent->GetPopupMenu( m_pParent->GetItemId( m_nItemPos ) );
77 if ( pPopupMenu && pPopupMenu->IsMenuVisible() )
78 bPopupMenuOpen = sal_True;
79 }
80
80
81 return bPopupMenuOpen;
81 return bPopupMenuOpen;
82}
83
84// -----------------------------------------------------------------------------
85// XInterface
86// -----------------------------------------------------------------------------
87
88IMPLEMENT_FORWARD_XINTERFACE2( VCLXAccessibleMenu, VCLXAccessibleMenuItem, VCLXAccessibleMenu_BASE )
89

--- 24 unchanged lines hidden (view full) ---

114// -----------------------------------------------------------------------------
115// XAccessibleContext
116// -----------------------------------------------------------------------------
117
118sal_Int32 VCLXAccessibleMenu::getAccessibleChildCount( ) throw (RuntimeException)
119{
120 OExternalLockGuard aGuard( this );
121
82}
83
84// -----------------------------------------------------------------------------
85// XInterface
86// -----------------------------------------------------------------------------
87
88IMPLEMENT_FORWARD_XINTERFACE2( VCLXAccessibleMenu, VCLXAccessibleMenuItem, VCLXAccessibleMenu_BASE )
89

--- 24 unchanged lines hidden (view full) ---

114// -----------------------------------------------------------------------------
115// XAccessibleContext
116// -----------------------------------------------------------------------------
117
118sal_Int32 VCLXAccessibleMenu::getAccessibleChildCount( ) throw (RuntimeException)
119{
120 OExternalLockGuard aGuard( this );
121
122 return GetChildCount();
122 return GetChildCount();
123}
124
125// -----------------------------------------------------------------------------
126
127Reference< XAccessible > VCLXAccessibleMenu::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException, RuntimeException)
128{
129 OExternalLockGuard aGuard( this );
130

--- 35 unchanged lines hidden (view full) ---

166 throw IndexOutOfBoundsException();
167
168 SelectChild( nChildIndex );
169}
170
171// -----------------------------------------------------------------------------
172
173sal_Bool VCLXAccessibleMenu::isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
123}
124
125// -----------------------------------------------------------------------------
126
127Reference< XAccessible > VCLXAccessibleMenu::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException, RuntimeException)
128{
129 OExternalLockGuard aGuard( this );
130

--- 35 unchanged lines hidden (view full) ---

166 throw IndexOutOfBoundsException();
167
168 SelectChild( nChildIndex );
169}
170
171// -----------------------------------------------------------------------------
172
173sal_Bool VCLXAccessibleMenu::isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
174{
174{
175 OExternalLockGuard aGuard( this );
176
177 if ( nChildIndex < 0 || nChildIndex >= GetChildCount() )
178 throw IndexOutOfBoundsException();
179
175 OExternalLockGuard aGuard( this );
176
177 if ( nChildIndex < 0 || nChildIndex >= GetChildCount() )
178 throw IndexOutOfBoundsException();
179
180 return IsChildSelected( nChildIndex );
180 return IsChildSelected( nChildIndex );
181}
182
183// -----------------------------------------------------------------------------
184
185void VCLXAccessibleMenu::clearAccessibleSelection( ) throw (RuntimeException)
186{
187 OExternalLockGuard aGuard( this );
188

--- 11 unchanged lines hidden (view full) ---

200
201sal_Int32 VCLXAccessibleMenu::getSelectedAccessibleChildCount( ) throw (RuntimeException)
202{
203 OExternalLockGuard aGuard( this );
204
205 sal_Int32 nRet = 0;
206
207 for ( sal_Int32 i = 0, nCount = GetChildCount(); i < nCount; i++ )
181}
182
183// -----------------------------------------------------------------------------
184
185void VCLXAccessibleMenu::clearAccessibleSelection( ) throw (RuntimeException)
186{
187 OExternalLockGuard aGuard( this );
188

--- 11 unchanged lines hidden (view full) ---

200
201sal_Int32 VCLXAccessibleMenu::getSelectedAccessibleChildCount( ) throw (RuntimeException)
202{
203 OExternalLockGuard aGuard( this );
204
205 sal_Int32 nRet = 0;
206
207 for ( sal_Int32 i = 0, nCount = GetChildCount(); i < nCount; i++ )
208 {
208 {
209 if ( IsChildSelected( i ) )
210 ++nRet;
211 }
212
213 return nRet;
214}
215
216// -----------------------------------------------------------------------------
217
218Reference< XAccessible > VCLXAccessibleMenu::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
219{
220 OExternalLockGuard aGuard( this );
221
222 if ( nSelectedChildIndex < 0 || nSelectedChildIndex >= getSelectedAccessibleChildCount() )
223 throw IndexOutOfBoundsException();
224
225 Reference< XAccessible > xChild;
226
227 for ( sal_Int32 i = 0, j = 0, nCount = GetChildCount(); i < nCount; i++ )
209 if ( IsChildSelected( i ) )
210 ++nRet;
211 }
212
213 return nRet;
214}
215
216// -----------------------------------------------------------------------------
217
218Reference< XAccessible > VCLXAccessibleMenu::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
219{
220 OExternalLockGuard aGuard( this );
221
222 if ( nSelectedChildIndex < 0 || nSelectedChildIndex >= getSelectedAccessibleChildCount() )
223 throw IndexOutOfBoundsException();
224
225 Reference< XAccessible > xChild;
226
227 for ( sal_Int32 i = 0, j = 0, nCount = GetChildCount(); i < nCount; i++ )
228 {
228 {
229 if ( IsChildSelected( i ) && ( j++ == nSelectedChildIndex ) )
230 {
231 xChild = GetChild( i );
232 break;
233 }
234 }
235
236 return xChild;

--- 13 unchanged lines hidden (view full) ---

250
251// -----------------------------------------------------------------------------
252
253::rtl::OUString VCLXAccessibleMenu::getAccessibleActionDescription ( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
254{
255 OExternalLockGuard aGuard( this );
256
257 if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
229 if ( IsChildSelected( i ) && ( j++ == nSelectedChildIndex ) )
230 {
231 xChild = GetChild( i );
232 break;
233 }
234 }
235
236 return xChild;

--- 13 unchanged lines hidden (view full) ---

250
251// -----------------------------------------------------------------------------
252
253::rtl::OUString VCLXAccessibleMenu::getAccessibleActionDescription ( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
254{
255 OExternalLockGuard aGuard( this );
256
257 if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
258 throw IndexOutOfBoundsException();
258 throw IndexOutOfBoundsException();
259
260 return ::rtl::OUString( );
261}
259
260 return ::rtl::OUString( );
261}
262