Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_TOOLKIT_AWT_VCLXREGION_HXX
21 : #define INCLUDED_TOOLKIT_AWT_VCLXREGION_HXX
22 :
23 :
24 : #include <com/sun/star/awt/XRegion.hpp>
25 : #include <com/sun/star/lang/XTypeProvider.hpp>
26 : #include <com/sun/star/lang/XUnoTunnel.hpp>
27 : #include <cppuhelper/weak.hxx>
28 : #include <osl/mutex.hxx>
29 :
30 : #include <vcl/region.hxx>
31 :
32 :
33 : // class VCLXRegion
34 :
35 :
36 : class VCLXRegion : public ::com::sun::star::awt::XRegion,
37 : public ::com::sun::star::lang::XTypeProvider,
38 : public ::com::sun::star::lang::XUnoTunnel,
39 : public ::cppu::OWeakObject
40 : {
41 : private:
42 : ::osl::Mutex maMutex;
43 : vcl::Region maRegion;
44 :
45 : protected:
46 0 : ::osl::Mutex& GetMutex() { return maMutex; }
47 :
48 : public:
49 : VCLXRegion();
50 : virtual ~VCLXRegion();
51 :
52 : void SetRegion( const vcl::Region& rRegion ) { maRegion = rRegion; }
53 0 : const vcl::Region& GetRegion() const { return maRegion; }
54 :
55 : // ::com::sun::star::uno::XInterface
56 : ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
57 8 : void SAL_CALL acquire() throw() SAL_OVERRIDE { OWeakObject::acquire(); }
58 8 : void SAL_CALL release() throw() SAL_OVERRIDE { OWeakObject::release(); }
59 :
60 : // ::com::sun::star::lang::XUnoTunnel
61 : static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw();
62 : static VCLXRegion* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace );
63 : sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
64 :
65 : // ::com::sun::star::lang::XTypeProvider
66 : ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
67 : ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
68 :
69 : // ::com::sun::star::awt::XRegion
70 : ::com::sun::star::awt::Rectangle SAL_CALL getBounds() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
71 : void SAL_CALL clear() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
72 : void SAL_CALL move( sal_Int32 nHorzMove, sal_Int32 nVertMove ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
73 : void SAL_CALL unionRectangle( const ::com::sun::star::awt::Rectangle& rRect ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
74 : void SAL_CALL intersectRectangle( const ::com::sun::star::awt::Rectangle& rRect ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
75 : void SAL_CALL excludeRectangle( const ::com::sun::star::awt::Rectangle& rRect ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
76 : void SAL_CALL xOrRectangle( const ::com::sun::star::awt::Rectangle& rRect ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
77 : void SAL_CALL unionRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
78 : void SAL_CALL intersectRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
79 : void SAL_CALL excludeRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
80 : void SAL_CALL xOrRegion( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRegion >& rxRegion ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
81 : ::com::sun::star::uno::Sequence< ::com::sun::star::awt::Rectangle > SAL_CALL getRectangles() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
82 :
83 : };
84 :
85 :
86 :
87 : #endif // INCLUDED_TOOLKIT_AWT_VCLXREGION_HXX
88 :
89 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|