diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2013-04-18 18:26:28 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2013-04-23 22:20:31 +0200 |
commit | b9337e22ce1dbf2eba0e8c8db294ae99f4111f91 (patch) | |
tree | 53ee1bd3dfd213815a21579151983cb997922b05 /include/toolkit/awt | |
parent | move global headers script (diff) | |
download | core-b9337e22ce1dbf2eba0e8c8db294ae99f4111f91.tar.gz core-b9337e22ce1dbf2eba0e8c8db294ae99f4111f91.zip |
execute move of global headers
see https://gerrit.libreoffice.org/#/c/3367/
and Change-Id: I00c96fa77d04b33a6f8c8cd3490dfcd9bdc9e84a for details
Change-Id: I199a75bc4042af20817265d5ef85b1134a96ff5a
Diffstat (limited to 'include/toolkit/awt')
22 files changed, 3647 insertions, 0 deletions
diff --git a/include/toolkit/awt/animatedimagespeer.hxx b/include/toolkit/awt/animatedimagespeer.hxx new file mode 100644 index 000000000000..9e22d41a948b --- /dev/null +++ b/include/toolkit/awt/animatedimagespeer.hxx @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef TOOLKIT_ANIMATEDIMAGEPEER_HXX +#define TOOLKIT_ANIMATEDIMAGEPEER_HXX + +#include "toolkit/awt/vclxwindow.hxx" + +#include <com/sun/star/awt/XAnimation.hpp> +#include <com/sun/star/util/XModifyListener.hpp> + +#include <cppuhelper/implbase3.hxx> + +#include <boost/scoped_ptr.hpp> +#include <boost/noncopyable.hpp> + +//...................................................................................................................... +namespace toolkit +{ +//...................................................................................................................... + + //================================================================================================================== + //= AnimatedImagesPeer + //================================================================================================================== + struct AnimatedImagesPeer_Data; + typedef ::cppu::ImplInheritanceHelper3 < VCLXWindow + , ::com::sun::star::awt::XAnimation + , ::com::sun::star::container::XContainerListener + , ::com::sun::star::util::XModifyListener + > AnimatedImagesPeer_Base; + + class AnimatedImagesPeer :public AnimatedImagesPeer_Base + ,public ::boost::noncopyable + { + public: + AnimatedImagesPeer(); + + protected: + ~AnimatedImagesPeer(); + + public: + // XAnimation + virtual void SAL_CALL startAnimation( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL stopAnimation( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isAnimationRunning( ) throw (::com::sun::star::uno::RuntimeException); + + // VclWindowPeer + virtual void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + // XContainerListener + virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + + // XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException); + + // XModifyListener + virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& i_event ) throw (::com::sun::star::uno::RuntimeException); + + // XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + protected: + void ProcessWindowEvent( const VclWindowEvent& i_windowEvent ); + + private: + /** updates our images with the ones from the givem XAnimatedImages component + */ + void impl_updateImages_nolck( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_animatedImages ); + + private: + ::boost::scoped_ptr< AnimatedImagesPeer_Data > m_pData; + }; + +//...................................................................................................................... +} // namespace toolkit +//...................................................................................................................... + +#endif // TOOLKIT_ANIMATEDIMAGEPEER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/scrollabledialog.hxx b/include/toolkit/awt/scrollabledialog.hxx new file mode 100644 index 000000000000..29651938806f --- /dev/null +++ b/include/toolkit/awt/scrollabledialog.hxx @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef TOOLKIT_AWT_SCROLLABLEDIALOG_HXX +#define TOOLKIT_AWT_SCROLLABLEDIALOG_HXX + +#include <vcl/dialog.hxx> +#include <vcl/scrbar.hxx> + +//........................................................................ +namespace toolkit +{ + class ScrollableInterface + { + public: + virtual ~ScrollableInterface() {} + virtual void SetScrollWidth( long nWidth ) = 0; + virtual long GetScrollWidth() = 0; + virtual void SetScrollHeight( long nHeight ) = 0; + virtual long GetScrollHeight() = 0; + virtual void SetScrollLeft( long nLeft ) = 0; + virtual long GetScrollLeft() = 0; + virtual void SetScrollTop( long Top ) = 0; + virtual long GetScrollTop() = 0; + }; + + template < class T > + class ScrollableWrapper : public T, public ScrollableInterface + { + ScrollBar maHScrollBar; + ScrollBar maVScrollBar; + Size maScrollArea; + bool mbHasHoriBar; + bool mbHasVertBar; + Point mnScrollPos; + long mnScrWidth; + + public: + enum ScrollBarVisibility { None, Vert, Hori, Both }; + private: + ScrollBarVisibility maScrollVis; + void lcl_Scroll( long nX, long nY ); + public: + ScrollableWrapper( Window* pParent, WinBits nStyle = WB_STDDIALOG ); + virtual ~ScrollableWrapper(); + virtual void SetScrollWidth( long nWidth ); + virtual long GetScrollWidth() { return maScrollArea.Width(); } + virtual void SetScrollHeight( long nHeight ); + virtual long GetScrollHeight() { return maScrollArea.Height(); } + virtual void SetScrollLeft( long nLeft ); + virtual long GetScrollLeft() { return mnScrollPos.X(); } + virtual void SetScrollTop( long Top ); + virtual long GetScrollTop() { return mnScrollPos.Y() ; } + + void setScrollVisibility( ScrollBarVisibility rState ); + DECL_LINK( ScrollBarHdl, ScrollBar* ); + virtual void ResetScrollBars(); + // Window + virtual void Resize(); + }; +//........................................................................ +} // namespacetoolkit +//........................................................................ + +#endif // TOOLKIT_AWT_SCROLLABLEDIALOG_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxaccessiblecomponent.hxx b/include/toolkit/awt/vclxaccessiblecomponent.hxx new file mode 100644 index 000000000000..379dbb5b7c8a --- /dev/null +++ b/include/toolkit/awt/vclxaccessiblecomponent.hxx @@ -0,0 +1,155 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXACCESSIBLECOMPONENT_HXX_ +#define _TOOLKIT_AWT_VCLXACCESSIBLECOMPONENT_HXX_ + +#include <toolkit/dllapi.h> +#include <com/sun/star/accessibility/XAccessible.hpp> +#include <com/sun/star/accessibility/XAccessibleContext.hpp> +#include <com/sun/star/accessibility/XAccessibleExtendedComponent.hpp> +#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> +#include <com/sun/star/awt/XWindow.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <cppuhelper/compbase3.hxx> +#include <cppuhelper/implbase1.hxx> +#include <comphelper/accimplaccess.hxx> +#include <comphelper/accessiblecomponenthelper.hxx> + +#include <tools/link.hxx> + +class Window; +class VCLXWindow; +class VclSimpleEvent; +class VclWindowEvent; + +namespace utl { +class AccessibleRelationSetHelper; +class AccessibleStateSetHelper; +} + + +// ---------------------------------------------------- +// class VCLXAccessibleComponent +// ---------------------------------------------------- + +typedef ::comphelper::OAccessibleExtendedComponentHelper AccessibleExtendedComponentHelper_BASE; + +typedef ::cppu::ImplHelper1< + ::com::sun::star::lang::XServiceInfo > VCLXAccessibleComponent_BASE; + +class VCLExternalSolarLock; + +class TOOLKIT_DLLPUBLIC VCLXAccessibleComponent + :public AccessibleExtendedComponentHelper_BASE + ,public ::comphelper::OAccessibleImplementationAccess + ,public VCLXAccessibleComponent_BASE +{ +private: + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> mxWindow; + VCLXWindow* mpVCLXindow; + + VCLExternalSolarLock* m_pSolarLock; + +protected: + DECL_LINK( WindowEventListener, VclSimpleEvent* ); + DECL_LINK( WindowChildEventListener, VclSimpleEvent* ); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual void ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent ); + virtual void FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet ); + virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetChildAccessible( const VclWindowEvent& rVclWindowEvent ); + +public: + VCLXAccessibleComponent( VCLXWindow* pVCLXindow ); + ~VCLXAccessibleComponent(); + + VCLXWindow* GetVCLXWindow() const { return mpVCLXindow; } + Window* GetWindow() const; + + virtual void SAL_CALL disposing(); + + // ::com::sun::star::uno::XInterface + DECLARE_XINTERFACE() + // ::com::sun::star::lang::XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const OUString& rServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::accessibility::XAccessibleContext + sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getAccessibleIndexInParent( ) throw (::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::lang::Locale SAL_CALL getLocale( ) throw (::com::sun::star::accessibility::IllegalAccessibleComponentStateException, ::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::accessibility::XAccessibleComponent + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::accessibility::XAccessibleExtendedComponent + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getTitledBorderText( ) throw (::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getToolTipText( ) throw (::com::sun::star::uno::RuntimeException); + +protected: + // base class overridables + ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException); + +private: + /** we may be reparented (if external components use OAccessibleImplementationAccess base class), + so this method here returns the parent in the VCL world, in opposite to the parent + an external component gave us + @precond + the caller must ensure thread safety, i.e. our mutex must be locked + */ + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + getVclParent() const; +}; + +/* ---------------------------------------------------------- + Accessibility only for the Window hierarchy! + Maybe derived classes must overwrite these Accessibility interfaces: + + // XAccessibleContext: + sal_Int16 getAccessibleRole() => VCL Window::GetAccessibleRole() + OUString getAccessibleDescription() => VCL Window::GetAccessibleDescription + OUString getAccessibleName() => VCL Window::GetAccessibleText() => Most windows return Window::GetText() + Reference< XAccessibleRelationSet > getAccessibleRelationSet() + Reference< XAccessibleStateSet > getAccessibleStateSet() => overload FillAccessibleStateSet( ... ) + +---------------------------------------------------------- */ + + +#endif // _TOOLKIT_AWT_VCLXACCESSIBLECOMPONENT_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxbitmap.hxx b/include/toolkit/awt/vclxbitmap.hxx new file mode 100644 index 000000000000..a8893040392d --- /dev/null +++ b/include/toolkit/awt/vclxbitmap.hxx @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXBITMAP_HXX_ +#define _TOOLKIT_AWT_VCLXBITMAP_HXX_ + +#include <com/sun/star/awt/XBitmap.hpp> +#include <com/sun/star/awt/XDisplayBitmap.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <cppuhelper/weak.hxx> +#include <osl/mutex.hxx> +#include <vcl/bitmapex.hxx> + + +// ---------------------------------------------------- +// class VCLXBitmap +// ---------------------------------------------------- + +class VCLXBitmap : public ::com::sun::star::awt::XBitmap, + public ::com::sun::star::awt::XDisplayBitmap, + public ::com::sun::star::lang::XTypeProvider, + public ::com::sun::star::lang::XUnoTunnel, + public ::cppu::OWeakObject +{ +private: + ::osl::Mutex maMutex; + BitmapEx maBitmap; + +protected: + ::osl::Mutex& GetMutex() { return maMutex; } + + +public: + void SetBitmap( const BitmapEx& rBmp ) { maBitmap = rBmp; } + const BitmapEx& GetBitmap() const { return maBitmap; } + + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw(); + static VCLXBitmap* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw(); + sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XBitmap + ::com::sun::star::awt::Size SAL_CALL getSize() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getDIB() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getMaskDIB() throw(::com::sun::star::uno::RuntimeException); +}; + + + + +#endif // _TOOLKIT_AWT_VCLXBITMAP_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxcontainer.hxx b/include/toolkit/awt/vclxcontainer.hxx new file mode 100644 index 000000000000..0b4b0be97127 --- /dev/null +++ b/include/toolkit/awt/vclxcontainer.hxx @@ -0,0 +1,76 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXCONTAINER_HXX_ +#define _TOOLKIT_AWT_VCLXCONTAINER_HXX_ + + +#include <com/sun/star/awt/XVclContainer.hpp> +#include <com/sun/star/awt/XVclContainerPeer.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <cppuhelper/weak.hxx> +#include <osl/mutex.hxx> + +#include <toolkit/awt/vclxwindow.hxx> + + +// ---------------------------------------------------- +// class VCLXContainer +// ---------------------------------------------------- + +class TOOLKIT_DLLPUBLIC VCLXContainer : public ::com::sun::star::awt::XVclContainer, + public ::com::sun::star::awt::XVclContainerPeer, + public VCLXWindow +{ +public: + VCLXContainer(); + ~VCLXContainer(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XVclContainer + void SAL_CALL addVclContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclContainerListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeVclContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclContainerListener >& l ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > > SAL_CALL getWindows( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XVclContainerPeer + void SAL_CALL enableDialogControl( sal_Bool bEnable ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setTabOrder( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > >& WindowOrder, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Tabs, sal_Bool GroupControl ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setGroup( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > >& Windows ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XVclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + + + + +#endif // _TOOLKIT_AWT_VCLXCONTAINER_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxdevice.hxx b/include/toolkit/awt/vclxdevice.hxx new file mode 100644 index 000000000000..eb48f97d9ba6 --- /dev/null +++ b/include/toolkit/awt/vclxdevice.hxx @@ -0,0 +1,118 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXDEVICE_HXX_ +#define _TOOLKIT_AWT_VCLXDEVICE_HXX_ + +#include <toolkit/dllapi.h> +#include <com/sun/star/awt/XDevice.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <cppuhelper/weak.hxx> +#include <osl/mutex.hxx> + +#include <com/sun/star/awt/XUnitConversion.hpp> + +class OutputDevice; +class VirtualDevice; + +// ---------------------------------------------------- +// class VCLXDevice +// ---------------------------------------------------- + +// For using nDummy, no incompatible update, add a sal_Bool bCreatedWithToolkitMember later... +#define FLAGS_CREATEDWITHTOOLKIT 0x00000001 + +class TOOLKIT_DLLPUBLIC VCLXDevice : public ::com::sun::star::awt::XDevice, + public ::com::sun::star::lang::XTypeProvider, + public ::com::sun::star::lang::XUnoTunnel, + public ::com::sun::star::awt::XUnitConversion, + public ::cppu::OWeakObject +{ + friend class VCLXGraphics; + +private: + OutputDevice* mpOutputDevice; + +public: + void* pDummy; + sal_uInt32 nFlags; + +protected: + void DestroyOutputDevice(); + +public: + VCLXDevice(); + ~VCLXDevice(); + + void SetOutputDevice( OutputDevice* pOutDev ) { mpOutputDevice = pOutDev; } + OutputDevice* GetOutputDevice() const { return mpOutputDevice; } + + void SetCreatedWithToolkit( sal_Bool bCreatedWithToolkit ); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw(); + static VCLXDevice* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw(); + sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XDevice, + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > SAL_CALL createGraphics( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL createDevice( sal_Int32 nWidth, sal_Int32 nHeight ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::awt::FontDescriptor > SAL_CALL getFontDescriptors( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL getFont( const ::com::sun::star::awt::FontDescriptor& aDescriptor ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap > SAL_CALL createBitmap( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayBitmap > SAL_CALL createDisplayBitmap( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap >& Bitmap ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XUnitConversion + ::com::sun::star::awt::Point SAL_CALL convertPointToLogic( const ::com::sun::star::awt::Point& aPoint, ::sal_Int16 TargetUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Point SAL_CALL convertPointToPixel( const ::com::sun::star::awt::Point& aPoint, ::sal_Int16 SourceUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL convertSizeToLogic( const ::com::sun::star::awt::Size& aSize, ::sal_Int16 TargetUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL convertSizeToPixel( const ::com::sun::star::awt::Size& aSize, ::sal_Int16 SourceUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + +}; + +// ---------------------------------------------------- +// class VCLXVirtualDevice +// ---------------------------------------------------- + +class VCLXVirtualDevice : public VCLXDevice +{ +public: + ~VCLXVirtualDevice(); + + void SetVirtualDevice( VirtualDevice* pVDev ) { SetOutputDevice( (OutputDevice*)pVDev ); } +}; + + + + +#endif // _TOOLKIT_AWT_VCLXDEVICE_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxfont.hxx b/include/toolkit/awt/vclxfont.hxx new file mode 100644 index 000000000000..bb385f223ef6 --- /dev/null +++ b/include/toolkit/awt/vclxfont.hxx @@ -0,0 +1,89 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXFONT_HXX_ +#define _TOOLKIT_AWT_VCLXFONT_HXX_ + +#include <toolkit/dllapi.h> +#include <com/sun/star/awt/XFont2.hpp> +#include <com/sun/star/awt/XDevice.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <cppuhelper/weak.hxx> +#include <osl/mutex.hxx> +#include <vcl/metric.hxx> + +// ---------------------------------------------------- +// class VCLXFont +// ---------------------------------------------------- + +class TOOLKIT_DLLPUBLIC VCLXFont : public ::com::sun::star::awt::XFont2, + public ::com::sun::star::lang::XTypeProvider, + public ::com::sun::star::lang::XUnoTunnel, + public ::cppu::OWeakObject +{ +private: + ::osl::Mutex maMutex; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice> mxDevice; + Font maFont; + FontMetric* mpFontMetric; + +protected: + sal_Bool ImplAssertValidFontMetric(); + ::osl::Mutex& GetMutex() { return maMutex; } + +public: + VCLXFont(); + ~VCLXFont(); + + void Init( ::com::sun::star::awt::XDevice& rxDev, const Font& rFont ); + const Font& GetFont() const { return maFont; } + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw(); + static VCLXFont* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw(); + sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XFont + ::com::sun::star::awt::FontDescriptor SAL_CALL getFontDescriptor( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::SimpleFontMetric SAL_CALL getFontMetric( ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getCharWidth( sal_Unicode c ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getCharWidths( sal_Unicode nFirst, sal_Unicode nLast ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getStringWidth( const OUString& str ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getStringWidthArray( const OUString& str, ::com::sun::star::uno::Sequence< sal_Int32 >& rDXArray ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL getKernPairs( ::com::sun::star::uno::Sequence< sal_Unicode >& rnChars1, ::com::sun::star::uno::Sequence< sal_Unicode >& rnChars2, ::com::sun::star::uno::Sequence< sal_Int16 >& rnKerns ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XFont2 + sal_Bool SAL_CALL hasGlyphs( const OUString& aText ) throw(::com::sun::star::uno::RuntimeException); +}; + + + +#endif // _TOOLKIT_AWT_VCLXFONT_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxgraphics.hxx b/include/toolkit/awt/vclxgraphics.hxx new file mode 100644 index 000000000000..a99e19fcd940 --- /dev/null +++ b/include/toolkit/awt/vclxgraphics.hxx @@ -0,0 +1,130 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXGRAPHICS_HXX_ +#define _TOOLKIT_AWT_VCLXGRAPHICS_HXX_ + + +#include <com/sun/star/awt/XGraphics.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <cppuhelper/weak.hxx> +#include <osl/mutex.hxx> + +#include <vcl/font.hxx> +#include <tools/color.hxx> +#include <vcl/vclenum.hxx> + +class OutputDevice; +class Region; + + +#define INITOUTDEV_FONT 0x0001 +#define INITOUTDEV_COLORS 0x0002 +#define INITOUTDEV_RASTEROP 0x0004 +#define INITOUTDEV_CLIPREGION 0x0008 +#define INITOUTDEV_ALL 0xFFFF + + +// ---------------------------------------------------- +// class VCLXGraphics +// ---------------------------------------------------- + +class VCLXGraphics : public ::com::sun::star::awt::XGraphics, + public ::com::sun::star::lang::XTypeProvider, + public ::com::sun::star::lang::XUnoTunnel, + public ::cppu::OWeakObject +{ +private: + // used to return same reference on each call to getDevice() + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice> mxDevice; + + OutputDevice* mpOutputDevice; + Font maFont; + Color maTextColor; + Color maTextFillColor; + Color maLineColor; + Color maFillColor; + RasterOp meRasterOp; + Region* mpClipRegion; + +public: + VCLXGraphics(); + ~VCLXGraphics(); + + void Init( OutputDevice* pOutDev ); + void InitOutputDevice( sal_uInt16 nFlags ); + + void SetOutputDevice( OutputDevice* pOutDev ); + OutputDevice* GetOutputDevice() const { return mpOutputDevice; } + + const Font& GetFont() const { return maFont; } + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw(); + static VCLXGraphics* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw(); + sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XGraphics + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL getDevice( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::SimpleFontMetric SAL_CALL getFontMetric() throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setFont( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont >& xNewFont ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL selectFont( const ::com::sun::star::awt::FontDescriptor& aDescription ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setTextColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setTextFillColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLineColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setFillColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setRasterOp( ::com::sun::star::awt::RasterOperation ROP ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setClipRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& Clipping ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL intersectClipRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& xClipping ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL push( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL pop( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL copy( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice >& xSource, sal_Int32 nSourceX, sal_Int32 nSourceY, sal_Int32 nSourceWidth, sal_Int32 nSourceHeight, sal_Int32 nDestX, sal_Int32 nDestY, sal_Int32 nDestWidth, sal_Int32 nDestHeight ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL draw( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDisplayBitmap >& xBitmapHandle, sal_Int32 SourceX, sal_Int32 SourceY, sal_Int32 SourceWidth, sal_Int32 SourceHeight, sal_Int32 DestX, sal_Int32 DestY, sal_Int32 DestWidth, sal_Int32 DestHeight ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL drawPixel( sal_Int32 X, sal_Int32 Y ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL drawLine( sal_Int32 X1, sal_Int32 Y1, sal_Int32 X2, sal_Int32 Y2 ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL drawRect( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL drawRoundedRect( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int32 nHorzRound, sal_Int32 nVertRound ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL drawPolyLine( const ::com::sun::star::uno::Sequence< sal_Int32 >& DataX, const ::com::sun::star::uno::Sequence< sal_Int32 >& DataY ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL drawPolygon( const ::com::sun::star::uno::Sequence< sal_Int32 >& DataX, const ::com::sun::star::uno::Sequence< sal_Int32 >& DataY ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL drawPolyPolygon( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< sal_Int32 > >& DataX, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< sal_Int32 > >& DataY ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL drawEllipse( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL drawArc( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int32 X1, sal_Int32 Y1, sal_Int32 X2, sal_Int32 Y2 ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL drawPie( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int32 X1, sal_Int32 Y1, sal_Int32 X2, sal_Int32 Y2 ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL drawChord( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int32 nX1, sal_Int32 nY1, sal_Int32 nX2, sal_Int32 nY2 ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL drawGradient( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 Height, const ::com::sun::star::awt::Gradient& aGradient ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL drawText( sal_Int32 X, sal_Int32 Y, const OUString& Text ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL drawTextArray( sal_Int32 X, sal_Int32 Y, const OUString& Text, const ::com::sun::star::uno::Sequence< sal_Int32 >& Longs ) throw(::com::sun::star::uno::RuntimeException); +}; + + + + +#endif // _TOOLKIT_AWT_VCLXGRAPHICS_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxmenu.hxx b/include/toolkit/awt/vclxmenu.hxx new file mode 100644 index 000000000000..495e8982ba94 --- /dev/null +++ b/include/toolkit/awt/vclxmenu.hxx @@ -0,0 +1,184 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXMENU_HXX_ +#define _TOOLKIT_AWT_VCLXMENU_HXX_ + +#include <toolkit/dllapi.h> +#include <com/sun/star/awt/XMenuBarExtended.hpp> +#include <com/sun/star/awt/XPopupMenuExtended.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <cppuhelper/weak.hxx> +#include <osl/mutex.hxx> + +#include <tools/link.hxx> + +#include <toolkit/helper/listenermultiplexer.hxx> +#include <vector> + +class Menu; +class MenuBar; +class VclSimpleEvent; +class PopupMenu; + +typedef ::std::vector< + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >* +> PopupMenuRefList; + +// ---------------------------------------------------- +// class VCLXMenu +// ---------------------------------------------------- + +class TOOLKIT_DLLPUBLIC VCLXMenu : public ::com::sun::star::awt::XMenuBarExtended, + public ::com::sun::star::awt::XPopupMenuExtended, + public ::com::sun::star::lang::XServiceInfo, + public ::com::sun::star::lang::XTypeProvider, + public ::com::sun::star::lang::XUnoTunnel, + public ::cppu::OWeakObject +{ +private: + ::osl::Mutex maMutex; + Menu* mpMenu; + MenuListenerMultiplexer maMenuListeners; + PopupMenuRefList maPopupMenuRefs; + +protected: + ::osl::Mutex& GetMutex() { return maMutex; } + + DECL_LINK( MenuEventListener, VclSimpleEvent* ); + + void ImplCreateMenu( sal_Bool bPopup ); + +public: + VCLXMenu(); + VCLXMenu( Menu* pMenu ); + ~VCLXMenu(); + + + Menu* GetMenu() const { return mpMenu; } + sal_Bool IsPopupMenu() const; + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw(); + static VCLXMenu* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw(); + sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XMenu + void SAL_CALL addMenuListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeMenuListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL insertItem( sal_Int16 nItemId, const OUString& aText, sal_Int16 nItemStyle, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeItem( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getItemCount( ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getItemId( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getItemPos( sal_Int16 nId ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL enableItem( sal_Int16 nItemId, sal_Bool bEnable ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isItemEnabled( sal_Int16 nItemId ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setItemText( sal_Int16 nItemId, const OUString& aText ) throw(::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getItemText( sal_Int16 nItemId ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setPopupMenu( sal_Int16 nItemId, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu >& aPopupMenu ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu > SAL_CALL getPopupMenu( sal_Int16 nItemId ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XPopupMenu + void SAL_CALL insertSeparator( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setDefaultItem( sal_Int16 nItemId ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getDefaultItem( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL checkItem( sal_Int16 nItemId, sal_Bool bCheck ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isItemChecked( sal_Int16 nItemId ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL execute( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent, const ::com::sun::star::awt::Rectangle& Area, sal_Int16 Direction ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XMenuBar + + // ::com::sun::star::awt::XMenuExtended + virtual void SAL_CALL setCommand( sal_Int16 nItemId, const OUString& aCommand ) throw (::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getCommand( sal_Int16 nItemId ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setHelpCommand( sal_Int16 nItemId, const OUString& aHelp ) throw (::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getHelpCommand( sal_Int16 nItemId ) throw (::com::sun::star::uno::RuntimeException); + + // ======================================================================== + // ======================================================================== + // ======================================================================== + + // XMenuExtended2 Methods + virtual ::sal_Bool SAL_CALL isPopupMenu( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clear( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::MenuItemType SAL_CALL getItemType( ::sal_Int16 nItemPos ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL hideDisabledEntries( ::sal_Bool bHide ) throw (::com::sun::star::uno::RuntimeException); + + // XMenuBarExtended Methods + + // XPopupMenuExtended Methods + virtual ::sal_Bool SAL_CALL isInExecute( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL endExecute( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setLogo( const ::com::sun::star::awt::MenuLogo& aMenuLogo ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::MenuLogo SAL_CALL getLogo( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL enableAutoMnemonics( ::sal_Bool bEnable ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setAcceleratorKeyEvent( ::sal_Int16 nItemId, const ::com::sun::star::awt::KeyEvent& aKeyEvent ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::KeyEvent SAL_CALL getAcceleratorKeyEvent( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setHelpText( ::sal_Int16 nItemId, const OUString& sHelpText ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getHelpText( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setTipHelpText( ::sal_Int16 nItemId, const OUString& sTipHelpText ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getTipHelpText( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setItemImage( ::sal_Int16 nItemId, const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& xGraphic, ::sal_Bool bScale ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > SAL_CALL getItemImage( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setItemImageAngle( ::sal_Int16 nItemId, ::sal_Int32 nAngle ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getItemImageAngle( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setItemImageMirrorMode( ::sal_Int16 nItemId, ::sal_Bool bMirror ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isItemImageInMirrorMode( ::sal_Int16 nItemId ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); + +}; + +// ---------------------------------------------------- +// class VCLXMenuBar +// ---------------------------------------------------- +class TOOLKIT_DLLPUBLIC VCLXMenuBar : public VCLXMenu +{ +public: + VCLXMenuBar(); + VCLXMenuBar( MenuBar* pMenuBar ); +}; + +// ---------------------------------------------------- +// class VCLXPopupMenu +// ---------------------------------------------------- +class TOOLKIT_DLLPUBLIC VCLXPopupMenu : public VCLXMenu +{ +public: + VCLXPopupMenu(); + VCLXPopupMenu( PopupMenu* pPopMenu ); +}; + +#endif // _TOOLKIT_AWT_VCLXMENU_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxpointer.hxx b/include/toolkit/awt/vclxpointer.hxx new file mode 100644 index 000000000000..56e25bbdd4ce --- /dev/null +++ b/include/toolkit/awt/vclxpointer.hxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXPOINTER_HXX_ +#define _TOOLKIT_AWT_VCLXPOINTER_HXX_ + + +#include <com/sun/star/awt/XPointer.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <cppuhelper/weak.hxx> +#include <osl/mutex.hxx> + +#include <vcl/pointr.hxx> + +// ---------------------------------------------------- +// class VCLXPointer +// ---------------------------------------------------- + +class VCLXPointer : public ::com::sun::star::awt::XPointer, + public ::com::sun::star::lang::XTypeProvider, + public ::com::sun::star::lang::XUnoTunnel, + public ::cppu::OWeakObject +{ +private: + ::osl::Mutex maMutex; + Pointer maPointer; + +protected: + ::osl::Mutex& GetMutex() { return maMutex; } + +public: + VCLXPointer(); + ~VCLXPointer(); + + const Pointer& GetPointer() const { return maPointer; } + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw(); + static VCLXPointer* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw(); + sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XPointer + void SAL_CALL setType( sal_Int32 nType ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getType( ) throw(::com::sun::star::uno::RuntimeException); +}; + + + + +#endif // _TOOLKIT_AWT_VCLXPOINTER_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxprinter.hxx b/include/toolkit/awt/vclxprinter.hxx new file mode 100644 index 000000000000..ca14b2d35f67 --- /dev/null +++ b/include/toolkit/awt/vclxprinter.hxx @@ -0,0 +1,219 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXPRINTER_HXX_ +#define _TOOLKIT_AWT_VCLXPRINTER_HXX_ + + +#include <com/sun/star/awt/XPrinterPropertySet.hpp> +#include <com/sun/star/awt/XPrinter.hpp> +#include <com/sun/star/awt/XPrinterServer.hpp> +#include <com/sun/star/awt/XInfoPrinter.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <cppuhelper/weak.hxx> +#include <osl/mutex.hxx> + +#include <toolkit/helper/mutexandbroadcasthelper.hxx> +#include <cppuhelper/propshlp.hxx> + +#include "vcl/oldprintadaptor.hxx" + +// relevant properties for the printer: +/* + sal_Bool Horizontal + sal_uInt16 CopyCount; + sal_Bool Collate; + String FormDescriptor; + sal_uInt16 Orientation; // PORTRAIT, LANDSCAPE +*/ + +// ---------------------------------------------------- +// class VCLXPrinterPropertySet +// ---------------------------------------------------- + +class VCLXPrinterPropertySet : public ::com::sun::star::awt::XPrinterPropertySet, + public ::com::sun::star::lang::XTypeProvider, + public MutexAndBroadcastHelper, + public ::cppu::OPropertySetHelper +{ +protected: + boost::shared_ptr<Printer> mpPrinter; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > mxPrnDevice; + + sal_Int16 mnOrientation; + sal_Bool mbHorizontal; +public: + VCLXPrinterPropertySet( const OUString& rPrinterName ); + virtual ~VCLXPrinterPropertySet(); + + Printer* GetPrinter() const { return mpPrinter.get(); } + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > GetDevice(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setPropertyValue( const OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::setPropertyValue( rPropertyName, aValue ); } + ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return OPropertySetHelper::getPropertyValue( rPropertyName ); } + void SAL_CALL addPropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::addPropertyChangeListener( rPropertyName, rxListener ); } + void SAL_CALL removePropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::removePropertyChangeListener( rPropertyName, rxListener ); } + void SAL_CALL addVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::addVetoableChangeListener( rPropertyName, rxListener ); } + void SAL_CALL removeVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::removeVetoableChangeListener( rPropertyName, rxListener ); } + + // ::cppu::OPropertySetHelper + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + sal_Bool SAL_CALL convertFastPropertyValue( ::com::sun::star::uno::Any & rConvertedValue, ::com::sun::star::uno::Any & rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::lang::IllegalArgumentException); + void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); + using cppu::OPropertySetHelper::getFastPropertyValue; + void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + + // ::com::sun::star::awt::XPrinterPropertySet + void SAL_CALL setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL selectForm( const OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); +}; + +// ---------------------------------------------------- +// class VCLXPrinter +// ---------------------------------------------------- + +class VCLXPrinter: public ::com::sun::star::awt::XPrinter, + public VCLXPrinterPropertySet, + public ::cppu::OWeakObject +{ + boost::shared_ptr<vcl::OldStylePrintAdaptor> mpListener; + JobSetup maInitJobSetup; +public: + VCLXPrinter( const OUString& rPrinterName ); + ~VCLXPrinter(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + + // ::com::sun::star::beans::XPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertySetInfo(); } + void SAL_CALL setPropertyValue( const OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setPropertyValue( rPropertyName, aValue ); } + ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertyValue( rPropertyName ); } + void SAL_CALL addPropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addPropertyChangeListener( rPropertyName, rxListener ); } + void SAL_CALL removePropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removePropertyChangeListener( rPropertyName, rxListener ); } + void SAL_CALL addVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addVetoableChangeListener( rPropertyName, rxListener ); } + void SAL_CALL removeVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removeVetoableChangeListener( rPropertyName, rxListener ); } + + // ::com::sun::star::awt::XPrinterPropertySet + void SAL_CALL setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setHorizontal( bHorizontal ); } + ::com::sun::star::uno::Sequence< OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getFormDescriptions(); } + void SAL_CALL selectForm( const OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::selectForm( aFormDescription ); } + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getBinarySetup(); } + void SAL_CALL setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setBinarySetup( data ); } + + // ::com::sun::star::awt::XPrinter + sal_Bool SAL_CALL start( const OUString& nJobName, sal_Int16 nCopies, sal_Bool nCollate ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + void SAL_CALL end( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException); + void SAL_CALL terminate( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL startPage( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException); + void SAL_CALL endPage( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException); +}; + +// ---------------------------------------------------- +// class VCLXInfoPrinter +// ---------------------------------------------------- + +class VCLXInfoPrinter: public ::com::sun::star::awt::XInfoPrinter, + public VCLXPrinterPropertySet, + public ::cppu::OWeakObject +{ +public: + VCLXInfoPrinter( const OUString& rPrinterName ); + ~VCLXInfoPrinter(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + + // ::com::sun::star::beans::XPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertySetInfo(); } + void SAL_CALL setPropertyValue( const OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setPropertyValue( rPropertyName, aValue ); } + ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertyValue( rPropertyName ); } + void SAL_CALL addPropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addPropertyChangeListener( rPropertyName, rxListener ); } + void SAL_CALL removePropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removePropertyChangeListener( rPropertyName, rxListener ); } + void SAL_CALL addVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addVetoableChangeListener( rPropertyName, rxListener ); } + void SAL_CALL removeVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removeVetoableChangeListener( rPropertyName, rxListener ); } + + // ::com::sun::star::awt::XPrinterPropertySet + void SAL_CALL setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setHorizontal( bHorizontal ); } + ::com::sun::star::uno::Sequence< OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getFormDescriptions(); } + void SAL_CALL selectForm( const OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::selectForm( aFormDescription ); } + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getBinarySetup(); } + void SAL_CALL setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setBinarySetup( data ); } + + // ::com::sun::star::awt::XInfoPrinter + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL createDevice( ) throw(::com::sun::star::uno::RuntimeException); +}; + +// ---------------------------------------------------- +// class VCLXPrinterServer +// ---------------------------------------------------- + +class VCLXPrinterServer : public ::com::sun::star::awt::XPrinterServer, + public ::com::sun::star::lang::XTypeProvider, + public ::cppu::OWeakObject +{ +public: + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XPrinterServer + ::com::sun::star::uno::Sequence< OUString > SAL_CALL getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinter > SAL_CALL createPrinter( const OUString& printerName ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XInfoPrinter > SAL_CALL createInfoPrinter( const OUString& printerName ) throw(::com::sun::star::uno::RuntimeException); +}; + + + + +#endif // _TOOLKIT_AWT_VCLXPRINTER_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxregion.hxx b/include/toolkit/awt/vclxregion.hxx new file mode 100644 index 000000000000..aa0710425422 --- /dev/null +++ b/include/toolkit/awt/vclxregion.hxx @@ -0,0 +1,89 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXREGION_HXX_ +#define _TOOLKIT_AWT_VCLXREGION_HXX_ + + +#include <com/sun/star/awt/XRegion.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <cppuhelper/weak.hxx> +#include <osl/mutex.hxx> + +#include <vcl/region.hxx> + +// ---------------------------------------------------- +// class VCLXRegion +// ---------------------------------------------------- + +class VCLXRegion : public ::com::sun::star::awt::XRegion, + public ::com::sun::star::lang::XTypeProvider, + public ::com::sun::star::lang::XUnoTunnel, + public ::cppu::OWeakObject +{ +private: + ::osl::Mutex maMutex; + Region maRegion; + +protected: + ::osl::Mutex& GetMutex() { return maMutex; } + +public: + VCLXRegion(); + ~VCLXRegion(); + + void SetRegion( const Region& rRegion ) { maRegion = rRegion; } + const Region& GetRegion() const { return maRegion; } + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw(); + static VCLXRegion* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw(); + sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XRegion + ::com::sun::star::awt::Rectangle SAL_CALL getBounds() throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL clear() throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL move( sal_Int32 nHorzMove, sal_Int32 nVertMove ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL unionRectangle( const ::com::sun::star::awt::Rectangle& rRect ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL intersectRectangle( const ::com::sun::star::awt::Rectangle& rRect ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL excludeRectangle( const ::com::sun::star::awt::Rectangle& rRect ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL xOrRectangle( const ::com::sun::star::awt::Rectangle& rRect ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL unionRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL intersectRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL excludeRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL xOrRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::awt::Rectangle > SAL_CALL getRectangles() throw(::com::sun::star::uno::RuntimeException); + +}; + + + +#endif // _TOOLKIT_AWT_VCLXREGION_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxspinbutton.hxx b/include/toolkit/awt/vclxspinbutton.hxx new file mode 100644 index 000000000000..f1abf21f77f2 --- /dev/null +++ b/include/toolkit/awt/vclxspinbutton.hxx @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef TOOLKIT_AWT_VCLXSPINBUTTON_HXX +#define TOOLKIT_AWT_VCLXSPINBUTTON_HXX + +#include <toolkit/awt/vclxwindow.hxx> +#include <toolkit/helper/listenermultiplexer.hxx> +#include <cppuhelper/implbase1.hxx> +#include <comphelper/uno3.hxx> +#include <com/sun/star/awt/XSpinValue.hpp> + +//........................................................................ +namespace toolkit +{ +//........................................................................ + + //==================================================================== + //= VCLXSpinButton + //==================================================================== + typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XSpinValue + > VCLXSpinButton_Base; + + class VCLXSpinButton :public VCLXWindow + ,public VCLXSpinButton_Base + { + private: + AdjustmentListenerMultiplexer maAdjustmentListeners; + + public: + VCLXSpinButton(); + + protected: + ~VCLXSpinButton( ); + + // XInterface + DECLARE_XINTERFACE() + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // XSpinValue + virtual void SAL_CALL addAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setValue( sal_Int32 n ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setValues( sal_Int32 minValue, sal_Int32 maxValue, sal_Int32 currentValue ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getValue( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMinimum( sal_Int32 minValue ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMaximum( sal_Int32 maxValue ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getMinimum( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getMaximum( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setSpinIncrement( sal_Int32 spinIncrement ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSpinIncrement( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setOrientation( sal_Int32 orientation ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getOrientation( ) throw (::com::sun::star::uno::RuntimeException); + + // VclWindowPeer + virtual void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + // VCLXWindow + void ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent ); + + private: + VCLXSpinButton( const VCLXSpinButton& ); // never implemented + VCLXSpinButton& operator=( const VCLXSpinButton& ); // never implemented + }; + +//........................................................................ +} // namespacetoolkit +//........................................................................ + +#endif // TOOLKIT_INC_TOOLKIT_AWT_VCLXSPINBUTTON_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxsystemdependentwindow.hxx b/include/toolkit/awt/vclxsystemdependentwindow.hxx new file mode 100644 index 000000000000..ebb4d2408942 --- /dev/null +++ b/include/toolkit/awt/vclxsystemdependentwindow.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXSYSTEMDEPENDENTWINDOW_HXX_ +#define _TOOLKIT_AWT_VCLXSYSTEMDEPENDENTWINDOW_HXX_ + + +#include <com/sun/star/awt/XSystemDependentWindowPeer.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <cppuhelper/weak.hxx> +#include <osl/mutex.hxx> + +#include <toolkit/awt/vclxwindow.hxx> + +// ---------------------------------------------------- +// class VCLXSystemDependendtWindow +// ---------------------------------------------------- + +class TOOLKIT_DLLPUBLIC VCLXSystemDependentWindow : public ::com::sun::star::awt::XSystemDependentWindowPeer, + public VCLXWindow +{ +public: + VCLXSystemDependentWindow(); + ~VCLXSystemDependentWindow(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XSystemDependendtWindowPeer + ::com::sun::star::uno::Any SAL_CALL getWindowHandle( const ::com::sun::star::uno::Sequence< sal_Int8 >& ProcessId, sal_Int16 SystemType ) throw(::com::sun::star::uno::RuntimeException); +}; + + + + +#endif // _TOOLKIT_AWT_VCLXSYSTEMDEPENDENTWINDOW_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxtabpagecontainer.hxx b/include/toolkit/awt/vclxtabpagecontainer.hxx new file mode 100644 index 000000000000..af55ed3d6ab4 --- /dev/null +++ b/include/toolkit/awt/vclxtabpagecontainer.hxx @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXTABPAGECONTAINER_HXX_ +#define _TOOLKIT_AWT_VCLXTABPAGECONTAINER_HXX_ + +#include <toolkit/dllapi.h> +#include <com/sun/star/beans/PropertyValues.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/beans/PropertyState.hpp> +#include <com/sun/star/beans/XPropertySetInfo.hpp> +#include <com/sun/star/container/XContainerListener.hpp> +#include "toolkit/awt/vclxwindow.hxx" +#include <com/sun/star/awt/tab/XTabPageContainer.hpp> +#include <toolkit/helper/listenermultiplexer.hxx> +#include <cppuhelper/implbase2.hxx> +#include <toolkit/awt/vclxcontainer.hxx> + +// ---------------------------------------------------- +typedef ::cppu::ImplInheritanceHelper2 < VCLXContainer + , ::com::sun::star::awt::tab::XTabPageContainer + , ::com::sun::star::container::XContainerListener + > VCLXTabPageContainer_Base; +class VCLXTabPageContainer : public VCLXTabPageContainer_Base +{ +public: + VCLXTabPageContainer(); + ~VCLXTabPageContainer(); + + // ::com::sun::star::awt::XView + void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XDevice, + ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::grid::XTabPageContainer + virtual ::sal_Int16 SAL_CALL getActiveTabPageID() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setActiveTabPageID( ::sal_Int16 _activetabpageid ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int16 SAL_CALL getTabPageCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isTabPageActive( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPage( ::sal_Int16 tabPageIndex ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > SAL_CALL getTabPageByID( ::sal_Int16 tabPageID ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addTabPageContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeTabPageContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPageContainerListener >& listener ) throw (::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } + + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XVclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); +protected: + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); +private: + TabPageListenerMultiplexer m_aTabPageListeners; + ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::tab::XTabPage > > m_aTabPages; +}; +#endif // _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxtabpagemodel.hxx b/include/toolkit/awt/vclxtabpagemodel.hxx new file mode 100644 index 000000000000..091c5592a765 --- /dev/null +++ b/include/toolkit/awt/vclxtabpagemodel.hxx @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_ +#define _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_ + +#include <toolkit/dllapi.h> +#include <com/sun/star/beans/PropertyValues.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/beans/PropertyState.hpp> +#include <com/sun/star/beans/XPropertySetInfo.hpp> +#include "toolkit/awt/vclxwindow.hxx" +#include <toolkit/controls/unocontrolmodel.hxx> +#include <com/sun/star/awt/tab/XTabPageModel.hpp> +#include <com/sun/star/awt/tab/XTabPage.hpp> +#include <cppuhelper/implbase1.hxx> +// ---------------------------------------------------- +typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel, + ::com::sun::star::awt::tab::XTabPageModel + > VCLXTabPageModel_Base; +class VCLXTabPageModel : public VCLXTabPageModel_Base +{ +public: + VCLXTabPageModel(); + VCLXTabPageModel( const VCLXTabPageModel& rModel ) : VCLXTabPageModel_Base( rModel ) {;} + ~VCLXTabPageModel(); + + // ::com::sun::star::awt::XView + void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XDevice, + ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException); + + UnoControlModel* Clone() const { return new VCLXTabPageModel( *this ); } + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + // ::com::sun::star::awt::XVclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::tab::XTabPageModel + virtual ::sal_Int16 SAL_CALL getTabPageID() throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL getEnabled() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getTitle() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setTitle( const OUString& _title ) throw (::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getImageURL() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setImageURL( const OUString& _imageurl ) throw (::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getToolTip() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setToolTip( const OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException); +protected: + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); +}; +#endif // _TOOLKIT_AWT_VCLXTABPAGEMODEL_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxtoolkit.hxx b/include/toolkit/awt/vclxtoolkit.hxx new file mode 100644 index 000000000000..00045968ac27 --- /dev/null +++ b/include/toolkit/awt/vclxtoolkit.hxx @@ -0,0 +1,206 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXTOOLKIT_HXX_ +#define _TOOLKIT_AWT_VCLXTOOLKIT_HXX_ + +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/awt/XToolkitExperimental.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/awt/XMessageBoxFactory.hpp> +#include <cppuhelper/compbase2.hxx> +#include "cppuhelper/interfacecontainer.hxx" +#include <osl/mutex.hxx> +#include <osl/module.h> +#include <tools/link.hxx> +#include <tools/wintypes.hxx> + +#include <toolkit/dllapi.h> + +TOOLKIT_DLLPUBLIC WinBits ImplGetWinBits( sal_uInt32 nComponentAttribs, sal_uInt16 nCompType ); + +class Window; +class VCLXWindow; +class VclSimpleEvent; + +namespace com { +namespace sun { +namespace star { +namespace lang { + struct EventObject; +} +namespace awt { + struct WindowDescriptor; +} } } } + +extern "C" { + typedef Window* (SAL_CALL *FN_SvtCreateWindow)( VCLXWindow** ppNewComp, const ::com::sun::star::awt::WindowDescriptor* pDescriptor, Window* pParent, WinBits nWinBits ); +} + + +// ---------------------------------------------------- +// class VCLXTOOLKIT +// ---------------------------------------------------- + +class VCLXToolkit_Impl +{ +protected: + ::osl::Mutex maMutex; +}; + +class VCLXToolkit : public VCLXToolkit_Impl, + public cppu::WeakComponentImplHelper2< + ::com::sun::star::awt::XToolkitExperimental, + ::com::sun::star::lang::XServiceInfo > +{ + ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxClipboard; + ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > mxSelection; + + oslModule hSvToolsLib; + FN_SvtCreateWindow fnSvtCreateWindow; + + ::cppu::OInterfaceContainerHelper m_aTopWindowListeners; + ::cppu::OInterfaceContainerHelper m_aKeyHandlers; + ::cppu::OInterfaceContainerHelper m_aFocusListeners; + ::Link m_aEventListenerLink; + ::Link m_aKeyListenerLink; + bool m_bEventListener; + bool m_bKeyListener; + + DECL_LINK(eventListenerHandler, ::VclSimpleEvent const *); + + DECL_LINK(keyListenerHandler, ::VclSimpleEvent const *); + + void callTopWindowListeners( + ::VclSimpleEvent const * pEvent, + void (SAL_CALL ::com::sun::star::awt::XTopWindowListener::* pFn)( + ::com::sun::star::lang::EventObject const &)); + + long callKeyHandlers(::VclSimpleEvent const * pEvent, bool bPressed); + + void callFocusListeners(::VclSimpleEvent const * pEvent, bool bGained); + +protected: + ::osl::Mutex& GetMutex() { return maMutex; } + + virtual void SAL_CALL disposing(); + + Window* ImplCreateWindow( VCLXWindow** ppNewComp, const ::com::sun::star::awt::WindowDescriptor& rDescriptor, Window* pParent, WinBits nWinBits ); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > ImplCreateWindow( const ::com::sun::star::awt::WindowDescriptor& Descriptor, WinBits nWinBits ); + +public: + + VCLXToolkit(); + ~VCLXToolkit(); + + // ::com::sun::star::awt::XToolkitExperimental + ::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 +(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XToolkit + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > SAL_CALL getDesktopWindow( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Rectangle SAL_CALL getWorkArea( ) throw(::com::sun::star::uno::RuntimeException); + ::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); + ::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); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL createScreenCompatibleDevice( sal_Int32 Width, sal_Int32 Height ) throw +(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion > SAL_CALL createRegion( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XSystemChildFactory + ::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); + + // ::com::sun::star::awt::XMessageBoxFactory + 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); + + // ::com::sun::star::awt::XDataTransfer + ::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); + ::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); + ::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); + ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard > SAL_CALL getClipboard( const OUString& clipboardName ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XExtendedToolkit: + + virtual ::sal_Int32 SAL_CALL getTopWindowCount() + throw (::com::sun::star::uno::RuntimeException); + + virtual + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindow > + SAL_CALL getTopWindow(::sal_Int32 nIndex) + throw (::com::sun::star::uno::RuntimeException); + + virtual + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindow > + SAL_CALL getActiveTopWindow() + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL addTopWindowListener( + ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XTopWindowListener > const & rListener) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL removeTopWindowListener( + ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XTopWindowListener > const & rListener) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL addKeyHandler( + ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XKeyHandler > const & rHandler) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL removeKeyHandler( + ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XKeyHandler > const & rHandler) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL addFocusListener( + ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XFocusListener > const & rListener) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL removeFocusListener( + ::com::sun::star::uno::Reference< + ::com::sun::star::awt::XFocusListener > const & rListener) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL fireFocusGained( + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > const & source) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL fireFocusLost( + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > const & source) + throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XReschedule: + virtual void SAL_CALL reschedule() + throw (::com::sun::star::uno::RuntimeException); + + +}; + +#endif // _TOOLKIT_AWT_VCLXTOOLKIT_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxtopwindow.hxx b/include/toolkit/awt/vclxtopwindow.hxx new file mode 100644 index 000000000000..95a742572b94 --- /dev/null +++ b/include/toolkit/awt/vclxtopwindow.hxx @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXTOPWINDOW_HXX_ +#define _TOOLKIT_AWT_VCLXTOPWINDOW_HXX_ + +#include <com/sun/star/awt/XSystemDependentWindowPeer.hpp> +#include <com/sun/star/awt/XTopWindow2.hpp> +#include <com/sun/star/awt/XMenuBar.hpp> +#include <cppuhelper/weak.hxx> +#include <osl/mutex.hxx> + +#include <cppuhelper/implbase1.hxx> + +#include <toolkit/awt/vclxcontainer.hxx> + +typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XTopWindow2 + > VCLXTopWindow_XBase; +typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XSystemDependentWindowPeer + > VCLXTopWindow_SBase; + +class TOOLKIT_DLLPUBLIC VCLXTopWindow_Base :public VCLXTopWindow_XBase + ,public VCLXTopWindow_SBase +{ +private: + const bool m_bWHWND; + +protected: + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar> mxMenuBar; + + bool isSystemDependentWindowPeer() const { return m_bWHWND; } + + virtual Window* GetWindowImpl() = 0; + virtual ::cppu::OInterfaceContainerHelper& GetTopWindowListenersImpl() = 0; + + VCLXTopWindow_Base( const bool _bSupportSystemWindowPeer ); + +public: + virtual ~VCLXTopWindow_Base(); + + // XInterface equivalents + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + // XTypeProvider equivalents + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XSystemDependentWindowPeer + ::com::sun::star::uno::Any SAL_CALL getWindowHandle( const ::com::sun::star::uno::Sequence< sal_Int8 >& ProcessId, sal_Int16 SystemType ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XTopWindow + void SAL_CALL addTopWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindowListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeTopWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindowListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL toFront() throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL toBack() throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMenuBar( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar >& xMenu ) throw(::com::sun::star::uno::RuntimeException); + + // XTopWindow2 + virtual ::sal_Bool SAL_CALL getIsMaximized() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setIsMaximized( ::sal_Bool _ismaximized ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL getIsMinimized() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setIsMinimized( ::sal_Bool _isminimized ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getDisplay() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDisplay( ::sal_Int32 _display ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException); +}; + +// ---------------------------------------------------- +// class VCLXTopWindow +// ---------------------------------------------------- + +class TOOLKIT_DLLPUBLIC VCLXTopWindow: public VCLXTopWindow_Base, + public VCLXContainer +{ +protected: + virtual Window* GetWindowImpl(); + virtual ::cppu::OInterfaceContainerHelper& GetTopWindowListenersImpl(); + +public: + VCLXTopWindow(bool bWHWND = false); + ~VCLXTopWindow(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + + + + +#endif // _TOOLKIT_AWT_VCLXTOPWINDOW_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxwindow.hxx b/include/toolkit/awt/vclxwindow.hxx new file mode 100644 index 000000000000..7e415f21a8fd --- /dev/null +++ b/include/toolkit/awt/vclxwindow.hxx @@ -0,0 +1,235 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXWINDOW_HXX_ +#define _TOOLKIT_AWT_VCLXWINDOW_HXX_ + +#include <toolkit/dllapi.h> +#include <toolkit/awt/vclxdevice.hxx> +#include <toolkit/helper/listenermultiplexer.hxx> + +#include <com/sun/star/awt/XWindow2.hpp> +#include <com/sun/star/awt/XVclWindowPeer.hpp> +#include <com/sun/star/awt/XLayoutConstrains.hpp> +#include <com/sun/star/awt/XView.hpp> +#include <com/sun/star/beans/XPropertyChangeListener.hpp> +#include <com/sun/star/beans/XPropertySetInfo.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> +#include <com/sun/star/accessibility/XAccessibleContext.hpp> +#include <com/sun/star/awt/XDockableWindow.hpp> +#include <com/sun/star/awt/XStyleSettingsSupplier.hpp> + +#include <cppuhelper/weak.hxx> +#include <cppuhelper/implbase9.hxx> +#include <osl/mutex.hxx> + +#include <tools/gen.hxx> // Size +#include <tools/link.hxx> + +#include <stdarg.h> +#include <list> +#include <boost/function.hpp> + +class Window; +class VclSimpleEvent; +class VclWindowEvent; +struct SystemParentData; + +namespace toolkit +{ + class IAccessibleFactory; +} + + +// ---------------------------------------------------- +// class VCLXWINDOW +// ---------------------------------------------------- + +class UnoPropertyArrayHelper; +class VCLXWindowImpl; +typedef ::cppu::ImplInheritanceHelper9 < VCLXDevice + , ::com::sun::star::awt::XWindow2 + , ::com::sun::star::awt::XVclWindowPeer + , ::com::sun::star::awt::XLayoutConstrains + , ::com::sun::star::awt::XView + , ::com::sun::star::awt::XDockableWindow + , ::com::sun::star::accessibility::XAccessible + , ::com::sun::star::lang::XEventListener + , ::com::sun::star::beans::XPropertySetInfo + , ::com::sun::star::awt::XStyleSettingsSupplier + > VCLXWindow_Base; + +class TOOLKIT_DLLPUBLIC VCLXWindow : public VCLXWindow_Base +{ +private: + VCLXWindowImpl* mpImpl; + + UnoPropertyArrayHelper *GetPropHelper(); + +protected: + Size ImplCalcWindowSize( const Size& rOutSz ) const; + DECL_LINK( WindowEventListener, VclSimpleEvent* ); + + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > + CreateAccessibleContext(); + + void SetSynthesizingVCLEvent( sal_Bool b ); + sal_Bool IsSynthesizingVCLEvent() const; + + void SetSystemParent_Impl( const com::sun::star::uno::Any& rHandle ); + + ::toolkit::IAccessibleFactory& getAccessibleFactory(); + + // helper ... + static void PushPropertyIds( std::list< sal_uInt16 > &aIds, int nFirstId, ...); + // for use in controls/ + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds, + bool bWithDefaults = false ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ); + + ::cppu::OInterfaceContainerHelper& GetContainerListeners(); + ::cppu::OInterfaceContainerHelper& GetTopWindowListeners(); + +public: + typedef ::boost::function0< void > Callback; + +protected: + /** executes the given callback asynchronously + + At the moment the callback is called, the Solar Mutex is not locked. In particular, this implies that + you cannot rely on |this| not being disposed. However, you *can* rely on |this| being still alive (i.e. + having a ref count > 0). + + As a consequence, this can be used for doing listener notifications, using event multiplexers. Those multiplexers + care for the disposed state themself, and are alive as long as |this| is alive. + */ + void ImplExecuteAsyncWithoutSolarLock( + const Callback& i_callback + ); + +public: + VCLXWindow( bool bWithDefaultProps = false ); + ~VCLXWindow(); + + virtual void SetWindow( Window* pWindow ); + Window* GetWindow() const { return (Window*)GetOutputDevice(); } + + void suspendVclEventListening( ); + void resumeVclEventListening( ); + + void notifyWindowRemoved( Window& _rWindow ); + + // ::com::sun::star::lang::XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw(); + static VCLXWindow* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw(); + sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XWindow + void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Rectangle SAL_CALL getPosSize( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setVisible( sal_Bool Visible ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setEnable( sal_Bool Enable ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setFocus( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addPaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removePaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& rrxListener ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XWindowPeer + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > SAL_CALL getToolkit( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setPointer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPointer >& Pointer ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setBackground( sal_Int32 Color ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL invalidate( sal_Int16 Flags ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL invalidateRect( const ::com::sun::star::awt::Rectangle& Rect, sal_Int16 Flags ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XVclWindowPeer + sal_Bool SAL_CALL isChild( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Peer ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setDesignMode( sal_Bool bOn ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isDesignMode( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL enableClipSiblings( sal_Bool bClip ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setForeground( sal_Int32 Color ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setControlFont( const ::com::sun::star::awt::FontDescriptor& aFont ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL getStyles( sal_Int16 nType, ::com::sun::star::awt::FontDescriptor& Font, sal_Int32& ForegroundColor, sal_Int32& BackgroundColor ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XView + sal_Bool SAL_CALL setGraphics( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& aDevice ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > SAL_CALL getGraphics( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getSize( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setZoom( float fZoomX, float fZoomY ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::accessibility::XAccessible + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XDockableWindow + void SAL_CALL addDockableWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDockableWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL removeDockableWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDockableWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL enableDocking( sal_Bool bEnable ) throw (::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isFloating( ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL setFloatingMode( sal_Bool bFloating ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL lock( ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL unlock( ) throw (::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isLocked( ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL startPopupMode( const ::com::sun::star::awt::Rectangle& WindowRect ) throw (::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isInPopupMode( ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XWindow2 + void SAL_CALL setOutputSize( const ::com::sun::star::awt::Size& aSize ) throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getOutputSize( ) throw (::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isVisible( ) throw (::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isActive( ) throw (::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isEnabled( ) throw (::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL hasFocus( ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XPropertySetInfo + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getProperties( ) throw (::com::sun::star::uno::RuntimeException); + ::com::sun::star::beans::Property SAL_CALL getPropertyByName( const OUString& aName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + ::sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) throw (::com::sun::star::uno::RuntimeException); + + // XStyleSettingsSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleSettings > SAL_CALL getStyleSettings() throw (::com::sun::star::uno::RuntimeException); +}; + +#endif // _TOOLKIT_AWT_VCLXWINDOW_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/vclxwindows.hxx b/include/toolkit/awt/vclxwindows.hxx new file mode 100644 index 000000000000..f822b0cc0e33 --- /dev/null +++ b/include/toolkit/awt/vclxwindows.hxx @@ -0,0 +1,1242 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _TOOLKIT_AWT_VCLXWINDOWS_HXX_ +#define _TOOLKIT_AWT_VCLXWINDOWS_HXX_ + +#include <toolkit/dllapi.h> + +#include <com/sun/star/beans/PropertyValues.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/beans/PropertyState.hpp> +#include <com/sun/star/beans/XPropertySetInfo.hpp> +#include <com/sun/star/beans/XMultiPropertySet.hpp> +#include <com/sun/star/beans/XFastPropertySet.hpp> +#include <com/sun/star/beans/XVetoableChangeListener.hpp> +#include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/beans/PropertyAttribute.hpp> +#include <com/sun/star/beans/XPropertiesChangeListener.hpp> +#include <com/sun/star/beans/XPropertyChangeListener.hpp> +#include <com/sun/star/beans/XPropertyAccess.hpp> +#include <com/sun/star/beans/XPropertyContainer.hpp> +#include <com/sun/star/beans/PropertyStateChangeEvent.hpp> +#include <com/sun/star/beans/PropertyChangeEvent.hpp> +#include <com/sun/star/awt/XFileDialog.hpp> +#include <com/sun/star/awt/XTextComponent.hpp> +#include <com/sun/star/awt/XListBox.hpp> +#include <com/sun/star/awt/XProgressMonitor.hpp> +#include <com/sun/star/awt/TextAlign.hpp> +#include <com/sun/star/awt/XScrollBar.hpp> +#include <com/sun/star/awt/XVclContainerPeer.hpp> +#include <com/sun/star/awt/XTabControllerModel.hpp> +#include <com/sun/star/awt/XMessageBox.hpp> +#include <com/sun/star/awt/XTextEditField.hpp> +#include <com/sun/star/awt/Style.hpp> +#include <com/sun/star/awt/XTimeField.hpp> +#include <com/sun/star/awt/XVclWindowPeer.hpp> +#include <com/sun/star/awt/XControlModel.hpp> +#include <com/sun/star/awt/XSpinField.hpp> +#include <com/sun/star/awt/XUnoControlContainer.hpp> +#include <com/sun/star/awt/XTextLayoutConstrains.hpp> +#include <com/sun/star/awt/XNumericField.hpp> +#include <com/sun/star/awt/XMetricField.hpp> +#include <com/sun/star/awt/XButton.hpp> +#include <com/sun/star/awt/XToggleButton.hpp> +#include <com/sun/star/awt/XPointer.hpp> +#include <com/sun/star/awt/XTextArea.hpp> +#include <com/sun/star/awt/XImageButton.hpp> +#include <com/sun/star/awt/XFixedHyperlink.hpp> +#include <com/sun/star/awt/XFixedText.hpp> +#include <com/sun/star/awt/XControlContainer.hpp> +#include <com/sun/star/awt/XDialog2.hpp> +#include <com/sun/star/awt/XRadioButton.hpp> +#include <com/sun/star/awt/XCurrencyField.hpp> +#include <com/sun/star/awt/XPatternField.hpp> +#include <com/sun/star/awt/XDateField.hpp> +#include <com/sun/star/awt/XComboBox.hpp> +#include <com/sun/star/awt/XCheckBox.hpp> +#include <com/sun/star/awt/XItemListListener.hpp> +#include <com/sun/star/awt/XImageConsumer.hpp> +#include <com/sun/star/awt/XSimpleTabController.hpp> +#include <cppuhelper/weak.hxx> +#include <cppuhelper/implbase3.hxx> +#include <cppuhelper/implbase2.hxx> + +#include "toolkit/awt/vclxwindow.hxx" +#include "toolkit/awt/vclxtopwindow.hxx" +#include <cppuhelper/implbase1.hxx> + +#include <vcl/pointr.hxx> +#include <vcl/image.hxx> +#include <vcl/tabctrl.hxx> + +class Button; +class CheckBox; +class RadioButton; +class ListBox; +class ScrollBar; +class Edit; +class Menu; +class ComboBox; +class FormatterBase; +class SpinField; +class ToolBox; +class VclSimpleEvent; +class VclMenuEvent; + +// ---------------------------------------------------- +// class VCLXGraphicControl +// deriving from VCLXWindow, drawing the graphic which exists as "Graphic" at the model +// ---------------------------------------------------- + + +class TOOLKIT_DLLPUBLIC VCLXGraphicControl : public VCLXWindow +{ +private: + /// the image we currently display + Image maImage; + +protected: + const Image& GetImage() const { return maImage; } + +protected: + // ::com::sun::star::awt::XWindow + void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + +protected: + /** forward our bitmap to our window + @precond + our mutex is locked + @precond + GetWindow is not <NULL/> + @see GetBitmap + */ + virtual void ImplSetNewImage(); + +public: + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } + +}; + +// ---------------------------------------------------- +// class VCLXButton +// ---------------------------------------------------- +typedef ::cppu::ImplInheritanceHelper2 < VCLXGraphicControl + , ::com::sun::star::awt::XButton + , ::com::sun::star::awt::XToggleButton + > VCLXButton_Base; +class VCLXButton :public VCLXButton_Base +{ +private: + OUString maActionCommand; + ActionListenerMultiplexer maActionListeners; + ItemListenerMultiplexer maItemListeners; + +protected: + void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext(); + +public: + VCLXButton(); + ~VCLXButton(); + + // ::com::sun::star::lang::XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XButton + void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLabel( const OUString& Label ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setActionCommand( const OUString& Command ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XToggleButton + // ::com::sun::star::awt::XItemEventBroadcaster + void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXImageControl +// ---------------------------------------------------- +class VCLXImageControl : public VCLXGraphicControl +{ +public: + VCLXImageControl(); + ~VCLXImageControl(); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } + +protected: + virtual void ImplSetNewImage(); +}; + +// ---------------------------------------------------- +// class VCLXCheckBox +// ---------------------------------------------------- +class VCLXCheckBox : public ::com::sun::star::awt::XCheckBox, + public ::com::sun::star::awt::XButton, + public VCLXGraphicControl +{ +private: + ActionListenerMultiplexer maActionListeners; + OUString maActionCommand; + ItemListenerMultiplexer maItemListeners; + +protected: + void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext(); + +public: + VCLXCheckBox(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + + // ::com::sun::star::lang::XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XCheckBox + void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getState( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setState( sal_Int16 n ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLabel( const OUString& Label ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL enableTriState( sal_Bool b ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XButton: + void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setActionCommand( const OUString& Command ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXRadioButton +// ---------------------------------------------------- +class VCLXRadioButton : public ::com::sun::star::awt::XRadioButton, + public ::com::sun::star::awt::XButton, + public VCLXGraphicControl +{ +private: + ItemListenerMultiplexer maItemListeners; + ActionListenerMultiplexer maActionListeners; + OUString maActionCommand; + +protected: + void ImplClickedOrToggled( sal_Bool bToggled ); + void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext(); + +public: + VCLXRadioButton(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XRadioButton + void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL getState( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setState( sal_Bool b ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLabel( const OUString& Label ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XButton: + void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setActionCommand( const OUString& Command ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } + +}; + +// ---------------------------------------------------- +// class VCLXMessageBox +// ---------------------------------------------------- +class VCLXMessageBox : public ::com::sun::star::awt::XMessageBox, + public VCLXTopWindow +{ +public: + VCLXMessageBox(); + ~VCLXMessageBox(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + + // ::com::sun::star::awt::XMessageBox + void SAL_CALL setCaptionText( const OUString& aText ) throw(::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getCaptionText( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMessageText( const OUString& aText ) throw(::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getMessageText( ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL execute( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize() throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXFrame +// ---------------------------------------------------- +class VCLXFrame : public VCLXContainer +{ +protected: + void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + +public: + VCLXFrame(); + ~VCLXFrame(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XView + void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XDevice, + ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XVclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + + + +// ---------------------------------------------------- +// class VCLXDialog +// ---------------------------------------------------- +class TOOLKIT_DLLPUBLIC VCLXDialog : public ::com::sun::star::awt::XDialog2, + public VCLXTopWindow +{ +public: + VCLXDialog(); + ~VCLXDialog(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XDialog2 + virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setHelpId( const OUString& Id ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XDialog + void SAL_CALL setTitle( const OUString& Title ) throw(::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getTitle( ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL execute( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL endExecute( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XView + void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XDevice, + ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } + + // ::com::sun::star::awt::XVclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + +}; + +// ---------------------------------------------------- +// class VCLXTabPage +// ---------------------------------------------------- +class VCLXTabPage : public VCLXContainer +{ +public: + VCLXTabPage(); + ~VCLXTabPage(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XView + void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XDevice, + ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XVclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + + TabPage* getTabPage() const throw ( ::com::sun::star::uno::RuntimeException); + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +class VCLXMultiPage : public ::com::sun::star::awt::XSimpleTabController, public VCLXContainer +{ + TabListenerMultiplexer maTabListeners; + sal_Int32 mTabId; +protected: + void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); +public: + VCLXMultiPage(); + ~VCLXMultiPage(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XView + void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XDevice, + ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XVclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + // XSimpleTabController + virtual ::sal_Int32 SAL_CALL insertTab() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeTab( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setTabProps( ::sal_Int32 ID, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Properties ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > SAL_CALL getTabProps( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL activateTab( ::sal_Int32 ID ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getActiveTabID() throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL addTabListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeTabListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); + // C++ + TabControl* getTabControl() const throw ( ::com::sun::star::uno::RuntimeException); + sal_uInt16 insertTab( TabPage*, OUString& sTitle ); + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXFixedHyperlink +// ---------------------------------------------------- +class TOOLKIT_DLLPUBLIC VCLXFixedHyperlink : + public ::com::sun::star::awt::XFixedHyperlink, + public VCLXWindow +{ +private: + ActionListenerMultiplexer maActionListeners; + +protected: + void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > + CreateAccessibleContext(); + +public: + VCLXFixedHyperlink(); + ~VCLXFixedHyperlink(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XFixedHyperlink + void SAL_CALL setText( const OUString& Text ) throw(::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setURL( const OUString& URL ) throw(::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getURL( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setAlignment( sal_Int16 nAlign ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getAlignment( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXFixedText +// ---------------------------------------------------- +class VCLXFixedText : public ::com::sun::star::awt::XFixedText, + public VCLXWindow +{ +protected: + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext(); + +public: + VCLXFixedText(); + ~VCLXFixedText(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XFixedText + void SAL_CALL setText( const OUString& Text ) throw(::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setAlignment( sal_Int16 nAlign ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getAlignment( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXScrollBar +// ---------------------------------------------------- +class VCLXScrollBar : public ::com::sun::star::awt::XScrollBar, + public VCLXWindow +{ +private: + AdjustmentListenerMultiplexer maAdjustmentListeners; + +protected: + void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext(); + +public: + VCLXScrollBar(); + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + + // ::com::sun::star::lang::XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XScrollbar + void SAL_CALL addAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setValue( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setValues( sal_Int32 nValue, sal_Int32 nVisible, sal_Int32 nMax ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMaximum( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getMaximum( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLineIncrement( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getLineIncrement( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setBlockIncrement( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getBlockIncrement( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setVisibleSize( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getVisibleSize( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setOrientation( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getOrientation( ) throw(::com::sun::star::uno::RuntimeException); + + // why isn't this part of the XScrollbar? + void SAL_CALL setMinimum( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getMinimum( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize() throw(::com::sun::star::uno::RuntimeException); + static ::com::sun::star::awt::Size SAL_CALL implGetMinimumSize( Window* p ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXEdit +// ---------------------------------------------------- +class TOOLKIT_DLLPUBLIC VCLXEdit : public ::com::sun::star::awt::XTextComponent, + public ::com::sun::star::awt::XTextEditField, + public ::com::sun::star::awt::XTextLayoutConstrains, + public VCLXWindow +{ +private: + TextListenerMultiplexer maTextListeners; + +protected: + void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext(); + + +public: + VCLXEdit(); + + TextListenerMultiplexer& GetTextListeners() { return maTextListeners; } + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + + // ::com::sun::star::lang::XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XTextComponent + void SAL_CALL addTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setText( const OUString& aText ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL insertText( const ::com::sun::star::awt::Selection& Sel, const OUString& Text ) throw(::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getSelectedText( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setSelection( const ::com::sun::star::awt::Selection& aSelection ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Selection SAL_CALL getSelection( ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isEditable( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setEditable( sal_Bool bEditable ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMaxTextLen( sal_Int16 nLen ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getMaxTextLen( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XTextEditField: + void SAL_CALL setEchoChar( sal_Unicode cEcho ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XTextLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXListBox +// ---------------------------------------------------- +typedef ::cppu::ImplInheritanceHelper3 < VCLXWindow + , ::com::sun::star::awt::XListBox + , ::com::sun::star::awt::XTextLayoutConstrains + , ::com::sun::star::awt::XItemListListener + > VCLXListBox_Base; +class VCLXListBox : public VCLXListBox_Base +{ +private: + ActionListenerMultiplexer maActionListeners; + ItemListenerMultiplexer maItemListeners; + +protected: + virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > + CreateAccessibleContext(); + void ImplCallItemListeners(); + +public: + VCLXListBox(); + + // ::com::sun::star::lang::XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XListBox + void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addItem( const OUString& aItem, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addItems( const ::com::sun::star::uno::Sequence< OUString >& aItems, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeItems( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getItemCount( ) throw(::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getItem( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< OUString > SAL_CALL getItems( ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getSelectedItemPos( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSelectedItemsPos( ) throw(::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getSelectedItem( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSelectedItems( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL selectItemPos( sal_Int16 nPos, sal_Bool bSelect ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL selectItemsPos( const ::com::sun::star::uno::Sequence< sal_Int16 >& aPositions, sal_Bool bSelect ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL selectItem( const OUString& aItem, sal_Bool bSelect ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isMutipleMode( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMultipleMode( sal_Bool bMulti ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getDropDownLineCount( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL makeVisible( sal_Int16 nEntry ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XTextLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + // XItemListListener + virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + + // XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_rEvent ) throw (::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXComboBox +// ---------------------------------------------------- +typedef ::cppu::ImplInheritanceHelper2 < VCLXEdit + , ::com::sun::star::awt::XComboBox + , ::com::sun::star::awt::XItemListListener > VCLXComboBox_Base; +class VCLXComboBox : public VCLXComboBox_Base +{ +private: + ActionListenerMultiplexer maActionListeners; + ItemListenerMultiplexer maItemListeners; + +protected: + void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext(); + + +public: + VCLXComboBox(); + ~VCLXComboBox(); + + // ::com::sun::star::lang::XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XComboBox + void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addItem( const OUString& aItem, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addItems( const ::com::sun::star::uno::Sequence< OUString >& aItems, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeItems( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getItemCount( ) throw(::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getItem( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< OUString > SAL_CALL getItems( ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getDropDownLineCount( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XTextLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + // XItemListListener + virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + // XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& i_rEvent ) throw (::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXSpinField +// ---------------------------------------------------- +class TOOLKIT_DLLPUBLIC VCLXSpinField : public ::com::sun::star::awt::XSpinField, + public VCLXEdit +{ +private: + SpinListenerMultiplexer maSpinListeners; + +protected: + void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ); + +public: + VCLXSpinField(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + + // ::com::sun::star::awt::XSpinField + void SAL_CALL addSpinListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XSpinListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeSpinListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XSpinListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL up( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL down( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL first( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL last( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL enableRepeat( sal_Bool bRepeat ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXFormattedSpinField +// ---------------------------------------------------- +class VCLXFormattedSpinField : public VCLXSpinField +{ +private: + FormatterBase* mpFormatter; + +protected: + FormatterBase* GetFormatter() const { return GetWindow() ? mpFormatter : NULL; } + +public: + VCLXFormattedSpinField(); + ~VCLXFormattedSpinField(); + + void SetFormatter( FormatterBase* pFormatter ) { mpFormatter = pFormatter; } + + void setStrictFormat( sal_Bool bStrict ); + sal_Bool isStrictFormat(); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXDateField +// ---------------------------------------------------- +class TOOLKIT_DLLPUBLIC VCLXDateField : public ::com::sun::star::awt::XDateField, + public VCLXFormattedSpinField +{ +public: + VCLXDateField(); + ~VCLXDateField(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + + // ::com::sun::star::awt::XDateField + void SAL_CALL setDate( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getDate( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMin( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMax( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setFirst( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLast( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLongFormat( sal_Bool bLong ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isLongFormat( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setEmpty( ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isEmpty( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXTimeField +// ---------------------------------------------------- +class VCLXTimeField : public ::com::sun::star::awt::XTimeField, + public VCLXFormattedSpinField +{ +public: + VCLXTimeField(); + ~VCLXTimeField(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XTimeField + void SAL_CALL setTime( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getTime( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMin( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMax( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setFirst( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLast( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setEmpty( ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isEmpty( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXNumericField +// ---------------------------------------------------- +class VCLXNumericField : public ::com::sun::star::awt::XNumericField, + public VCLXFormattedSpinField +{ +public: + VCLXNumericField(); + ~VCLXNumericField(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XNumericField + void SAL_CALL setValue( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMin( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMax( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setFirst( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLast( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setSpinSize( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getSpinSize( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getDecimalDigits( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXMetricField +// ---------------------------------------------------- +class MetricFormatter; +class MetricField; +class VCLXMetricField : public ::com::sun::star::awt::XMetricField, + public VCLXFormattedSpinField +{ + MetricFormatter *GetMetricFormatter() throw(::com::sun::star::uno::RuntimeException); + MetricField *GetMetricField() throw(::com::sun::star::uno::RuntimeException); + void CallListeners(); +public: + VCLXMetricField(); + ~VCLXMetricField(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XMetricField + virtual void SAL_CALL setValue( ::sal_Int64 Value, ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setUserValue( ::sal_Int64 Value, ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int64 SAL_CALL getValue( ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int64 SAL_CALL getCorrectedValue( ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMin( ::sal_Int64 Value, ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int64 SAL_CALL getMin( ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMax( ::sal_Int64 Value, ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int64 SAL_CALL getMax( ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setFirst( ::sal_Int64 Value, ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int64 SAL_CALL getFirst( ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setLast( ::sal_Int64 Value, ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int64 SAL_CALL getLast( ::sal_Int16 Unit ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setSpinSize( ::sal_Int64 Value ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int64 SAL_CALL getSpinSize( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setDecimalDigits( ::sal_Int16 nDigits ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int16 SAL_CALL getDecimalDigits( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setStrictFormat( ::sal_Bool bStrict ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isStrictFormat( ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXCurrencyField +// ---------------------------------------------------- +class VCLXCurrencyField : public ::com::sun::star::awt::XCurrencyField, + public VCLXFormattedSpinField +{ +public: + VCLXCurrencyField(); + ~VCLXCurrencyField(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + + // ::com::sun::star::awt::XCurrencyField + void SAL_CALL setValue( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMin( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMax( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setFirst( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLast( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setSpinSize( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getSpinSize( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getDecimalDigits( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXPatternField +// ---------------------------------------------------- +class VCLXPatternField : public ::com::sun::star::awt::XPatternField, + public VCLXFormattedSpinField +{ +public: + VCLXPatternField(); + ~VCLXPatternField(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + void SAL_CALL release() throw() { OWeakObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + + // ::com::sun::star::awt::XPatternField + void SAL_CALL setMasks( const OUString& EditMask, const OUString& LiteralMask ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL getMasks( OUString& EditMask, OUString& LiteralMask ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setString( const OUString& Str ) throw(::com::sun::star::uno::RuntimeException); + OUString SAL_CALL getString( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::VclWindowPeer + void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds ); + virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); } +}; + +// ---------------------------------------------------- +// class VCLXToolBox +// ---------------------------------------------------- +class VCLXToolBox : public VCLXWindow +{ +private: + +protected: + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > + CreateAccessibleContext(); + +public: + VCLXToolBox(); + ~VCLXToolBox(); +}; + +#endif // _TOOLKIT_AWT_VCLXWINDOWS_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/xsimpleanimation.hxx b/include/toolkit/awt/xsimpleanimation.hxx new file mode 100644 index 000000000000..3ab8499d63fc --- /dev/null +++ b/include/toolkit/awt/xsimpleanimation.hxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef TOOLKIT_AWT_XSIMPLEANIMATION_HXX +#define TOOLKIT_AWT_XSIMPLEANIMATION_HXX + +#include <toolkit/awt/vclxwindow.hxx> +#include <toolkit/helper/listenermultiplexer.hxx> +#include <cppuhelper/implbase1.hxx> +#include <comphelper/uno3.hxx> +#include <com/sun/star/awt/XSimpleAnimation.hpp> + +#include <boost/scoped_ptr.hpp> + +//........................................................................ +namespace toolkit +{ +//........................................................................ + + //==================================================================== + //= XSimpleAnimation + //==================================================================== + typedef ::cppu::ImplInheritanceHelper1 < VCLXWindow + , ::com::sun::star::awt::XSimpleAnimation + > XSimpleAnimation_Base; + + class XSimpleAnimation : public XSimpleAnimation_Base + { + public: + XSimpleAnimation(); + + protected: + ~XSimpleAnimation(); + + // XSimpleAnimation + virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setImageList( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > >& ImageList ) + throw (::com::sun::star::uno::RuntimeException); + // VclWindowPeer + virtual void SAL_CALL setProperty( const OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException); + + private: + XSimpleAnimation( const XSimpleAnimation& ); // never implemented + XSimpleAnimation& operator=( const XSimpleAnimation& ); // never implemented + }; + +//........................................................................ +} // namespacetoolkit +//........................................................................ + +#endif // TOOLKIT_INC_TOOLKIT_AWT_XSIMPLEANIMATION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/toolkit/awt/xthrobber.hxx b/include/toolkit/awt/xthrobber.hxx new file mode 100644 index 000000000000..2c8ad5d0817e --- /dev/null +++ b/include/toolkit/awt/xthrobber.hxx @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef TOOLKIT_AWT_XTHROBBER_HXX +#define TOOLKIT_AWT_XTHROBBER_HXX + +#include <toolkit/awt/vclxwindow.hxx> +#include <toolkit/helper/listenermultiplexer.hxx> +#include <cppuhelper/implbase1.hxx> +#include <comphelper/uno3.hxx> +#include <com/sun/star/awt/XThrobber.hpp> + +#include <boost/scoped_ptr.hpp> +#include <boost/noncopyable.hpp> + +//........................................................................ +namespace toolkit +{ +//........................................................................ + + //==================================================================== + //= XThrobber + //==================================================================== + typedef ::cppu::ImplInheritanceHelper1 < VCLXWindow + , ::com::sun::star::awt::XThrobber + > XThrobber_Base; + + class XThrobber :public XThrobber_Base + ,public ::boost::noncopyable + { + private: + void SAL_CALL InitImageList() throw(::com::sun::star::uno::RuntimeException); + + public: + XThrobber(); + + protected: + ~XThrobber(); + + // XThrobber + virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException); + + // VCLXWindow + virtual void SetWindow( Window* pWindow ); + + private: + XThrobber( const XThrobber& ); // never implemented + XThrobber& operator=( const XThrobber& ); // never implemented + }; + +//........................................................................ +} // namespacetoolkit +//........................................................................ + +#endif // TOOLKIT_AWT_XTHROBBER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |