Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / sc / inc / AccessibleFilterMenuItem.hxx
blob550a77999733552e89775df55823f5f19f57b14a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 SC_ACCESSIBLEFILTERMENUITEM_HXX
21 #define SC_ACCESSIBLEFILTERMENUITEM_HXX
23 #include "AccessibleContextBase.hxx"
24 #include "cppuhelper/implbase1.hxx"
26 #include <com/sun/star/accessibility/XAccessibleAction.hpp>
28 class ScMenuFloatingWindow;
30 typedef ::cppu::ImplHelper1<
31 ::com::sun::star::accessibility::XAccessibleAction > ScAccessibleFilterMenuItem_BASE;
33 class ScAccessibleFilterMenuItem :
34 public ScAccessibleContextBase,
35 public ScAccessibleFilterMenuItem_BASE
37 public:
38 explicit ScAccessibleFilterMenuItem(
39 const ::com::sun::star::uno::Reference<
40 ::com::sun::star::accessibility::XAccessible>& rxParent, ScMenuFloatingWindow* pWin, const ::rtl::OUString& rName, size_t nMenuPos);
42 virtual ~ScAccessibleFilterMenuItem();
44 // XAccessibleContext
46 virtual sal_Int32 SAL_CALL getAccessibleChildCount()
47 throw (::com::sun::star::uno::RuntimeException);
49 virtual ::com::sun::star::uno::Reference<
50 ::com::sun::star::accessibility::XAccessible > SAL_CALL
51 getAccessibleChild(sal_Int32 nIndex)
52 throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException);
54 virtual ::com::sun::star::uno::Reference<
55 ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL
56 getAccessibleStateSet()
57 throw (::com::sun::star::uno::RuntimeException);
59 virtual ::rtl::OUString SAL_CALL getImplementationName()
60 throw (::com::sun::star::uno::RuntimeException);
62 // XAccessibleAction
64 virtual ::sal_Int32 SAL_CALL getAccessibleActionCount()
65 throw (::com::sun::star::uno::RuntimeException);
67 virtual ::sal_Bool SAL_CALL doAccessibleAction(sal_Int32 nIndex)
68 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
70 virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription(sal_Int32 nIndex)
71 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
73 virtual ::com::sun::star::uno::Reference<
74 ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL
75 getAccessibleActionKeyBinding(sal_Int32 nIndex)
76 throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
78 // XInterface
80 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
81 ::com::sun::star::uno::Type const & rType )
82 throw (::com::sun::star::uno::RuntimeException);
84 virtual void SAL_CALL acquire() throw ();
85 virtual void SAL_CALL release() throw ();
87 // Non-UNO Methods
89 void setEnabled(bool bEnabled);
91 protected:
93 virtual Rectangle GetBoundingBoxOnScreen() const
94 throw (::com::sun::star::uno::RuntimeException);
96 virtual Rectangle GetBoundingBox() const
97 throw (::com::sun::star::uno::RuntimeException);
99 private:
100 bool isSelected() const;
101 bool isFocused() const;
102 void updateStateSet();
104 private:
105 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > mxStateSet;
107 ScMenuFloatingWindow* mpWindow;
108 ::rtl::OUString maName;
109 size_t mnMenuPos;
110 bool mbEnabled;
113 #endif
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */