Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _TOOLKIT_AWT_VCLXDEVICE_HXX_
30 : : #define _TOOLKIT_AWT_VCLXDEVICE_HXX_
31 : :
32 : : #include <toolkit/dllapi.h>
33 : : #include <com/sun/star/awt/XDevice.hpp>
34 : : #include <com/sun/star/lang/XTypeProvider.hpp>
35 : : #include <com/sun/star/lang/XUnoTunnel.hpp>
36 : : #include <cppuhelper/weak.hxx>
37 : : #include <osl/mutex.hxx>
38 : :
39 : : #include <com/sun/star/awt/XUnitConversion.hpp>
40 : :
41 : : class OutputDevice;
42 : : class VirtualDevice;
43 : :
44 : : // ----------------------------------------------------
45 : : // class VCLXDevice
46 : : // ----------------------------------------------------
47 : :
48 : : // For using nDummy, no incompatible update, add a sal_Bool bCreatedWithToolkitMember later...
49 : : #define FLAGS_CREATEDWITHTOOLKIT 0x00000001
50 : :
51 : : class TOOLKIT_DLLPUBLIC VCLXDevice : public ::com::sun::star::awt::XDevice,
52 : : public ::com::sun::star::lang::XTypeProvider,
53 : : public ::com::sun::star::lang::XUnoTunnel,
54 : : public ::com::sun::star::awt::XUnitConversion,
55 : : public ::cppu::OWeakObject
56 : : {
57 : : friend class VCLXGraphics;
58 : :
59 : : private:
60 : : OutputDevice* mpOutputDevice;
61 : :
62 : : public:
63 : : void* pDummy;
64 : : sal_uInt32 nFlags;
65 : :
66 : : protected:
67 : : void DestroyOutputDevice();
68 : :
69 : : public:
70 : : VCLXDevice();
71 : : ~VCLXDevice();
72 : :
73 : 120346 : void SetOutputDevice( OutputDevice* pOutDev ) { mpOutputDevice = pOutDev; }
74 : 1652903 : OutputDevice* GetOutputDevice() const { return mpOutputDevice; }
75 : :
76 : : void SetCreatedWithToolkit( sal_Bool bCreatedWithToolkit );
77 : :
78 : : // ::com::sun::star::uno::XInterface
79 : : ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
80 : 3428801 : void SAL_CALL acquire() throw() { OWeakObject::acquire(); }
81 : 3424289 : void SAL_CALL release() throw() { OWeakObject::release(); }
82 : :
83 : : // ::com::sun::star::lang::XUnoTunnel
84 : : static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
85 : : static VCLXDevice* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw();
86 : : sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
87 : :
88 : : // ::com::sun::star::lang::XTypeProvider
89 : : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
90 : : ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
91 : :
92 : : // ::com::sun::star::awt::XDevice,
93 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > SAL_CALL createGraphics( ) throw(::com::sun::star::uno::RuntimeException);
94 : : ::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);
95 : : ::com::sun::star::awt::DeviceInfo SAL_CALL getInfo() throw(::com::sun::star::uno::RuntimeException);
96 : : ::com::sun::star::uno::Sequence< ::com::sun::star::awt::FontDescriptor > SAL_CALL getFontDescriptors( ) throw(::com::sun::star::uno::RuntimeException);
97 : : ::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);
98 : : ::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);
99 : : ::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);
100 : :
101 : : // ::com::sun::star::awt::XUnitConversion
102 : : ::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);
103 : : ::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);
104 : : ::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);
105 : : ::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);
106 : :
107 : :
108 : : };
109 : :
110 : : // ----------------------------------------------------
111 : : // class VCLXVirtualDevice
112 : : // ----------------------------------------------------
113 : :
114 : 66 : class VCLXVirtualDevice : public VCLXDevice
115 : : {
116 : : public:
117 : : ~VCLXVirtualDevice();
118 : :
119 : 66 : void SetVirtualDevice( VirtualDevice* pVDev ) { SetOutputDevice( (OutputDevice*)pVDev ); }
120 : : };
121 : :
122 : :
123 : :
124 : :
125 : : #endif // _TOOLKIT_AWT_VCLXDEVICE_HXX_
126 : :
127 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|