xref: /trunk/main/chart2/source/controller/inc/AccessibleTextHelper.hxx (revision 91144cd0085a7583d2099b982122deb2184ab956)
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 #ifndef CHART2_ACCESSIBLETEXTHELPER_HXX
24 #define CHART2_ACCESSIBLETEXTHELPER_HXX
25 
26 #include "MutexContainer.hxx"
27 #include <cppuhelper/compbase2.hxx>
28 #include <com/sun/star/lang/XInitialization.hpp>
29 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
30 
31 // forward declaration of helper class from svx
32 namespace accessibility
33 {
34 class AccessibleTextHelper;
35 }
36 
37 namespace chart
38 {
39 
40 class DrawViewWrapper;
41 
42 namespace impl
43 {
44 typedef ::cppu::WeakComponentImplHelper2<
45         ::com::sun::star::lang::XInitialization,
46         ::com::sun::star::accessibility::XAccessibleContext >
47     AccessibleTextHelper_Base;
48 }
49 
50 class AccessibleTextHelper :
51         public MutexContainer,
52         public impl::AccessibleTextHelper_Base
53 {
54 public:
55     explicit AccessibleTextHelper( DrawViewWrapper * pDrawViewWrapper );
56     virtual ~AccessibleTextHelper();
57 
58     // ____ XInitialization ____
59     /** Must be called at least once for this helper class to work.
60 
61         mandatory parameter 0: type string. This is the CID that is used to find
62             the corresponding drawing object that contains the text that should
63             be handled by this helper class.
64 1
65         mandatory parameter 1: type XAccessible.  Is used as EventSource for the
66             ::accessibility::AccessibleTextHelper (svx)
67 
68         mandatory parameter 2: type awt::XWindow.  The Window that shows the
69             text currently.
70      */
71     virtual void SAL_CALL initialize(
72         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments );
73 
74     // ____ XAccessibleContext ____
75     virtual ::sal_Int32 SAL_CALL getAccessibleChildCount();
76     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild(
77         ::sal_Int32 i );
78     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent();
79     virtual ::sal_Int32 SAL_CALL getAccessibleIndexInParent();
80     virtual ::sal_Int16 SAL_CALL getAccessibleRole();
81     virtual ::rtl::OUString SAL_CALL getAccessibleDescription();
82     virtual ::rtl::OUString SAL_CALL getAccessibleName();
83     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet();
84     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet();
85     virtual ::com::sun::star::lang::Locale SAL_CALL getLocale();
86 
87 private:
88     ::accessibility::AccessibleTextHelper * m_pTextHelper;
89     DrawViewWrapper *                       m_pDrawViewWrapper;
90 };
91 
92 } //  namespace chart
93 
94 // CHART2_ACCESSIBLETEXTHELPER_HXX
95 #endif
96