update dev300-m58
[ooovba.git] / sc / inc / AccessibleFilterMenu.hxx
blob2495b4c275f3ab60ae1c27cfebf338bc4226a37e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AccessibleDataPilotControl.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_ACCESSIBLEFILTERMENU_HXX
32 #define SC_ACCESSIBLEFILTERMENU_HXX
34 #include "AccessibleContextBase.hxx"
35 #include "cppuhelper/implbase1.hxx"
37 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
38 #include <com/sun/star/accessibility/XAccessibleText.hpp>
39 #include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp>
40 #include <com/sun/star/accessibility/TextSegment.hpp>
42 #include <vector>
44 namespace com { namespace sun { namespace star {
45 namespace accessibility {
46 struct AccessibleEventObject;
48 }}}
50 class ScDocument;
51 class ScMenuFloatingWindow;
53 typedef ::cppu::ImplHelper1<
54 ::com::sun::star::accessibility::XAccessibleSelection > ScAccessibleFilterMenu_BASE;
56 class ScAccessibleFilterMenu :
57 public ScAccessibleContextBase,
58 public ScAccessibleFilterMenu_BASE
60 public:
61 explicit ScAccessibleFilterMenu(
62 const ::com::sun::star::uno::Reference<
63 ::com::sun::star::accessibility::XAccessible>& rxParent,
64 ScMenuFloatingWindow* pWin, const ::rtl::OUString& rName, size_t nMenuPos, ScDocument* pDoc);
65 virtual ~ScAccessibleFilterMenu();
67 // XAccessibleComponent
69 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
70 SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint )
71 throw (::com::sun::star::uno::RuntimeException);
73 virtual sal_Bool SAL_CALL isVisible()
74 throw (::com::sun::star::uno::RuntimeException);
76 virtual void SAL_CALL grabFocus()
77 throw (::com::sun::star::uno::RuntimeException);
79 virtual sal_Int32 SAL_CALL getForeground()
80 throw (::com::sun::star::uno::RuntimeException);
82 virtual sal_Int32 SAL_CALL getBackground()
83 throw (::com::sun::star::uno::RuntimeException);
85 // XAccessibleContext
87 virtual ::rtl::OUString SAL_CALL getAccessibleName()
88 throw (::com::sun::star::uno::RuntimeException);
90 virtual sal_Int32 SAL_CALL getAccessibleChildCount()
91 throw (::com::sun::star::uno::RuntimeException);
93 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL
94 getAccessibleChild(sal_Int32 nIndex)
95 throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException);
97 virtual ::com::sun::star::uno::Reference<
98 ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
99 getAccessibleStateSet()
100 throw (::com::sun::star::uno::RuntimeException);
102 virtual ::rtl::OUString SAL_CALL getImplementationName()
103 throw (::com::sun::star::uno::RuntimeException);
105 // XAccessibleEventBroadcaster
107 virtual void SAL_CALL
108 addEventListener(
109 const ::com::sun::star::uno::Reference<
110 ::com::sun::star::accessibility::XAccessibleEventListener>& xListener)
111 throw (com::sun::star::uno::RuntimeException);
113 // Remove an existing event listener.
114 virtual void SAL_CALL
115 removeEventListener(
116 const ::com::sun::star::uno::Reference<
117 ::com::sun::star::accessibility::XAccessibleEventListener>& xListener)
118 throw (com::sun::star::uno::RuntimeException);
120 // XAccessibleSelection
122 virtual void SAL_CALL selectAccessibleChild(sal_Int32 nChildIndex)
123 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
125 virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int32 nChildIndex)
126 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
128 virtual void SAL_CALL clearAccessibleSelection()
129 throw (::com::sun::star::uno::RuntimeException);
131 virtual void SAL_CALL selectAllAccessibleChildren()
132 throw (::com::sun::star::uno::RuntimeException);
134 virtual ::sal_Int32 SAL_CALL getSelectedAccessibleChildCount()
135 throw (::com::sun::star::uno::RuntimeException);
137 virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL
138 getSelectedAccessibleChild(sal_Int32 nChildIndex)
139 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
141 virtual void SAL_CALL deselectAccessibleChild(sal_Int32 nChildIndex)
142 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
144 // XInterface
146 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
147 ::com::sun::star::uno::Type const & rType )
148 throw (::com::sun::star::uno::RuntimeException);
150 virtual void SAL_CALL acquire() throw ();
151 virtual void SAL_CALL release() throw ();
153 // XTypeProvider
155 virtual ::com::sun::star::uno::Sequence<sal_Int8> SAL_CALL getImplementationId()
156 throw (::com::sun::star::uno::RuntimeException);
158 // non-UNO methods
160 void appendMenuItem(const ::rtl::OUString& rName, bool bEnabled, size_t nMenuPos);
161 void setMenuPos(size_t nMenuPos);
162 void setEnabled(bool bEnabled);
164 protected:
166 sal_Int32 getMenuItemCount() const;
168 virtual Rectangle GetBoundingBoxOnScreen() const
169 throw (::com::sun::star::uno::RuntimeException);
171 virtual Rectangle GetBoundingBox() const
172 throw (::com::sun::star::uno::RuntimeException);
174 private:
175 bool isSelected() const;
176 bool isFocused() const;
178 void updateStates();
180 private:
181 ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > maMenuItems;
182 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > mxStateSet;
184 size_t mnMenuPos;
185 ScMenuFloatingWindow* mpWindow;
186 ScDocument* mpDoc;
188 bool mbEnabled:1;
191 #endif