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 SD_ACCESSIBILITY_ACCESSIBLE_OUTLINE_EDITSOURCE_HXX
25 #define SD_ACCESSIBILITY_ACCESSIBLE_OUTLINE_EDITSOURCE_HXX
26 
27 #include <memory>
28 #include <vcl/svapp.hxx>
29 #include <svl/brdcst.hxx>
30 #include <svl/lstner.hxx>
31 #include <editeng/unoedsrc.hxx>
32 #include <editeng/editdata.hxx>
33 #include <editeng/unoforou.hxx>
34 #include <editeng/unoviwou.hxx>
35 
36 class OutlinerView;
37 class SdrOutliner;
38 class SdrView;
39 class Window;
40 
41 namespace accessibility
42 {
43 	/**	Implementation of the SvxEditSource interface in the SdOutlineView
44 
45 		This class connects the SdOutlineView and its EditEngine
46 		outliner with the AccessibleTextHelper, which provides all
47 		necessary functionality to make the outliner text accessible
48 
49     	@see SvxEditSource
50     	@see SvxViewForwarder
51     */
52     class AccessibleOutlineEditSource :	public SvxEditSource, public SvxViewForwarder, public SfxBroadcaster, public SfxListener
53     {
54     public:
55         /// Create an SvxEditSource interface for the given Outliner
56         AccessibleOutlineEditSource(
57             SdrOutliner& rOutliner,
58             SdrView& rView,
59             OutlinerView& rOutlView,
60             const ::Window& rViewWindow );
61         virtual ~AccessibleOutlineEditSource();
62 
63         /// This method is disabled and always returns NULL
64         virtual SvxEditSource* 			Clone() const;
65         virtual SvxTextForwarder* 		GetTextForwarder();
66         virtual SvxViewForwarder* 		GetViewForwarder();
67         virtual SvxEditViewForwarder*  	GetEditViewForwarder( sal_Bool bCreate = sal_False );
68         virtual void					UpdateData();
69         virtual SfxBroadcaster&			GetBroadcaster() const;
70 
71         // the view forwarder
72         virtual sal_Bool		IsValid() const;
73         virtual Rectangle	GetVisArea() const;
74         virtual Point		LogicToPixel( const Point& rPoint, const MapMode& rMapMode ) const;
75         virtual Point		PixelToLogic( const Point& rPoint, const MapMode& rMapMode ) const;
76 
77         // SfxListener
78         virtual void		Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
79 
80     private:
81 
82         // declared, but not defined
83         AccessibleOutlineEditSource( const AccessibleOutlineEditSource& );
84         AccessibleOutlineEditSource& operator=( const AccessibleOutlineEditSource& );
85 
86         DECL_LINK( NotifyHdl, EENotify* );
87 
88         SdrView&						mrView;
89         const ::Window& mrWindow;
90         SdrOutliner*					mpOutliner;
91         OutlinerView* mpOutlinerView;
92 
93         SvxOutlinerForwarder			mTextForwarder;
94         SvxDrawOutlinerViewForwarder	mViewForwarder;
95 
96     };
97 
98 } // end of namespace accessibility
99 
100 #endif
101