diff options
Diffstat (limited to 'include/toolkit')
-rw-r--r-- | include/toolkit/awt/scrollabledialog.hxx | 5 | ||||
-rw-r--r-- | include/toolkit/awt/vclxaccessiblecomponent.hxx | 7 | ||||
-rw-r--r-- | include/toolkit/awt/vclxdevice.hxx | 19 | ||||
-rw-r--r-- | include/toolkit/awt/vclxgraphics.hxx | 3 | ||||
-rw-r--r-- | include/toolkit/awt/vclxprinter.hxx | 4 | ||||
-rw-r--r-- | include/toolkit/awt/vclxwindow.hxx | 8 | ||||
-rw-r--r-- | include/toolkit/controls/accessiblecontrolcontext.hxx | 3 | ||||
-rw-r--r-- | include/toolkit/helper/vclunohelper.hxx | 9 |
8 files changed, 34 insertions, 24 deletions
diff --git a/include/toolkit/awt/scrollabledialog.hxx b/include/toolkit/awt/scrollabledialog.hxx index e75fac70b0ed..70e2b32be919 100644 --- a/include/toolkit/awt/scrollabledialog.hxx +++ b/include/toolkit/awt/scrollabledialog.hxx @@ -43,8 +43,8 @@ namespace toolkit template < class T > class ScrollableWrapper : public T, public ScrollableInterface { - ScrollBar maHScrollBar; - ScrollBar maVScrollBar; + VclPtr<ScrollBar> maHScrollBar; + VclPtr<ScrollBar> maVScrollBar; Size maScrollArea; bool mbHasHoriBar; bool mbHasVertBar; @@ -59,6 +59,7 @@ namespace toolkit public: ScrollableWrapper( vcl::Window* pParent, WinBits nStyle = WB_STDDIALOG ); virtual ~ScrollableWrapper(); + virtual void dispose() SAL_OVERRIDE; virtual void SetScrollWidth( long nWidth ) SAL_OVERRIDE; virtual long GetScrollWidth() SAL_OVERRIDE { return maScrollArea.Width(); } virtual void SetScrollHeight( long nHeight ) SAL_OVERRIDE; diff --git a/include/toolkit/awt/vclxaccessiblecomponent.hxx b/include/toolkit/awt/vclxaccessiblecomponent.hxx index 62d167ba10f1..0fdc2a8f083f 100644 --- a/include/toolkit/awt/vclxaccessiblecomponent.hxx +++ b/include/toolkit/awt/vclxaccessiblecomponent.hxx @@ -33,6 +33,7 @@ #include <comphelper/accessiblecomponenthelper.hxx> #include <tools/link.hxx> +#include <vcl/vclptr.hxx> namespace vcl { class Window; } class VCLXWindow; @@ -83,7 +84,11 @@ public: virtual ~VCLXAccessibleComponent(); VCLXWindow* GetVCLXWindow() const { return mpVCLXindow; } - vcl::Window* GetWindow() const; + VclPtr<vcl::Window> GetWindow() const; + template< class derived_type > VclPtr< derived_type > GetAs() const { + return VclPtr< derived_type >( static_cast< derived_type * >( GetWindow().get() ) ); } + template< class derived_type > VclPtr< derived_type > GetAsDynamic() const { + return VclPtr< derived_type >( dynamic_cast< derived_type * >( GetWindow().get() ) ); } virtual void SAL_CALL disposing() SAL_OVERRIDE; diff --git a/include/toolkit/awt/vclxdevice.hxx b/include/toolkit/awt/vclxdevice.hxx index 61d568911b38..47a99ea1995e 100644 --- a/include/toolkit/awt/vclxdevice.hxx +++ b/include/toolkit/awt/vclxdevice.hxx @@ -27,43 +27,40 @@ #include <cppuhelper/weak.hxx> #include <osl/mutex.hxx> #include <vcl/virdev.hxx> +#include <vcl/vclptr.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, +/// An UNO wrapper for the VCL OutputDevice +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; + friend class VCLXVirtualDevice; private: - OutputDevice* mpOutputDevice; + VclPtr<OutputDevice> mpOutputDevice; public: void* pDummy; sal_uInt32 nFlags; -protected: - void DestroyOutputDevice(); - public: VCLXDevice(); virtual ~VCLXDevice(); - void SetOutputDevice( OutputDevice* pOutDev ) { mpOutputDevice = pOutDev; } - OutputDevice* GetOutputDevice() const { return mpOutputDevice; } + void SetOutputDevice( const VclPtr<OutputDevice> &pOutDev ) { mpOutputDevice = pOutDev; } + VclPtr<OutputDevice> GetOutputDevice() const { return mpOutputDevice; } void SetCreatedWithToolkit( bool bCreatedWithToolkit ); diff --git a/include/toolkit/awt/vclxgraphics.hxx b/include/toolkit/awt/vclxgraphics.hxx index 627b6759f43b..89a568fe6fa9 100644 --- a/include/toolkit/awt/vclxgraphics.hxx +++ b/include/toolkit/awt/vclxgraphics.hxx @@ -31,6 +31,7 @@ #include <vcl/font.hxx> #include <tools/color.hxx> #include <vcl/vclenum.hxx> +#include <vcl/vclptr.hxx> class OutputDevice; namespace vcl { class Region; } @@ -55,7 +56,7 @@ private: // used to return same reference on each call to getDevice() ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice> mxDevice; - OutputDevice* mpOutputDevice; + VclPtr<OutputDevice> mpOutputDevice; vcl::Font maFont; Color maTextColor; Color maTextFillColor; diff --git a/include/toolkit/awt/vclxprinter.hxx b/include/toolkit/awt/vclxprinter.hxx index 892cc4cb0839..a63f7746911d 100644 --- a/include/toolkit/awt/vclxprinter.hxx +++ b/include/toolkit/awt/vclxprinter.hxx @@ -57,11 +57,11 @@ class VCLXPrinterPropertySet :public VCLXPrinterPropertySet_Base ,public ::cppu::OPropertySetHelper { protected: - std::shared_ptr<Printer> mxPrinter; + VclPtr<Printer> mxPrinter; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > mxPrnDevice; sal_Int16 mnOrientation; - bool mbHorizontal; + bool mbHorizontal; public: VCLXPrinterPropertySet( const OUString& rPrinterName ); virtual ~VCLXPrinterPropertySet(); diff --git a/include/toolkit/awt/vclxwindow.hxx b/include/toolkit/awt/vclxwindow.hxx index 6306ce6717e3..1ab1f9e8a8d2 100644 --- a/include/toolkit/awt/vclxwindow.hxx +++ b/include/toolkit/awt/vclxwindow.hxx @@ -128,8 +128,12 @@ public: VCLXWindow( bool bWithDefaultProps = false ); virtual ~VCLXWindow(); - virtual void SetWindow( vcl::Window* pWindow ); - vcl::Window* GetWindow() const { return static_cast<vcl::Window*>(GetOutputDevice()); } + virtual void SetWindow( const VclPtr< vcl::Window > &pWindow ); + template< class derived_type > VclPtr< derived_type > GetAs() const { + return VclPtr< derived_type >( static_cast< derived_type * >( GetOutputDevice().get() ) ); } + template< class derived_type > VclPtr< derived_type > GetAsDynamic() const { + return VclPtr< derived_type >( dynamic_cast< derived_type * >( GetOutputDevice().get() ) ); } + VclPtr<vcl::Window> GetWindow() const { return GetAs<vcl::Window>(); } void suspendVclEventListening( ); void resumeVclEventListening( ); diff --git a/include/toolkit/controls/accessiblecontrolcontext.hxx b/include/toolkit/controls/accessiblecontrolcontext.hxx index 78fdfe7cc4d8..b991b80793f3 100644 --- a/include/toolkit/controls/accessiblecontrolcontext.hxx +++ b/include/toolkit/controls/accessiblecontrolcontext.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/lang/XEventListener.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/awt/XWindow.hpp> +#include <vcl/vclptr.hxx> namespace vcl { class Window; } @@ -116,7 +117,7 @@ namespace toolkit // stops listening at the control model void stopModelListening( ); - vcl::Window* implGetWindow( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >* _pxUNOWindow = NULL ) const; + VclPtr< vcl::Window > implGetWindow( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >* _pxUNOWindow = NULL ) const; }; diff --git a/include/toolkit/helper/vclunohelper.hxx b/include/toolkit/helper/vclunohelper.hxx index dc1ae888476f..c902e5c9155c 100644 --- a/include/toolkit/helper/vclunohelper.hxx +++ b/include/toolkit/helper/vclunohelper.hxx @@ -56,11 +56,12 @@ namespace com { namespace sun { namespace star { namespace awt { #include <vcl/bitmapex.hxx> #include <vcl/region.hxx> #include <vcl/metric.hxx> +#include <vcl/vclptr.hxx> +#include <vcl/window.hxx> #include <tools/mapunit.hxx> #include <tools/fldunit.hxx> #include <tools/poly.hxx> -namespace vcl { class Window; } class OutputDevice; class MouseEvent; class KeyEvent; @@ -79,9 +80,9 @@ public: static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XBitmap> CreateBitmap( const BitmapEx& rBitmap ); // Window - static vcl::Window* GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& rxWindow ); - static vcl::Window* GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow2>& rxWindow2 ); - static vcl::Window* GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer>& rxWindowPeer ); + static VclPtr< vcl::Window > GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>& rxWindow ); + static VclPtr< vcl::Window > GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow2>& rxWindow2 ); + static VclPtr< vcl::Window > GetWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer>& rxWindowPeer ); static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> GetInterface( vcl::Window* pWindow ); // OutputDevice |