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_TABLE_CELLEDITSOURCE_HXX
25 #define SVX_TABLE_CELLEDITSOURCE_HXX
26 
27 #include "cell.hxx"
28 #include "celltypes.hxx"
29 #include "editeng/unoedsrc.hxx"
30 
31 class SvxTextForwarder;
32 class SdrObject;
33 class SdrModel;
34 class SdrView;
35 class Window;
36 
37 namespace sdr { namespace table {
38 
39 class CellEditSourceImpl;
40 
41 class CellEditSource : public SvxEditSource, public SvxViewForwarder
42 {
43 public:
44 	CellEditSource( const CellRef& xCell );
45 
46     /** Since the views don't broadcast their dying, make sure that
47         this object gets destroyed if the view becomes invalid
48 
49         The window is necessary, since our views can display on multiple windows
50      */
51 	CellEditSource( const CellRef& xCell, SdrView& rView, const Window& rViewWindow );
52 	virtual ~CellEditSource();
53 
54 	virtual SvxEditSource*			Clone() const;
55 	virtual SvxTextForwarder*		GetTextForwarder();
56  	virtual SvxViewForwarder*		GetViewForwarder();
57  	virtual SvxEditViewForwarder*	GetEditViewForwarder( sal_Bool bCreate = sal_False );
58 	virtual void					UpdateData();
59 
60 	virtual void addRange( SvxUnoTextRangeBase* pNewRange );
61 	virtual void removeRange( SvxUnoTextRangeBase* pOldRange );
62 	virtual const SvxUnoTextRangeBaseList& getRanges() const;
63 
64     virtual SfxBroadcaster&			GetBroadcaster() const;
65 
66 	void lock();
67 	void unlock();
68 
69     // the SvxViewForwarder interface
70 	virtual sal_Bool		IsValid() const;
71     virtual Rectangle	GetVisArea() const;
72     virtual Point		LogicToPixel( const Point&, const MapMode& ) const;
73     virtual Point		PixelToLogic( const Point&, const MapMode& ) const;
74 
75 	void ChangeModel( SdrModel* pNewModel );
76 
77 private:
78 	CellEditSource( CellEditSourceImpl* pImpl );
79 
80 	CellEditSourceImpl*	mpImpl;
81 };
82 
83 } }
84 
85 #endif
86