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 _TOOLKIT_HELPER_UNOWRAPPER_HXX_
25 #define _TOOLKIT_HELPER_UNOWRAPPER_HXX_
26 
27 #include <com/sun/star/awt/XToolkit.hpp>
28 #include <com/sun/star/awt/XGraphics.hpp>
29 #include <com/sun/star/awt/XWindowPeer.hpp>
30 #include <com/sun/star/accessibility/XAccessible.hpp>
31 #include <toolkit/helper/accessibilityclient.hxx>
32 
33 #include <vcl/unowrap.hxx>
34 #include <vcl/window.hxx>
35 
36 //	----------------------------------------------------
37 //	class UnoWrapper
38 //	----------------------------------------------------
39 
40 class UnoWrapper : public UnoWrapperBase
41 {
42 private:
43 	::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit>  mxToolkit;
44     ::toolkit::AccessibilityClient                                      maAccessibleFactoryAccess;
45 
46 public:
47 	UnoWrapper( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit>& rxToolkit );
48 
49     virtual void        Destroy();
50 
51 	// Toolkit
52 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit> GetVCLToolkit();
53 
54 	// Graphics
55 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics>	CreateGraphics( OutputDevice* pOutDev );
56 	virtual void				ReleaseAllGraphics( OutputDevice* pOutDev );
57 
58 	// Window
59 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer> GetWindowInterface( Window* pWindow, sal_Bool bCreate );
60 	virtual void				SetWindowInterface( Window* pWindow, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer> xIFace );
61 
62 	void				WindowDestroyed( Window* pWindow );
63 	void 				WindowEvent_Move( Window* pWindow );
64 	void 				WindowEvent_Resize( Window* pWindow );
65 	void 				WindowEvent_Show( Window* pWindow, sal_Bool bShow );
66 	void 				WindowEvent_Close( Window* pWindow );
67 	void 				WindowEvent_Minimize( Window* pWindow );
68 	void 				WindowEvent_Normalize( Window* pWindow );
69 	void 				WindowEvent_Activate( Window* pWindow, sal_Bool bActivated );
70 	void 				WindowEvent_MouseButtonUp( Window* pWindow, const MouseEvent& rEvt );
71 	void 				WindowEvent_MouseButtonDown( Window* pWindow, const MouseEvent& rEvt );
72 	void 				WindowEvent_MouseMove( Window* pWindow, const MouseEvent& rEvt );
73 	void 				WindowEvent_Command( Window* pWindow, const CommandEvent& rCEvt );
74 	void 				WindowEvent_KeyInput( Window* pWindow, const KeyEvent& rEvt );
75 	void 				WindowEvent_KeyUp( Window* pWindow, const KeyEvent& rEvt );
76 	void 				WindowEvent_GetFocus( Window* pWindow );
77 	void 				WindowEvent_LoseFocus( Window* pWindow );
78 	void 				WindowEvent_Paint( Window* pWindow, const Rectangle& rRect );
79 
80 	// Accessibility
81 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >
82 						CreateAccessible( Menu* pMenu, sal_Bool bIsMenuBar );
83 
84 private:
85     virtual ~UnoWrapper();
86 };
87 
88 #endif // _TOOLKIT_HELPER_UNOWRAPPER_HXX_
89 
90