xref: /aoo4110/main/svx/inc/svx/unoshtxt.hxx (revision b1cdbd2c)
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 SVX_UNOSHTXT_HXX
25 #define SVX_UNOSHTXT_HXX
26 
27 #include <memory>
28 #include <editeng/unoedsrc.hxx>
29 #include "svx/svxdllapi.h"
30 
31 namespace com { namespace sun { namespace star {
32     namespace uno {
33         class XInterface;
34     }
35     namespace accessibility {
36         struct TextSegment;
37     }
38 } } }
39 
40 class SvxTextForwarder;
41 class SdrObject;
42 class SdrModel;
43 class SdrView;
44 class Window;
45 class SvxTextEditSourceImpl;
46 class SdrText;
47 
48 class SVX_DLLPUBLIC SvxTextEditSource : public SvxEditSource, public SvxViewForwarder
49 {
50 public:
51 	SvxTextEditSource( SdrObject* pObj, SdrText* pText, ::com::sun::star::uno::XInterface* pOwner);
52 
53     /** Since the views don't broadcast their dying, make sure that
54         this object gets destroyed if the view becomes invalid
55 
56         The window is necessary, since our views can display on multiple windows
57      */
58 	SvxTextEditSource( SdrObject& rObj, SdrText* pText, SdrView& rView, const Window& rViewWindow );
59 
60 	virtual ~SvxTextEditSource();
61 
62 	virtual SvxEditSource*			Clone() const;
63 	virtual SvxTextForwarder*		GetTextForwarder();
64  	virtual SvxViewForwarder*		GetViewForwarder();
65  	virtual SvxEditViewForwarder*	GetEditViewForwarder( sal_Bool bCreate = sal_False );
66 	virtual void					UpdateData();
67 
68 	virtual void addRange( SvxUnoTextRangeBase* pNewRange );
69 	virtual void removeRange( SvxUnoTextRangeBase* pOldRange );
70 	virtual const SvxUnoTextRangeBaseList& getRanges() const;
71 
72     virtual SfxBroadcaster&			GetBroadcaster() const;
73 
74 	SdrObject* GetSdrObject() const;
75 
76 	void lock();
77 	void unlock();
78 
79 //	static sal_Bool hasLevels( const SdrObject* pObject );
80 
81     // the SvxViewForwarder interface
82 	virtual sal_Bool		IsValid() const;
83     virtual Rectangle	GetVisArea() const;
84     virtual Point		LogicToPixel( const Point&, const MapMode& ) const;
85     virtual Point		PixelToLogic( const Point&, const MapMode& ) const;
86 
87 	void ChangeModel( SdrModel* pNewModel );
88 
89     void UpdateOutliner();
90 
91 private:
92 	SVX_DLLPRIVATE SvxTextEditSource( SvxTextEditSourceImpl* pImpl );
93 
94 	SvxTextEditSourceImpl*	mpImpl;
95 };
96 
97 #endif
98