xref: /aoo42x/main/sfx2/source/sidebar/Accessible.hxx (revision 3e0f1122)
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 SFX_SIDEBAR_ACCESSIBLE_HXX
23 #define SFX_SIDEBAR_ACCESSIBLE_HXX
24 
25 #include <com/sun/star/accessibility/XAccessible.hpp>
26 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
27 
28 #include <cppuhelper/compbase1.hxx>
29 #include <cppuhelper/basemutex.hxx>
30 
31 namespace css = ::com::sun::star;
32 namespace cssu = ::com::sun::star::uno;
33 
34 namespace
35 {
36     typedef ::cppu::WeakComponentImplHelper1 <
37         css::accessibility::XAccessible
38         > AccessibleInterfaceBase;
39 }
40 
41 namespace sfx2 { namespace sidebar {
42 
43 
44 /** Simple implementation of the XAccessible interface.
45     Its getAccessibleContext() method returns a context object given
46     to its constructor.
47 */
48 class Accessible
49     : private ::boost::noncopyable,
50       private ::cppu::BaseMutex,
51       public AccessibleInterfaceBase
52 {
53 public:
54     Accessible (
55         const cssu::Reference<css::accessibility::XAccessibleContext>& rxContext);
56     virtual ~Accessible (void);
57 
58     virtual void SAL_CALL disposing (void);
59 
60 
61     // XAccessible
62     virtual cssu::Reference<css::accessibility::XAccessibleContext> SAL_CALL getAccessibleContext (void)
63         throw (cssu::RuntimeException);
64 
65 private:
66     cssu::Reference<css::accessibility::XAccessibleContext> mxContext;
67 };
68 
69 
70 } } // end of namespace sfx2::sidebar
71 
72 #endif
73