1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_INC_ACCESSIBLEFILTERMENU_HXX
21 #define INCLUDED_SC_INC_ACCESSIBLEFILTERMENU_HXX
23 #include "AccessibleContextBase.hxx"
24 #include <cppuhelper/implbase1.hxx>
26 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
27 #include <com/sun/star/accessibility/XAccessibleText.hpp>
28 #include <com/sun/star/accessibility/XAccessibleTextAttributes.hpp>
29 #include <com/sun/star/accessibility/TextSegment.hpp>
33 namespace com
{ namespace sun
{ namespace star
{
34 namespace accessibility
{
35 struct AccessibleEventObject
;
39 class ScMenuFloatingWindow
;
41 typedef ::cppu::ImplHelper1
<
42 ::com::sun::star::accessibility::XAccessibleSelection
> ScAccessibleFilterMenu_BASE
;
44 class ScAccessibleFilterMenu
:
45 public ScAccessibleContextBase
,
46 public ScAccessibleFilterMenu_BASE
49 explicit ScAccessibleFilterMenu(
50 const ::com::sun::star::uno::Reference
<
51 ::com::sun::star::accessibility::XAccessible
>& rxParent
,
52 ScMenuFloatingWindow
* pWin
, const OUString
& rName
, size_t nMenuPos
);
53 virtual ~ScAccessibleFilterMenu();
55 virtual bool SAL_CALL
isVisible()
56 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
58 /// XAccessibleComponent
60 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
>
61 SAL_CALL
getAccessibleAtPoint( const ::com::sun::star::awt::Point
& rPoint
)
62 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
64 virtual void SAL_CALL
grabFocus()
65 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
67 virtual sal_Int32 SAL_CALL
getForeground()
68 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
70 virtual sal_Int32 SAL_CALL
getBackground()
71 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
73 /// XAccessibleContext
75 virtual OUString SAL_CALL
getAccessibleName()
76 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
78 virtual sal_Int32 SAL_CALL
getAccessibleChildCount()
79 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
81 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
82 getAccessibleChild(sal_Int32 nIndex
)
83 throw (::com::sun::star::uno::RuntimeException
, ::com::sun::star::lang::IndexOutOfBoundsException
, std::exception
) SAL_OVERRIDE
;
85 virtual ::com::sun::star::uno::Reference
<
86 ::com::sun::star::accessibility::XAccessibleStateSet
> SAL_CALL
87 getAccessibleStateSet()
88 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
90 virtual OUString SAL_CALL
getImplementationName()
91 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
93 /// XAccessibleEventBroadcaster
95 addAccessibleEventListener(
96 const ::com::sun::star::uno::Reference
<
97 ::com::sun::star::accessibility::XAccessibleEventListener
>& xListener
)
98 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
100 /// Remove an existing event listener.
101 virtual void SAL_CALL
102 removeAccessibleEventListener(
103 const ::com::sun::star::uno::Reference
<
104 ::com::sun::star::accessibility::XAccessibleEventListener
>& xListener
)
105 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
107 /// XAccessibleSelection
109 virtual void SAL_CALL
selectAccessibleChild(sal_Int32 nChildIndex
)
110 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
112 virtual sal_Bool SAL_CALL
isAccessibleChildSelected(sal_Int32 nChildIndex
)
113 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
115 virtual void SAL_CALL
clearAccessibleSelection()
116 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
118 virtual void SAL_CALL
selectAllAccessibleChildren()
119 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
121 virtual ::sal_Int32 SAL_CALL
getSelectedAccessibleChildCount()
122 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
124 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
125 getSelectedAccessibleChild(sal_Int32 nChildIndex
)
126 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
128 virtual void SAL_CALL
deselectAccessibleChild(sal_Int32 nChildIndex
)
129 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
133 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface(
134 ::com::sun::star::uno::Type
const & rType
)
135 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
137 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
;
138 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
;
142 virtual ::com::sun::star::uno::Sequence
<sal_Int8
> SAL_CALL
getImplementationId()
143 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
147 void appendMenuItem(const OUString
& rName
, bool bEnabled
, size_t nMenuPos
);
148 void setMenuPos(size_t nMenuPos
);
149 void setEnabled(bool bEnabled
);
153 sal_Int32
getMenuItemCount() const;
155 virtual Rectangle
GetBoundingBoxOnScreen() const
156 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
158 virtual Rectangle
GetBoundingBox() const
159 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
162 bool isSelected() const;
163 bool isFocused() const;
168 ::std::vector
< ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> > maMenuItems
;
169 ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessibleStateSet
> mxStateSet
;
172 ScMenuFloatingWindow
* mpWindow
;
179 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */