10841af79SAndrew Rist /**************************************************************
2*09e0ec10Smseidel  *
30841af79SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
40841af79SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
50841af79SAndrew Rist  * distributed with this work for additional information
60841af79SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
70841af79SAndrew Rist  * to you under the Apache License, Version 2.0 (the
80841af79SAndrew Rist  * "License"); you may not use this file except in compliance
90841af79SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*09e0ec10Smseidel  *
110841af79SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*09e0ec10Smseidel  *
130841af79SAndrew Rist  * Unless required by applicable law or agreed to in writing,
140841af79SAndrew Rist  * software distributed under the License is distributed on an
150841af79SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
160841af79SAndrew Rist  * KIND, either express or implied.  See the License for the
170841af79SAndrew Rist  * specific language governing permissions and limitations
180841af79SAndrew Rist  * under the License.
19*09e0ec10Smseidel  *
200841af79SAndrew Rist  *************************************************************/
210841af79SAndrew Rist 
220841af79SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_accessibility.hxx"
26cdf0e10cSrcweir #include <accessibility/standard/vclxaccessiblepopupmenu.hxx>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleRole.hpp>
29cdf0e10cSrcweir #include <vcl/svapp.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir using namespace ::com::sun::star::accessibility;
32cdf0e10cSrcweir using namespace ::com::sun::star::uno;
33cdf0e10cSrcweir using namespace ::comphelper;
34cdf0e10cSrcweir 
35cdf0e10cSrcweir 
36cdf0e10cSrcweir // -----------------------------------------------------------------------------
37cdf0e10cSrcweir // class VCLXAccessiblePopupMenu
38cdf0e10cSrcweir // -----------------------------------------------------------------------------
39cdf0e10cSrcweir 
VCLXAccessiblePopupMenu(Menu * pMenu)40cdf0e10cSrcweir VCLXAccessiblePopupMenu::VCLXAccessiblePopupMenu( Menu* pMenu )
41cdf0e10cSrcweir 	:OAccessibleMenuComponent( pMenu )
42cdf0e10cSrcweir {
43cdf0e10cSrcweir }
44cdf0e10cSrcweir 
45cdf0e10cSrcweir // -----------------------------------------------------------------------------
46cdf0e10cSrcweir 
~VCLXAccessiblePopupMenu()47cdf0e10cSrcweir VCLXAccessiblePopupMenu::~VCLXAccessiblePopupMenu()
48cdf0e10cSrcweir {
49cdf0e10cSrcweir }
50cdf0e10cSrcweir 
51cdf0e10cSrcweir // -----------------------------------------------------------------------------
52cdf0e10cSrcweir 
IsFocused()53cdf0e10cSrcweir sal_Bool VCLXAccessiblePopupMenu::IsFocused()
54*09e0ec10Smseidel {
55*09e0ec10Smseidel 	return !IsChildHighlighted();
56cdf0e10cSrcweir }
57cdf0e10cSrcweir 
58cdf0e10cSrcweir // -----------------------------------------------------------------------------
59cdf0e10cSrcweir // XServiceInfo
60cdf0e10cSrcweir // -----------------------------------------------------------------------------
61cdf0e10cSrcweir 
getImplementationName()62cdf0e10cSrcweir ::rtl::OUString VCLXAccessiblePopupMenu::getImplementationName() throw (RuntimeException)
63cdf0e10cSrcweir {
64cdf0e10cSrcweir 	return ::rtl::OUString::createFromAscii( "com.sun.star.comp.toolkit.AccessiblePopupMenu" );
65cdf0e10cSrcweir }
66cdf0e10cSrcweir 
67cdf0e10cSrcweir // -----------------------------------------------------------------------------
68cdf0e10cSrcweir 
getSupportedServiceNames()69cdf0e10cSrcweir Sequence< ::rtl::OUString > VCLXAccessiblePopupMenu::getSupportedServiceNames() throw (RuntimeException)
70cdf0e10cSrcweir {
71cdf0e10cSrcweir 	Sequence< ::rtl::OUString > aNames(1);
72cdf0e10cSrcweir 	aNames[0] = ::rtl::OUString::createFromAscii( "com.sun.star.awt.AccessiblePopupMenu" );
73cdf0e10cSrcweir 	return aNames;
74cdf0e10cSrcweir }
75cdf0e10cSrcweir 
76cdf0e10cSrcweir // -----------------------------------------------------------------------------
77cdf0e10cSrcweir // XAccessibleContext
78cdf0e10cSrcweir // -----------------------------------------------------------------------------
79cdf0e10cSrcweir 
getAccessibleIndexInParent()80cdf0e10cSrcweir sal_Int32 VCLXAccessiblePopupMenu::getAccessibleIndexInParent(  ) throw (RuntimeException)
81cdf0e10cSrcweir {
82cdf0e10cSrcweir 	OExternalLockGuard aGuard( this );
83cdf0e10cSrcweir 
84*09e0ec10Smseidel 	return 0;
85cdf0e10cSrcweir }
86cdf0e10cSrcweir 
87cdf0e10cSrcweir // -----------------------------------------------------------------------------
88cdf0e10cSrcweir 
getAccessibleRole()89cdf0e10cSrcweir sal_Int16 VCLXAccessiblePopupMenu::getAccessibleRole(  ) throw (RuntimeException)
90cdf0e10cSrcweir {
91cdf0e10cSrcweir 	OExternalLockGuard aGuard( this );
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 	return AccessibleRole::POPUP_MENU;
94cdf0e10cSrcweir }
95cdf0e10cSrcweir 
96cdf0e10cSrcweir // -----------------------------------------------------------------------------
97cdf0e10cSrcweir // XAccessibleExtendedComponent
98cdf0e10cSrcweir // -----------------------------------------------------------------------------
99cdf0e10cSrcweir 
getBackground()100cdf0e10cSrcweir sal_Int32 VCLXAccessiblePopupMenu::getBackground(  ) throw (RuntimeException)
101cdf0e10cSrcweir {
102cdf0e10cSrcweir 	OExternalLockGuard aGuard( this );
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 	return Application::GetSettings().GetStyleSettings().GetMenuColor().GetColor();
105cdf0e10cSrcweir }
106cdf0e10cSrcweir 
107cdf0e10cSrcweir // -----------------------------------------------------------------------------
108