merged tag ooo/DEV300_m102
[LibreOffice.git] / accessibility / source / standard / vclxaccessiblepopupmenu.cxx
blob328e015c60e506ec42341fb20564dcfe9d9b56aa
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_accessibility.hxx"
30 #include <accessibility/standard/vclxaccessiblepopupmenu.hxx>
32 #include <com/sun/star/accessibility/AccessibleRole.hpp>
33 #include <vcl/svapp.hxx>
35 using namespace ::com::sun::star::accessibility;
36 using namespace ::com::sun::star::uno;
37 using namespace ::comphelper;
40 // -----------------------------------------------------------------------------
41 // class VCLXAccessiblePopupMenu
42 // -----------------------------------------------------------------------------
44 VCLXAccessiblePopupMenu::VCLXAccessiblePopupMenu( Menu* pMenu )
45 :OAccessibleMenuComponent( pMenu )
49 // -----------------------------------------------------------------------------
51 VCLXAccessiblePopupMenu::~VCLXAccessiblePopupMenu()
55 // -----------------------------------------------------------------------------
57 sal_Bool VCLXAccessiblePopupMenu::IsFocused()
59 return !IsChildHighlighted();
62 // -----------------------------------------------------------------------------
63 // XServiceInfo
64 // -----------------------------------------------------------------------------
66 ::rtl::OUString VCLXAccessiblePopupMenu::getImplementationName() throw (RuntimeException)
68 return ::rtl::OUString::createFromAscii( "com.sun.star.comp.toolkit.AccessiblePopupMenu" );
71 // -----------------------------------------------------------------------------
73 Sequence< ::rtl::OUString > VCLXAccessiblePopupMenu::getSupportedServiceNames() throw (RuntimeException)
75 Sequence< ::rtl::OUString > aNames(1);
76 aNames[0] = ::rtl::OUString::createFromAscii( "com.sun.star.awt.AccessiblePopupMenu" );
77 return aNames;
80 // -----------------------------------------------------------------------------
81 // XAccessibleContext
82 // -----------------------------------------------------------------------------
84 sal_Int32 VCLXAccessiblePopupMenu::getAccessibleIndexInParent( ) throw (RuntimeException)
86 OExternalLockGuard aGuard( this );
88 return 0;
91 // -----------------------------------------------------------------------------
93 sal_Int16 VCLXAccessiblePopupMenu::getAccessibleRole( ) throw (RuntimeException)
95 OExternalLockGuard aGuard( this );
97 return AccessibleRole::POPUP_MENU;
100 // -----------------------------------------------------------------------------
101 // XAccessibleExtendedComponent
102 // -----------------------------------------------------------------------------
104 sal_Int32 VCLXAccessiblePopupMenu::getBackground( ) throw (RuntimeException)
106 OExternalLockGuard aGuard( this );
108 return Application::GetSettings().GetStyleSettings().GetMenuColor().GetColor();
111 // -----------------------------------------------------------------------------