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>
30 #include <vcl/vclptr.hxx>
34 namespace com
{ namespace sun
{ namespace star
{
35 namespace accessibility
{
36 struct AccessibleEventObject
;
40 class ScMenuFloatingWindow
;
42 typedef ::cppu::ImplHelper1
<
43 ::com::sun::star::accessibility::XAccessibleSelection
> ScAccessibleFilterMenu_BASE
;
45 class ScAccessibleFilterMenu
:
46 public ScAccessibleContextBase
,
47 public ScAccessibleFilterMenu_BASE
50 explicit ScAccessibleFilterMenu(
51 const ::com::sun::star::uno::Reference
<
52 ::com::sun::star::accessibility::XAccessible
>& rxParent
,
53 ScMenuFloatingWindow
* pWin
, const OUString
& rName
, size_t nMenuPos
);
54 virtual ~ScAccessibleFilterMenu();
56 virtual bool SAL_CALL
isVisible()
57 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
59 /// XAccessibleComponent
61 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
>
62 SAL_CALL
getAccessibleAtPoint( const ::com::sun::star::awt::Point
& rPoint
)
63 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
65 virtual void SAL_CALL
grabFocus()
66 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
68 virtual sal_Int32 SAL_CALL
getForeground()
69 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
71 virtual sal_Int32 SAL_CALL
getBackground()
72 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
74 /// XAccessibleContext
76 virtual OUString SAL_CALL
getAccessibleName()
77 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
79 virtual sal_Int32 SAL_CALL
getAccessibleChildCount()
80 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
82 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
83 getAccessibleChild(sal_Int32 nIndex
)
84 throw (::com::sun::star::uno::RuntimeException
, ::com::sun::star::lang::IndexOutOfBoundsException
, std::exception
) SAL_OVERRIDE
;
86 virtual ::com::sun::star::uno::Reference
<
87 ::com::sun::star::accessibility::XAccessibleStateSet
> SAL_CALL
88 getAccessibleStateSet()
89 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
91 virtual OUString SAL_CALL
getImplementationName()
92 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
94 /// XAccessibleEventBroadcaster
96 addAccessibleEventListener(
97 const ::com::sun::star::uno::Reference
<
98 ::com::sun::star::accessibility::XAccessibleEventListener
>& xListener
)
99 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
101 /// Remove an existing event listener.
102 virtual void SAL_CALL
103 removeAccessibleEventListener(
104 const ::com::sun::star::uno::Reference
<
105 ::com::sun::star::accessibility::XAccessibleEventListener
>& xListener
)
106 throw (com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
108 /// XAccessibleSelection
110 virtual void SAL_CALL
selectAccessibleChild(sal_Int32 nChildIndex
)
111 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
113 virtual sal_Bool SAL_CALL
isAccessibleChildSelected(sal_Int32 nChildIndex
)
114 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
116 virtual void SAL_CALL
clearAccessibleSelection()
117 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
119 virtual void SAL_CALL
selectAllAccessibleChildren()
120 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
122 virtual ::sal_Int32 SAL_CALL
getSelectedAccessibleChildCount()
123 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
125 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> SAL_CALL
126 getSelectedAccessibleChild(sal_Int32 nChildIndex
)
127 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
129 virtual void SAL_CALL
deselectAccessibleChild(sal_Int32 nChildIndex
)
130 throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
134 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface(
135 ::com::sun::star::uno::Type
const & rType
)
136 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
138 virtual void SAL_CALL
acquire() throw () SAL_OVERRIDE
;
139 virtual void SAL_CALL
release() throw () SAL_OVERRIDE
;
143 virtual ::com::sun::star::uno::Sequence
<sal_Int8
> SAL_CALL
getImplementationId()
144 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
148 void appendMenuItem(const OUString
& rName
, bool bEnabled
, size_t nMenuPos
);
149 void setMenuPos(size_t nMenuPos
);
150 void setEnabled(bool bEnabled
);
154 sal_Int32
getMenuItemCount() const;
156 virtual Rectangle
GetBoundingBoxOnScreen() const
157 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
159 virtual Rectangle
GetBoundingBox() const
160 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
163 bool isSelected() const;
164 bool isFocused() const;
169 ::std::vector
< ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> > maMenuItems
;
170 ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessibleStateSet
> mxStateSet
;
173 VclPtr
<ScMenuFloatingWindow
> mpWindow
;
180 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */