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 _SIDEBARTXTCONTROL_HXX
25 #define _SIDEBARTXTCONTROL_HXX
26 
27 #include <vcl/ctrl.hxx>
28 
29 class OutlinerView;
30 class SwView;
31 class SwPostItMgr;
32 class SpellCallbackInfo;
33 
34 namespace sw { namespace sidebarwindows {
35 
36 class SwSidebarWin;
37 
38 class SidebarTxtControl : public Control
39 {
40 	private:
41         SwSidebarWin& mrSidebarWin;
42         SwView& mrDocView;
43         SwPostItMgr& mrPostItMgr;
44 
45         bool mbMouseOver;
46 
47 	protected:
48 		virtual void	Paint( const Rectangle& rRect);
49         virtual void    KeyInput( const KeyEvent& rKeyEvt );
50 		virtual void	MouseMove( const MouseEvent& rMEvt );
51 		virtual void	MouseButtonDown( const MouseEvent& rMEvt );
52 		virtual void	MouseButtonUp( const MouseEvent& rMEvt );
53 		virtual void	Command( const CommandEvent& rCEvt );
54 		virtual void 	LoseFocus();
55 		virtual void	RequestHelp(const HelpEvent &rEvt);
56 		virtual XubString GetSurroundingText() const;
57 		virtual Selection GetSurroundingTextSelection() const;
58 
59         DECL_LINK( Select, Menu* );
60 
61 	public:
62         SidebarTxtControl( SwSidebarWin& rSidebarWin,
63                            WinBits nBits,
64                            SwView& rDocView,
65                            SwPostItMgr& rPostItMgr );
66         ~SidebarTxtControl();
67 
68         virtual void GetFocus();
69 
70         OutlinerView* GetTextView() const;
71 
72         DECL_LINK( OnlineSpellCallback, SpellCallbackInfo*);
73 
74         virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
75 };
76 
77 } } // end of namespace sw::sidebarwindows
78 
79 #endif
80