Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
5 : : * This Source Code Form is subject to the terms of the Mozilla Public
6 : : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : :
20 : : #ifndef _TOOLKIT_AWT_VCLXTOOLKIT_HXX_
21 : : #define _TOOLKIT_AWT_VCLXTOOLKIT_HXX_
22 : :
23 : : #include <com/sun/star/lang/XServiceInfo.hpp>
24 : : #include <com/sun/star/awt/XSystemChildFactory.hpp>
25 : : #include <com/sun/star/awt/XToolkit2.hpp>
26 : : #include <com/sun/star/awt/XDataTransferProviderAccess.hpp>
27 : : #include <com/sun/star/lang/XTypeProvider.hpp>
28 : : #include <com/sun/star/awt/XExtendedToolkit.hpp>
29 : : #include <com/sun/star/awt/XReschedule.hpp>
30 : : #include <com/sun/star/awt/XMessageBoxFactory.hpp>
31 : : #include <cppuhelper/compbase7.hxx>
32 : : #include "cppuhelper/interfacecontainer.hxx"
33 : : #include <osl/mutex.hxx>
34 : : #include <osl/module.h>
35 : : #include <tools/link.hxx>
36 : : #include <tools/wintypes.hxx>
37 : :
38 : : #include <toolkit/dllapi.h>
39 : :
40 : : TOOLKIT_DLLPUBLIC WinBits ImplGetWinBits( sal_uInt32 nComponentAttribs, sal_uInt16 nCompType );
41 : :
42 : : class Window;
43 : : class VCLXWindow;
44 : : class VclSimpleEvent;
45 : :
46 : : namespace com {
47 : : namespace sun {
48 : : namespace star {
49 : : namespace lang {
50 : : struct EventObject;
51 : : }
52 : : namespace awt {
53 : : struct WindowDescriptor;
54 : : } } } }
55 : :
56 : : extern "C" {
57 : : typedef Window* (SAL_CALL *FN_SvtCreateWindow)( VCLXWindow** ppNewComp, const ::com::sun::star::awt::WindowDescriptor* pDescriptor, Window* pParent, WinBits nWinBits );
58 : : }
59 : :
60 : :
61 : : // ----------------------------------------------------
62 : : // class VCLXTOOLKIT
63 : : // ----------------------------------------------------
64 : :
65 : 55620 : class VCLXToolkit_Impl
66 : : {
67 : : protected:
68 : : ::osl::Mutex maMutex;
69 : : };
70 : :
71 : : class VCLXToolkit : public VCLXToolkit_Impl,
72 : : public cppu::WeakComponentImplHelper7<
73 : : ::com::sun::star::awt::XToolkit2,
74 : : ::com::sun::star::lang::XServiceInfo,
75 : : ::com::sun::star::awt::XSystemChildFactory,
76 : : ::com::sun::star::awt::XMessageBoxFactory,
77 : : ::com::sun::star::awt::XDataTransferProviderAccess,
78 : : ::com::sun::star::awt::XExtendedToolkit,
79 : : ::com::sun::star::awt::XReschedule >
80 : : {
81 : : ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard;
82 : : ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxSelection;
83 : :
84 : : oslModule hSvToolsLib;
85 : : FN_SvtCreateWindow fnSvtCreateWindow;
86 : :
87 : : ::cppu::OInterfaceContainerHelper m_aTopWindowListeners;
88 : : ::cppu::OInterfaceContainerHelper m_aKeyHandlers;
89 : : ::cppu::OInterfaceContainerHelper m_aFocusListeners;
90 : : ::Link m_aEventListenerLink;
91 : : ::Link m_aKeyListenerLink;
92 : : bool m_bEventListener;
93 : : bool m_bKeyListener;
94 : :
95 : : DECL_LINK(eventListenerHandler, ::VclSimpleEvent const *);
96 : :
97 : : DECL_LINK(keyListenerHandler, ::VclSimpleEvent const *);
98 : :
99 : : void callTopWindowListeners(
100 : : ::VclSimpleEvent const * pEvent,
101 : : void (SAL_CALL ::com::sun::star::awt::XTopWindowListener::* pFn)(
102 : : ::com::sun::star::lang::EventObject const &));
103 : :
104 : : long callKeyHandlers(::VclSimpleEvent const * pEvent, bool bPressed);
105 : :
106 : : void callFocusListeners(::VclSimpleEvent const * pEvent, bool bGained);
107 : :
108 : : protected:
109 : 44320 : ::osl::Mutex& GetMutex() { return maMutex; }
110 : :
111 : : virtual void SAL_CALL disposing();
112 : :
113 : : Window* ImplCreateWindow( VCLXWindow** ppNewComp, const ::com::sun::star::awt::WindowDescriptor& rDescriptor, Window* pParent, WinBits nWinBits );
114 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > ImplCreateWindow( const ::com::sun::star::awt::WindowDescriptor& Descriptor, WinBits nWinBits );
115 : :
116 : : public:
117 : :
118 : : VCLXToolkit( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
119 : : ~VCLXToolkit();
120 : :
121 : : // ::com::sun::star::awt::XToolkit2
122 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL createScreenCompatibleDeviceUsingBuffer( sal_Int32 Width, sal_Int32 Height, sal_Int32 ScaleNumerator, sal_Int32 ScaleDenominator, sal_Int32 XOffset, sal_Int32 YOffset, sal_Int64 AddressOfMemoryBufferForSharedArrayWrapper ) throw
123 : : (::com::sun::star::uno::RuntimeException);
124 : :
125 : : // ::com::sun::star::awt::XToolkit
126 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > SAL_CALL getDesktopWindow( ) throw(::com::sun::star::uno::RuntimeException);
127 : : ::com::sun::star::awt::Rectangle SAL_CALL getWorkArea( ) throw(::com::sun::star::uno::RuntimeException);
128 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > SAL_CALL createWindow( const ::com::sun::star::awt::WindowDescriptor& Descriptor ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
129 : : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > > SAL_CALL createWindows( const ::com::sun::star::uno::Sequence< ::com::sun::star::awt::WindowDescriptor >& Descriptors ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
130 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL createScreenCompatibleDevice( sal_Int32 Width, sal_Int32 Height ) throw
131 : : (::com::sun::star::uno::RuntimeException);
132 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion > SAL_CALL createRegion( ) throw(::com::sun::star::uno::RuntimeException);
133 : :
134 : : // ::com::sun::star::awt::XSystemChildFactory
135 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > SAL_CALL createSystemChild( const ::com::sun::star::uno::Any& Parent, const ::com::sun::star::uno::Sequence< sal_Int8 >& ProcessId, sal_Int16 SystemType ) throw(::com::sun::star::uno::RuntimeException);
136 : :
137 : : // ::com::sun::star::awt::XMessageBoxFactory
138 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMessageBox > SAL_CALL createMessageBox( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& aParent, const ::com::sun::star::awt::Rectangle& aPosSize, const ::rtl::OUString& aType, ::sal_Int32 aButtons, const ::rtl::OUString& aTitle, const ::rtl::OUString& aMessage ) throw (::com::sun::star::uno::RuntimeException);
139 : :
140 : : // ::com::sun::star::awt::XDataTransfer
141 : : ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer > SAL_CALL getDragGestureRecognizer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& window ) throw(::com::sun::star::uno::RuntimeException);
142 : : ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > SAL_CALL getDragSource( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& window ) throw(::com::sun::star::uno::RuntimeException);
143 : : ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTarget > SAL_CALL getDropTarget( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& window ) throw(::com::sun::star::uno::RuntimeException);
144 : : ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > SAL_CALL getClipboard( const ::rtl::OUString& clipboardName ) throw(::com::sun::star::uno::RuntimeException);
145 : :
146 : : // ::com::sun::star::lang::XServiceInfo
147 : : ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
148 : : sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
149 : : ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
150 : :
151 : : // ::com::sun::star::awt::XExtendedToolkit:
152 : :
153 : : virtual ::sal_Int32 SAL_CALL getTopWindowCount()
154 : : throw (::com::sun::star::uno::RuntimeException);
155 : :
156 : : virtual
157 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindow >
158 : : SAL_CALL getTopWindow(::sal_Int32 nIndex)
159 : : throw (::com::sun::star::uno::RuntimeException);
160 : :
161 : : virtual
162 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindow >
163 : : SAL_CALL getActiveTopWindow()
164 : : throw (::com::sun::star::uno::RuntimeException);
165 : :
166 : : virtual void SAL_CALL addTopWindowListener(
167 : : ::com::sun::star::uno::Reference<
168 : : ::com::sun::star::awt::XTopWindowListener > const & rListener)
169 : : throw (::com::sun::star::uno::RuntimeException);
170 : :
171 : : virtual void SAL_CALL removeTopWindowListener(
172 : : ::com::sun::star::uno::Reference<
173 : : ::com::sun::star::awt::XTopWindowListener > const & rListener)
174 : : throw (::com::sun::star::uno::RuntimeException);
175 : :
176 : : virtual void SAL_CALL addKeyHandler(
177 : : ::com::sun::star::uno::Reference<
178 : : ::com::sun::star::awt::XKeyHandler > const & rHandler)
179 : : throw (::com::sun::star::uno::RuntimeException);
180 : :
181 : : virtual void SAL_CALL removeKeyHandler(
182 : : ::com::sun::star::uno::Reference<
183 : : ::com::sun::star::awt::XKeyHandler > const & rHandler)
184 : : throw (::com::sun::star::uno::RuntimeException);
185 : :
186 : : virtual void SAL_CALL addFocusListener(
187 : : ::com::sun::star::uno::Reference<
188 : : ::com::sun::star::awt::XFocusListener > const & rListener)
189 : : throw (::com::sun::star::uno::RuntimeException);
190 : :
191 : : virtual void SAL_CALL removeFocusListener(
192 : : ::com::sun::star::uno::Reference<
193 : : ::com::sun::star::awt::XFocusListener > const & rListener)
194 : : throw (::com::sun::star::uno::RuntimeException);
195 : :
196 : : virtual void SAL_CALL fireFocusGained(
197 : : ::com::sun::star::uno::Reference<
198 : : ::com::sun::star::uno::XInterface > const & source)
199 : : throw (::com::sun::star::uno::RuntimeException);
200 : :
201 : : virtual void SAL_CALL fireFocusLost(
202 : : ::com::sun::star::uno::Reference<
203 : : ::com::sun::star::uno::XInterface > const & source)
204 : : throw (::com::sun::star::uno::RuntimeException);
205 : :
206 : : // ::com::sun::star::awt::XReschedule:
207 : : virtual void SAL_CALL reschedule()
208 : : throw (::com::sun::star::uno::RuntimeException);
209 : :
210 : :
211 : : };
212 : :
213 : : #endif // _TOOLKIT_AWT_VCLXTOOLKIT_HXX_
214 : :
215 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|