1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef ACCESSIBILITY_EXT_ACCESSIBLETABBARPAGE_HXX_
29 #define ACCESSIBILITY_EXT_ACCESSIBLETABBARPAGE_HXX_
30 
31 #include <com/sun/star/accessibility/XAccessible.hpp>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <cppuhelper/implbase2.hxx>
34 #include "accessibility/extended/accessibletabbarbase.hxx"
35 
36 #include <vector>
37 
38 namespace utl {
39 class AccessibleStateSetHelper;
40 }
41 
42 //.........................................................................
43 namespace accessibility
44 {
45 //.........................................................................
46 
47 	//	----------------------------------------------------
48 	//	class AccessibleTabBarPage
49 	//	----------------------------------------------------
50 
51 	typedef ::cppu::ImplHelper2<
52 		::com::sun::star::accessibility::XAccessible,
53 		::com::sun::star::lang::XServiceInfo > AccessibleTabBarPage_BASE;
54 
55     class AccessibleTabBarPage :    public AccessibleTabBarBase,
56 									public AccessibleTabBarPage_BASE
57 	{
58 		friend class AccessibleTabBarPageList;
59 
60 	private:
61 		sal_uInt16				m_nPageId;
62 		sal_Bool				m_bEnabled;
63 		sal_Bool				m_bShowing;
64 		sal_Bool				m_bSelected;
65 		::rtl::OUString			m_sPageText;
66 
67 		::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >		m_xParent;
68 
69 	protected:
70 		sal_Bool				IsEnabled();
71 		sal_Bool				IsShowing();
72 		sal_Bool				IsSelected();
73 
74 		void					SetEnabled( sal_Bool bEnabled );
75 		void					SetShowing( sal_Bool bShowing );
76 		void					SetSelected( sal_Bool bSelected );
77 		void					SetPageText( const ::rtl::OUString& sPageText );
78 
79 		sal_uInt16				GetPageId() const { return m_nPageId; }
80 
81 		virtual void			FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
82 
83 		// OCommonAccessibleComponent
84 		virtual ::com::sun::star::awt::Rectangle SAL_CALL	implGetBounds(  ) throw (::com::sun::star::uno::RuntimeException);
85 
86 		// XComponent
87 		virtual void SAL_CALL	disposing();
88 
89 	public:
90 		AccessibleTabBarPage( TabBar* pTabBar, sal_uInt16 nPageId,
91 							  const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent );
92 		virtual ~AccessibleTabBarPage();
93 
94 		// XInterface
95 		DECLARE_XINTERFACE()
96 
97 		// XTypeProvider
98 		DECLARE_XTYPEPROVIDER()
99 
100 		// XServiceInfo
101 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
102 		virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException);
103 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
104 
105 		// XAccessible
106 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext(  ) throw (::com::sun::star::uno::RuntimeException);
107 
108 		// XAccessibleContext
109 		virtual sal_Int32 SAL_CALL getAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
110 		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);
111 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent(  ) throw (::com::sun::star::uno::RuntimeException);
112 		virtual sal_Int32 SAL_CALL getAccessibleIndexInParent(  ) throw (::com::sun::star::uno::RuntimeException);
113 		virtual sal_Int16 SAL_CALL getAccessibleRole(  ) throw (::com::sun::star::uno::RuntimeException);
114 		virtual ::rtl::OUString SAL_CALL getAccessibleDescription(  ) throw (::com::sun::star::uno::RuntimeException);
115 		virtual ::rtl::OUString SAL_CALL getAccessibleName(  ) throw (::com::sun::star::uno::RuntimeException);
116 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet(  ) throw (::com::sun::star::uno::RuntimeException);
117 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet(  ) throw (::com::sun::star::uno::RuntimeException);
118 		virtual ::com::sun::star::lang::Locale SAL_CALL getLocale(  ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException);
119 
120 		// XAccessibleComponent
121 		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);
122 		virtual void SAL_CALL grabFocus(  ) throw (::com::sun::star::uno::RuntimeException);
123 		virtual sal_Int32 SAL_CALL getForeground(  ) throw (::com::sun::star::uno::RuntimeException);
124 		virtual sal_Int32 SAL_CALL getBackground(  ) throw (::com::sun::star::uno::RuntimeException);
125 
126 		// XAccessibleExtendedComponent
127 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont(	) throw (::com::sun::star::uno::RuntimeException);
128 		virtual ::rtl::OUString SAL_CALL getTitledBorderText(  ) throw (::com::sun::star::uno::RuntimeException);
129 		virtual ::rtl::OUString SAL_CALL getToolTipText(  ) throw (::com::sun::star::uno::RuntimeException);
130 	};
131 
132 //.........................................................................
133 }	// namespace accessibility
134 //.........................................................................
135 
136 #endif // ACCESSIBILITY_EXT_ACCESSIBLETABBARPAGE_HXX_
137 
138