1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef ACCESSIBILITY_STANDARD_ACCESSIBLEMENUITEMCOMPONENT_HXX
25 #define ACCESSIBILITY_STANDARD_ACCESSIBLEMENUITEMCOMPONENT_HXX
26 
27 #include <accessibility/standard/accessiblemenubasecomponent.hxx>
28 
29 
30 //	----------------------------------------------------
31 //	class OAccessibleMenuItemComponent
32 //	----------------------------------------------------
33 
34 class OAccessibleMenuItemComponent : public OAccessibleMenuBaseComponent
35 {
36     friend class OAccessibleMenuBaseComponent;
37 
38 protected:
39     Menu*					m_pParent;
40     sal_uInt16				m_nItemPos;
41     ::rtl::OUString			m_sAccessibleName;
42     ::rtl::OUString			m_sItemText;
43 
44     virtual sal_Bool		IsEnabled();
45     virtual sal_Bool        IsVisible();
46     virtual void			Select();
47     virtual void			DeSelect();
48     virtual void            Click();
49 
50     void					SetItemPos( sal_uInt16 nItemPos );
51     void					SetAccessibleName( const ::rtl::OUString& sAccessibleName );
52     ::rtl::OUString			GetAccessibleName();
53     void					SetItemText( const ::rtl::OUString& sItemText );
54     ::rtl::OUString			GetItemText();
55 
56 	virtual sal_Bool 		IsMenuHideDisabledEntries();
57 
58     virtual void			FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
59 
60     // OCommonAccessibleComponent
61     virtual ::com::sun::star::awt::Rectangle SAL_CALL	implGetBounds(  ) throw (::com::sun::star::uno::RuntimeException);
62 
63     // XComponent
64     virtual void SAL_CALL	disposing();
65 
66 public:
67     OAccessibleMenuItemComponent( Menu* pParent, sal_uInt16 nItemPos, Menu* pMenu );
68     virtual ~OAccessibleMenuItemComponent();
69 
70     // XAccessibleContext
71     virtual sal_Int32 SAL_CALL getAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
72     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
73     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent(  ) throw (::com::sun::star::uno::RuntimeException);
74     virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(  ) throw (::com::sun::star::uno::RuntimeException);
75     virtual sal_Int16 SAL_CALL getAccessibleRole(  ) throw (::com::sun::star::uno::RuntimeException);
76     virtual ::rtl::OUString SAL_CALL getAccessibleDescription(  ) throw (::com::sun::star::uno::RuntimeException);
77     virtual ::rtl::OUString SAL_CALL getAccessibleName(  ) throw (::com::sun::star::uno::RuntimeException);
78     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet(  ) throw (::com::sun::star::uno::RuntimeException);
79     virtual ::com::sun::star::lang::Locale SAL_CALL getLocale(  ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
80 
81     // XAccessibleComponent
82     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException);
83     virtual void SAL_CALL grabFocus(  ) throw (::com::sun::star::uno::RuntimeException);
84     virtual sal_Int32 SAL_CALL getForeground(  ) throw (::com::sun::star::uno::RuntimeException);
85     virtual sal_Int32 SAL_CALL getBackground(  ) throw (::com::sun::star::uno::RuntimeException);
86 
87     // XAccessibleExtendedComponent
88     virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont(	) throw (::com::sun::star::uno::RuntimeException);
89     virtual ::rtl::OUString SAL_CALL getTitledBorderText(  ) throw (::com::sun::star::uno::RuntimeException);
90     virtual ::rtl::OUString SAL_CALL getToolTipText(  ) throw (::com::sun::star::uno::RuntimeException);
91 };
92 
93 #endif // ACCESSIBILITY_STANDARD_ACCESSIBLEMENUITEMCOMPONENT_HXX
94