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 <vcl/vclptr.hxx>
31 class ScMenuFloatingWindow
;
33 typedef ::cppu::ImplHelper1
<
34 css::accessibility::XAccessibleSelection
> ScAccessibleFilterMenu_BASE
;
36 class ScAccessibleFilterMenu
:
37 public ScAccessibleContextBase
,
38 public ScAccessibleFilterMenu_BASE
41 explicit ScAccessibleFilterMenu(
42 const css::uno::Reference
< css::accessibility::XAccessible
>& rxParent
,
43 ScMenuFloatingWindow
* pWin
, const OUString
& rName
, size_t nMenuPos
);
44 virtual ~ScAccessibleFilterMenu() override
;
46 virtual bool isVisible() override
;
48 /// XAccessibleComponent
50 virtual css::uno::Reference
< css::accessibility::XAccessible
>
51 SAL_CALL
getAccessibleAtPoint( const css::awt::Point
& rPoint
) override
;
53 virtual void SAL_CALL
grabFocus() override
;
55 virtual sal_Int32 SAL_CALL
getForeground() override
;
57 virtual sal_Int32 SAL_CALL
getBackground() override
;
59 /// XAccessibleContext
61 virtual sal_Int32 SAL_CALL
getAccessibleChildCount() override
;
63 virtual css::uno::Reference
< css::accessibility::XAccessible
> SAL_CALL
64 getAccessibleChild(sal_Int32 nIndex
) override
;
66 virtual css::uno::Reference
<
67 css::accessibility::XAccessibleStateSet
> SAL_CALL
68 getAccessibleStateSet() override
;
70 virtual OUString SAL_CALL
getImplementationName() override
;
72 /// XAccessibleEventBroadcaster
74 addAccessibleEventListener(
75 const css::uno::Reference
< css::accessibility::XAccessibleEventListener
>& xListener
) override
;
77 /// Remove an existing event listener.
79 removeAccessibleEventListener(
80 const css::uno::Reference
< css::accessibility::XAccessibleEventListener
>& xListener
) override
;
82 /// XAccessibleSelection
84 virtual void SAL_CALL
selectAccessibleChild(sal_Int32 nChildIndex
) override
;
86 virtual sal_Bool SAL_CALL
isAccessibleChildSelected(sal_Int32 nChildIndex
) override
;
88 virtual void SAL_CALL
clearAccessibleSelection() override
;
90 virtual void SAL_CALL
selectAllAccessibleChildren() override
;
92 virtual ::sal_Int32 SAL_CALL
getSelectedAccessibleChildCount() override
;
94 virtual css::uno::Reference
< css::accessibility::XAccessible
> SAL_CALL
95 getSelectedAccessibleChild(sal_Int32 nChildIndex
) override
;
97 virtual void SAL_CALL
deselectAccessibleChild(sal_Int32 nChildIndex
) override
;
101 virtual css::uno::Any SAL_CALL
queryInterface(
102 css::uno::Type
const & rType
) override
;
104 virtual void SAL_CALL
acquire() throw () override
;
105 virtual void SAL_CALL
release() throw () override
;
109 virtual css::uno::Sequence
<sal_Int8
> SAL_CALL
getImplementationId() override
;
113 void appendMenuItem(const OUString
& rName
, size_t nMenuPos
);
114 void setMenuPos(size_t nMenuPos
);
118 sal_Int32
getMenuItemCount() const;
120 virtual tools::Rectangle
GetBoundingBoxOnScreen() const override
;
122 virtual tools::Rectangle
GetBoundingBox() const override
;
125 bool isSelected() const;
130 ::std::vector
< css::uno::Reference
< css::accessibility::XAccessible
> > maMenuItems
;
131 css::uno::Reference
< css::accessibility::XAccessibleStateSet
> mxStateSet
;
134 VclPtr
<ScMenuFloatingWindow
> mpWindow
;
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */