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 #ifndef _SVTOOLS_VCLACCESSIBLEHEADBARITEM_HXX_
23 #define _SVTOOLS_VCLACCESSIBLEHEADBARITEM_HXX_
24 
25 #ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HPP_
26 #include <com/sun/star/accessibility/XAccessible.hpp>
27 #endif
28 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
29 #include <com/sun/star/lang/XServiceInfo.hpp>
30 #endif
31 #ifndef COMPHELPER_ACCESSIBLE_COMPONENT_HELPER_HXX
32 #include <comphelper/accessiblecomponenthelper.hxx>
33 #endif
34 #ifndef _CPPUHELPER_IMPLBASE2_HXX_
35 #include <cppuhelper/implbase2.hxx>
36 #endif
37 
38 #ifndef _LINK_HXX
39 #include <tools/link.hxx>
40 #endif
41 
42 #include <vector>
43 
44 class HeaderBar;
45 class VCLExternalSolarLock;
46 class VclSimpleEvent;
47 class VclWindowEvent;
48 
49 namespace utl {
50 class AccessibleStateSetHelper;
51 }
52 
53 
54 //	----------------------------------------------------
55 //	class VCLXAccessibleHeaderBarItem
56 //	----------------------------------------------------
57 
58 typedef ::comphelper::OAccessibleExtendedComponentHelper	AccessibleExtendedComponentHelper_BASE;
59 
60 typedef ::cppu::ImplHelper2<
61 ::com::sun::star::accessibility::XAccessible,
62 ::com::sun::star::lang::XServiceInfo > VCLXAccessibleHeaderBarItem_BASE;
63 
64 class VCLXAccessibleHeaderBarItem :	public AccessibleExtendedComponentHelper_BASE,
65 						public VCLXAccessibleHeaderBarItem_BASE
66 {
67 private:
68 	VCLExternalSolarLock*	m_pExternalLock;
69 	HeaderBar*				m_pHeadBar;
70 	sal_Int32				m_nIndexInParent;
71 
72 protected:
73 	DECL_LINK( WindowEventListener, VclSimpleEvent* );
74 
75 	virtual void			ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
76 	virtual void			FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
77 
78 	// OCommonAccessibleComponent
79 	virtual ::com::sun::star::awt::Rectangle SAL_CALL	implGetBounds(  ) throw (::com::sun::star::uno::RuntimeException);
80 
81 	// XComponent
82 	virtual void SAL_CALL	disposing();
83 
84 public:
85 	VCLXAccessibleHeaderBarItem( HeaderBar*	pHeadBar, sal_Int32 _nIndexInParent );
86 	~VCLXAccessibleHeaderBarItem();
87 
88 	// XInterface
89 	DECLARE_XINTERFACE()
90 
91 	// XTypeProvider
92 	DECLARE_XTYPEPROVIDER()
93 
94 	// XServiceInfo
95 	virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
96 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException);
97 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
98 
99 	// XAccessible
100 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext(  ) throw (::com::sun::star::uno::RuntimeException);
101 
102 	// XAccessibleContext
103 	virtual sal_Int32 SAL_CALL getAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
104 	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);
105 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent(  ) throw (::com::sun::star::uno::RuntimeException);
106 	virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(  ) throw (::com::sun::star::uno::RuntimeException);
107 	virtual sal_Int16 SAL_CALL getAccessibleRole(  ) throw (::com::sun::star::uno::RuntimeException);
108 	virtual ::rtl::OUString SAL_CALL getAccessibleDescription(  ) throw (::com::sun::star::uno::RuntimeException);
109 	virtual ::rtl::OUString SAL_CALL getAccessibleName(  ) throw (::com::sun::star::uno::RuntimeException);
110 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet(  ) throw (::com::sun::star::uno::RuntimeException);
111 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet(  ) throw (::com::sun::star::uno::RuntimeException);
112 	virtual ::com::sun::star::lang::Locale SAL_CALL getLocale(  ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
113 
114 	// XAccessibleComponent
115 	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);
grabFocus()116 	virtual void SAL_CALL grabFocus(  ) throw (::com::sun::star::uno::RuntimeException){};
117 	virtual sal_Int32 SAL_CALL getForeground() throw (::com::sun::star::uno::RuntimeException);
118 	virtual sal_Int32 SAL_CALL getBackground() throw (::com::sun::star::uno::RuntimeException);
119 
120 	// XAccessibleExtendedComponent
121 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont(	) throw (::com::sun::star::uno::RuntimeException);
122 	virtual ::rtl::OUString SAL_CALL getTitledBorderText(  ) throw (::com::sun::star::uno::RuntimeException);
123 	virtual ::rtl::OUString SAL_CALL getToolTipText(  ) throw (::com::sun::star::uno::RuntimeException);
124 };
125 
126 #endif // _SVTOOLS_VCLACCESSIBLEHEADBARITEM_HXX_
127 
128