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_EXT_ACCESSIBLETABBARPAGELIST_HXX_
25 #define ACCESSIBILITY_EXT_ACCESSIBLETABBARPAGELIST_HXX_
26 
27 #include <com/sun/star/accessibility/XAccessible.hpp>
28 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
29 #include <com/sun/star/lang/XServiceInfo.hpp>
30 #include <cppuhelper/implbase3.hxx>
31 #include "accessibility/extended/accessibletabbarbase.hxx"
32 
33 #include <vector>
34 
35 namespace utl {
36 class AccessibleStateSetHelper;
37 }
38 
39 //.........................................................................
40 namespace accessibility
41 {
42 //.........................................................................
43 
44 	//	----------------------------------------------------
45 	//	class AccessibleTabBarPageList
46 	//	----------------------------------------------------
47 
48 	typedef ::cppu::ImplHelper3<
49 		::com::sun::star::accessibility::XAccessible,
50 		::com::sun::star::accessibility::XAccessibleSelection,
51 		::com::sun::star::lang::XServiceInfo > AccessibleTabBarPageList_BASE;
52 
53     class AccessibleTabBarPageList :    public AccessibleTabBarBase,
54 										public AccessibleTabBarPageList_BASE
55 	{
56 	private:
57 		typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >	> AccessibleChildren;
58 
59 		AccessibleChildren		m_aAccessibleChildren;
60 		sal_Int32				m_nIndexInParent;
61 
62 	protected:
63 		void					UpdateEnabled( sal_Int32 i, sal_Bool bEnabled );
64 		void					UpdateShowing( sal_Bool bShowing );
65 		void					UpdateSelected( sal_Int32 i, sal_Bool bSelected );
66 		void					UpdatePageText( sal_Int32 i );
67 
68 		void					InsertChild( sal_Int32 i );
69 		void					RemoveChild( sal_Int32 i );
70 		void					MoveChild( sal_Int32 i, sal_Int32 j );
71 
72 		virtual void			ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
73 		virtual void			FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
74 
75 		// OCommonAccessibleComponent
76 		virtual ::com::sun::star::awt::Rectangle SAL_CALL	implGetBounds(  ) throw (::com::sun::star::uno::RuntimeException);
77 
78 		// XComponent
79 		virtual void SAL_CALL	disposing();
80 
81 	public:
82 		AccessibleTabBarPageList( TabBar* pTabBar, sal_Int32 nIndexInParent );
83 		virtual ~AccessibleTabBarPageList();
84 
85 		// XInterface
86 		DECLARE_XINTERFACE()
87 
88 		// XTypeProvider
89 		DECLARE_XTYPEPROVIDER()
90 
91 		// XServiceInfo
92 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
93 		virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException);
94 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
95 
96 		// XAccessible
97 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext(  ) throw (::com::sun::star::uno::RuntimeException);
98 
99 		// XAccessibleContext
100 		virtual sal_Int32 SAL_CALL getAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
101 		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);
102 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent(  ) throw (::com::sun::star::uno::RuntimeException);
103 		virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(  ) throw (::com::sun::star::uno::RuntimeException);
104 		virtual sal_Int16 SAL_CALL getAccessibleRole(  ) throw (::com::sun::star::uno::RuntimeException);
105 		virtual ::rtl::OUString SAL_CALL getAccessibleDescription(  ) throw (::com::sun::star::uno::RuntimeException);
106 		virtual ::rtl::OUString SAL_CALL getAccessibleName(  ) throw (::com::sun::star::uno::RuntimeException);
107 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet(  ) throw (::com::sun::star::uno::RuntimeException);
108 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet(  ) throw (::com::sun::star::uno::RuntimeException);
109 		virtual ::com::sun::star::lang::Locale SAL_CALL getLocale(  ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
110 
111 		// XAccessibleComponent
112 		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);
113 		virtual void SAL_CALL grabFocus(  ) throw (::com::sun::star::uno::RuntimeException);
114 		virtual sal_Int32 SAL_CALL getForeground(  ) throw (::com::sun::star::uno::RuntimeException);
115 		virtual sal_Int32 SAL_CALL getBackground(  ) throw (::com::sun::star::uno::RuntimeException);
116 
117 		// XAccessibleExtendedComponent
118 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont(	) throw (::com::sun::star::uno::RuntimeException);
119 		virtual ::rtl::OUString SAL_CALL getTitledBorderText(  ) throw (::com::sun::star::uno::RuntimeException);
120 		virtual ::rtl::OUString SAL_CALL getToolTipText(  ) throw (::com::sun::star::uno::RuntimeException);
121 
122 		// XAccessibleSelection
123 		virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
124 		virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
125 		virtual void SAL_CALL clearAccessibleSelection(  ) throw (::com::sun::star::uno::RuntimeException);
126 		virtual void SAL_CALL selectAllAccessibleChildren(  ) throw (::com::sun::star::uno::RuntimeException);
127 		virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
128 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
129 		virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
130 	};
131 
132 //.........................................................................
133 }	// namespace accessibility
134 //.........................................................................
135 
136 #endif // ACCESSIBILITY_EXT_ACCESSIBLETABBARPAGELIST_HXX_
137 
138