xref: /trunk/main/sw/source/core/access/acctextframe.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 _ACCTEXTFRAME_HXX
24 #define _ACCTEXTFRAME_HXX
25 #include "accframebase.hxx"
26 
27 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
28 
29 class SwFlyFrm;
30 namespace utl { class AccessibleRelationSetHelper; }
31 namespace com { namespace star {
32     namespace accessibility { struct AccessibleRelation; }
33 } }
34 
35 class SwAccessibleTextFrame : public SwAccessibleFrameBase,
36         public ::com::sun::star::accessibility::XAccessibleSelection
37 {
38 private:
39     // --> OD 2009-07-14 #i73249#
40     ::rtl::OUString msTitle;
41     ::rtl::OUString msDesc;
42     // <--
43 
44 protected:
45 
46     virtual ~SwAccessibleTextFrame();
47 
48     virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
49 
50 public:
51 
52     SwAccessibleTextFrame( SwAccessibleMap* pInitMap, const SwFlyFrm* pFlyFrm );
53 
54     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
55         ::com::sun::star::uno::Type const & rType );
56     virtual void SAL_CALL acquire() throw ();
57     virtual void SAL_CALL release() throw ();
58     //=====  XAccessibleSelection  ============================================
59     virtual void SAL_CALL selectAccessibleChild(
60         sal_Int32 nChildIndex );
61 
62     virtual sal_Bool SAL_CALL isAccessibleChildSelected(
63         sal_Int32 nChildIndex );
64 
65     virtual void SAL_CALL clearAccessibleSelection(  );
66 
67     virtual void SAL_CALL selectAllAccessibleChildren(  );
68 
69     virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount(  );
70 
71     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(
72         sal_Int32 nSelectedChildIndex );
73 
74     virtual void SAL_CALL deselectAccessibleChild(
75         sal_Int32 nSelectedChildIndex );
76 
77     //=====  XAccessibleContext  ==============================================
78 
79     // --> OD 2009-07-14 #i73249#
80     /// Return the object's current name.
81     virtual ::rtl::OUString SAL_CALL
82         getAccessibleName (void);
83     // <--
84     /// Return this object's description.
85     virtual ::rtl::OUString SAL_CALL
86         getAccessibleDescription (void);
87 
88     //=====  XServiceInfo  ====================================================
89 
90     /** Returns an identifier for the implementation of this object.
91     */
92     virtual ::rtl::OUString SAL_CALL
93         getImplementationName (void);
94 
95     /** Return whether the specified service is supported by this class.
96     */
97     virtual sal_Bool SAL_CALL
98         supportsService (const ::rtl::OUString& sServiceName);
99 
100     /** Returns a list of all supported services.  In this case that is just
101         the AccessibleContext service.
102     */
103     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL
104         getSupportedServiceNames (void);
105 
106     //====== XTypeProvider ====================================================
107     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  );
108 
109 
110     //=====  XAccessibleContext::getAccessibleRelationSet  ====================
111 
112     // text frame may have accessible relations to their
113     // predocesor/successor frames
114 
115 private:
116     // helper methods for getAccessibleRelationSet:
117     SwFlyFrm* getFlyFrm() const;
118 
119     com::sun::star::accessibility::AccessibleRelation makeRelation(
120         sal_Int16 nType, const SwFlyFrm* pFrm );
121 
122 public:
123 
124     virtual ::com::sun::star::uno::Reference<
125             ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL
126         getAccessibleRelationSet (void);
127 };
128 
129 
130 #endif
131