xref: /AOO41X/main/sc/inc/AccessibleFilterMenuItem.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 
28 #ifndef SC_ACCESSIBLEFILTERMENUITEM_HXX
29 #define SC_ACCESSIBLEFILTERMENUITEM_HXX
30 
31 #include "AccessibleContextBase.hxx"
32 #include "cppuhelper/implbase1.hxx"
33 
34 #include <com/sun/star/accessibility/XAccessibleAction.hpp>
35 
36 class ScMenuFloatingWindow;
37 
38 typedef ::cppu::ImplHelper1<
39     ::com::sun::star::accessibility::XAccessibleAction > ScAccessibleFilterMenuItem_BASE;
40 
41 class ScAccessibleFilterMenuItem :
42     public ScAccessibleContextBase,
43     public ScAccessibleFilterMenuItem_BASE
44 {
45 public:
46     explicit ScAccessibleFilterMenuItem(
47         const ::com::sun::star::uno::Reference<
48             ::com::sun::star::accessibility::XAccessible>& rxParent, ScMenuFloatingWindow* pWin, const ::rtl::OUString& rName, size_t nMenuPos);
49 
50     virtual ~ScAccessibleFilterMenuItem();
51 
52 	// XAccessibleContext
53 
54     virtual sal_Int32 SAL_CALL getAccessibleChildCount()
55         throw (::com::sun::star::uno::RuntimeException);
56 
57     virtual ::com::sun::star::uno::Reference<
58         ::com::sun::star::accessibility::XAccessible > SAL_CALL
59     	getAccessibleChild(sal_Int32 nIndex)
60             throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException);
61 
62 	virtual ::com::sun::star::uno::Reference<
63         ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
64     	getAccessibleStateSet()
65             throw (::com::sun::star::uno::RuntimeException);
66 
67 	virtual ::rtl::OUString SAL_CALL getImplementationName()
68         throw (::com::sun::star::uno::RuntimeException);
69 
70     // XAccessibleAction
71 
72     virtual ::sal_Int32 SAL_CALL getAccessibleActionCount()
73         throw (::com::sun::star::uno::RuntimeException);
74 
75     virtual ::sal_Bool SAL_CALL doAccessibleAction(sal_Int32 nIndex)
76         throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
77 
78     virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription(sal_Int32 nIndex)
79         throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
80 
81     virtual ::com::sun::star::uno::Reference<
82         ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL
83         getAccessibleActionKeyBinding(sal_Int32 nIndex)
84             throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
85 
86     // XInterface
87 
88 	virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
89 		::com::sun::star::uno::Type const & rType )
90 		    throw (::com::sun::star::uno::RuntimeException);
91 
92 	virtual void SAL_CALL acquire() throw ();
93 	virtual void SAL_CALL release() throw ();
94 
95     // Non-UNO Methods
96 
97     void setEnabled(bool bEnabled);
98 
99 protected:
100 
101 	virtual Rectangle GetBoundingBoxOnScreen() const
102 		throw (::com::sun::star::uno::RuntimeException);
103 
104 	virtual Rectangle GetBoundingBox() const
105 		throw (::com::sun::star::uno::RuntimeException);
106 
107 private:
108     bool isSelected() const;
109     bool isFocused() const;
110     void updateStateSet();
111 
112 private:
113     ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > mxStateSet;
114 
115     ScMenuFloatingWindow* mpWindow;
116     ::rtl::OUString maName;
117     size_t mnMenuPos;
118     bool mbEnabled;
119 };
120 
121 #endif
122