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_ACCESSIBLEICONCHOICECTRL_HXX_
25 #define ACCESSIBILITY_EXT_ACCESSIBLEICONCHOICECTRL_HXX_
26 
27 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
28 #include <com/sun/star/lang/DisposedException.hpp>
29 #include <cppuhelper/implbase2.hxx>
30 #include <vcl/vclevent.hxx>
31 #include <toolkit/awt/vclxaccessiblecomponent.hxx>
32 
33 // class AccessibleListBox -----------------------------------------------
34 
35 class SvtIconChoiceCtrl;
36 
37 //........................................................................
38 namespace accessibility
39 {
40 //........................................................................
41 
42 	typedef ::cppu::ImplHelper2<  ::com::sun::star::accessibility::XAccessible
43 								, ::com::sun::star::accessibility::XAccessibleSelection> AccessibleIconChoiceCtrl_BASE;
44 
45 	/** the class OAccessibleListBoxEntry represents the base class for an accessible object of a listbox entry
46 	*/
47 	class AccessibleIconChoiceCtrl	:public AccessibleIconChoiceCtrl_BASE
48 									,public VCLXAccessibleComponent
49 	{
50 	protected:
51 		::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xParent;
52 
53 	protected:
54 		virtual ~AccessibleIconChoiceCtrl();
55 
56 		/** this function is called upon disposing the component */
57 		virtual void SAL_CALL	disposing();
58 
59 		virtual void	ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
60 		virtual void	FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
61 
62 		SvtIconChoiceCtrl* getCtrl();
63 	public:
64 		/** OAccessibleBase needs a valid view
65 			@param	_rIconCtrl
66 				is the box for which we implement an accessible object
67 			@param	_xParent
68 				is our parent accessible object
69 		*/
70 		AccessibleIconChoiceCtrl( SvtIconChoiceCtrl& _rIconCtrl,
71 								  const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _xParent );
72 
73 		// XTypeProvider
74 		DECLARE_XTYPEPROVIDER()
75 
76 		// XInterface
77 		DECLARE_XINTERFACE()
78 
79 		// XServiceInfo
80 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw(com::sun::star::uno::RuntimeException);
81 		virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
82 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(com::sun::star::uno::RuntimeException);
83 
84 		// XServiceInfo - static methods
85 		static com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw(com::sun::star::uno::RuntimeException);
86 		static ::rtl::OUString getImplementationName_Static(void) throw(com::sun::star::uno::RuntimeException);
87 
88 		// XAccessible
89 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext(  ) throw (::com::sun::star::uno::RuntimeException);
90 
91 		// XAccessibleContext
92 		virtual sal_Int32 SAL_CALL getAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
93 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw ( ::com::sun::star::lang::IndexOutOfBoundsException,
94                 ::com::sun::star::uno::RuntimeException );
95 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent(  ) throw (::com::sun::star::uno::RuntimeException);
96 		virtual sal_Int16 SAL_CALL getAccessibleRole(  ) throw (::com::sun::star::uno::RuntimeException);
97 		virtual ::rtl::OUString SAL_CALL getAccessibleDescription(  ) throw (::com::sun::star::uno::RuntimeException);
98 		virtual ::rtl::OUString SAL_CALL getAccessibleName(  ) throw (::com::sun::star::uno::RuntimeException);
99 
100 		// XAccessibleSelection
101 		void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
102 		sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
103 		void SAL_CALL clearAccessibleSelection(  ) throw (::com::sun::star::uno::RuntimeException);
104 		void SAL_CALL selectAllAccessibleChildren(  ) throw (::com::sun::star::uno::RuntimeException);
105 		sal_Int32 SAL_CALL getSelectedAccessibleChildCount(  ) throw (::com::sun::star::uno::RuntimeException);
106 		::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);
107 		void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
108 	};
109 
110 //........................................................................
111 }// namespace accessibility
112 //........................................................................
113 
114 #endif // ACCESSIBILITY_EXT_ACCESSIBLEICONCHOICECTRL_HXX_
115 
116