update credits
[LibreOffice.git] / include / toolkit / awt / vclxtoolkit.hxx
blob00045968ac2748ef2b8b0544c8b8ed10d13b2bc3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef _TOOLKIT_AWT_VCLXTOOLKIT_HXX_
21 #define _TOOLKIT_AWT_VCLXTOOLKIT_HXX_
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/awt/XToolkitExperimental.hpp>
25 #include <com/sun/star/lang/XTypeProvider.hpp>
26 #include <com/sun/star/awt/XMessageBoxFactory.hpp>
27 #include <cppuhelper/compbase2.hxx>
28 #include "cppuhelper/interfacecontainer.hxx"
29 #include <osl/mutex.hxx>
30 #include <osl/module.h>
31 #include <tools/link.hxx>
32 #include <tools/wintypes.hxx>
34 #include <toolkit/dllapi.h>
36 TOOLKIT_DLLPUBLIC WinBits ImplGetWinBits( sal_uInt32 nComponentAttribs, sal_uInt16 nCompType );
38 class Window;
39 class VCLXWindow;
40 class VclSimpleEvent;
42 namespace com {
43 namespace sun {
44 namespace star {
45 namespace lang {
46 struct EventObject;
48 namespace awt {
49 struct WindowDescriptor;
50 } } } }
52 extern "C" {
53 typedef Window* (SAL_CALL *FN_SvtCreateWindow)( VCLXWindow** ppNewComp, const ::com::sun::star::awt::WindowDescriptor* pDescriptor, Window* pParent, WinBits nWinBits );
57 // ----------------------------------------------------
58 // class VCLXTOOLKIT
59 // ----------------------------------------------------
61 class VCLXToolkit_Impl
63 protected:
64 ::osl::Mutex maMutex;
67 class VCLXToolkit : public VCLXToolkit_Impl,
68 public cppu::WeakComponentImplHelper2<
69 ::com::sun::star::awt::XToolkitExperimental,
70 ::com::sun::star::lang::XServiceInfo >
72 ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard;
73 ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxSelection;
75 oslModule hSvToolsLib;
76 FN_SvtCreateWindow fnSvtCreateWindow;
78 ::cppu::OInterfaceContainerHelper m_aTopWindowListeners;
79 ::cppu::OInterfaceContainerHelper m_aKeyHandlers;
80 ::cppu::OInterfaceContainerHelper m_aFocusListeners;
81 ::Link m_aEventListenerLink;
82 ::Link m_aKeyListenerLink;
83 bool m_bEventListener;
84 bool m_bKeyListener;
86 DECL_LINK(eventListenerHandler, ::VclSimpleEvent const *);
88 DECL_LINK(keyListenerHandler, ::VclSimpleEvent const *);
90 void callTopWindowListeners(
91 ::VclSimpleEvent const * pEvent,
92 void (SAL_CALL ::com::sun::star::awt::XTopWindowListener::* pFn)(
93 ::com::sun::star::lang::EventObject const &));
95 long callKeyHandlers(::VclSimpleEvent const * pEvent, bool bPressed);
97 void callFocusListeners(::VclSimpleEvent const * pEvent, bool bGained);
99 protected:
100 ::osl::Mutex& GetMutex() { return maMutex; }
102 virtual void SAL_CALL disposing();
104 Window* ImplCreateWindow( VCLXWindow** ppNewComp, const ::com::sun::star::awt::WindowDescriptor& rDescriptor, Window* pParent, WinBits nWinBits );
105 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > ImplCreateWindow( const ::com::sun::star::awt::WindowDescriptor& Descriptor, WinBits nWinBits );
107 public:
109 VCLXToolkit();
110 ~VCLXToolkit();
112 // ::com::sun::star::awt::XToolkitExperimental
113 ::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
114 (::com::sun::star::uno::RuntimeException);
116 // ::com::sun::star::awt::XToolkit
117 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > SAL_CALL getDesktopWindow( ) throw(::com::sun::star::uno::RuntimeException);
118 ::com::sun::star::awt::Rectangle SAL_CALL getWorkArea( ) throw(::com::sun::star::uno::RuntimeException);
119 ::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);
120 ::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);
121 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL createScreenCompatibleDevice( sal_Int32 Width, sal_Int32 Height ) throw
122 (::com::sun::star::uno::RuntimeException);
123 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion > SAL_CALL createRegion( ) throw(::com::sun::star::uno::RuntimeException);
125 // ::com::sun::star::awt::XSystemChildFactory
126 ::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);
128 // ::com::sun::star::awt::XMessageBoxFactory
129 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 OUString& aType, ::sal_Int32 aButtons, const OUString& aTitle, const OUString& aMessage ) throw (::com::sun::star::uno::RuntimeException);
131 // ::com::sun::star::awt::XDataTransfer
132 ::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);
133 ::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);
134 ::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);
135 ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > SAL_CALL getClipboard( const OUString& clipboardName ) throw(::com::sun::star::uno::RuntimeException);
137 // ::com::sun::star::lang::XServiceInfo
138 OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
139 sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
140 ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
142 // ::com::sun::star::awt::XExtendedToolkit:
144 virtual ::sal_Int32 SAL_CALL getTopWindowCount()
145 throw (::com::sun::star::uno::RuntimeException);
147 virtual
148 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindow >
149 SAL_CALL getTopWindow(::sal_Int32 nIndex)
150 throw (::com::sun::star::uno::RuntimeException);
152 virtual
153 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindow >
154 SAL_CALL getActiveTopWindow()
155 throw (::com::sun::star::uno::RuntimeException);
157 virtual void SAL_CALL addTopWindowListener(
158 ::com::sun::star::uno::Reference<
159 ::com::sun::star::awt::XTopWindowListener > const & rListener)
160 throw (::com::sun::star::uno::RuntimeException);
162 virtual void SAL_CALL removeTopWindowListener(
163 ::com::sun::star::uno::Reference<
164 ::com::sun::star::awt::XTopWindowListener > const & rListener)
165 throw (::com::sun::star::uno::RuntimeException);
167 virtual void SAL_CALL addKeyHandler(
168 ::com::sun::star::uno::Reference<
169 ::com::sun::star::awt::XKeyHandler > const & rHandler)
170 throw (::com::sun::star::uno::RuntimeException);
172 virtual void SAL_CALL removeKeyHandler(
173 ::com::sun::star::uno::Reference<
174 ::com::sun::star::awt::XKeyHandler > const & rHandler)
175 throw (::com::sun::star::uno::RuntimeException);
177 virtual void SAL_CALL addFocusListener(
178 ::com::sun::star::uno::Reference<
179 ::com::sun::star::awt::XFocusListener > const & rListener)
180 throw (::com::sun::star::uno::RuntimeException);
182 virtual void SAL_CALL removeFocusListener(
183 ::com::sun::star::uno::Reference<
184 ::com::sun::star::awt::XFocusListener > const & rListener)
185 throw (::com::sun::star::uno::RuntimeException);
187 virtual void SAL_CALL fireFocusGained(
188 ::com::sun::star::uno::Reference<
189 ::com::sun::star::uno::XInterface > const & source)
190 throw (::com::sun::star::uno::RuntimeException);
192 virtual void SAL_CALL fireFocusLost(
193 ::com::sun::star::uno::Reference<
194 ::com::sun::star::uno::XInterface > const & source)
195 throw (::com::sun::star::uno::RuntimeException);
197 // ::com::sun::star::awt::XReschedule:
198 virtual void SAL_CALL reschedule()
199 throw (::com::sun::star::uno::RuntimeException);
204 #endif // _TOOLKIT_AWT_VCLXTOOLKIT_HXX_
206 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */