xref: /AOO41X/main/toolkit/inc/toolkit/awt/vclxbitmap.hxx (revision 50e6b0721ed882c1c74690abd9bee6b3a8da8cfd)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _TOOLKIT_AWT_VCLXBITMAP_HXX_
25 #define _TOOLKIT_AWT_VCLXBITMAP_HXX_
26 
27 #include <com/sun/star/awt/XBitmap.hpp>
28 #include <com/sun/star/awt/XDisplayBitmap.hpp>
29 #include <com/sun/star/lang/XTypeProvider.hpp>
30 #include <com/sun/star/lang/XUnoTunnel.hpp>
31 #include <cppuhelper/weak.hxx>
32 #include <osl/mutex.hxx>
33 #include <vcl/bitmapex.hxx>
34 
35 
36 //  ----------------------------------------------------
37 //  class VCLXBitmap
38 //  ----------------------------------------------------
39 
40 class VCLXBitmap :  public ::com::sun::star::awt::XBitmap,
41                     public ::com::sun::star::awt::XDisplayBitmap,
42                     public ::com::sun::star::lang::XTypeProvider,
43                     public ::com::sun::star::lang::XUnoTunnel,
44                     public ::cppu::OWeakObject
45 {
46 private:
47     ::osl::Mutex    maMutex;
48     BitmapEx        maBitmap;
49 
50 protected:
GetMutex()51     ::osl::Mutex&   GetMutex() { return maMutex; }
52 
53 
54 public:
SetBitmap(const BitmapEx & rBmp)55     void            SetBitmap( const BitmapEx& rBmp )   { maBitmap = rBmp; }
GetBitmap() const56     const BitmapEx& GetBitmap() const                   { return maBitmap; }
57 
58 
59     // ::com::sun::star::uno::XInterface
60     ::com::sun::star::uno::Any                  SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
acquire()61     void                                        SAL_CALL acquire() throw()  { OWeakObject::acquire(); }
release()62     void                                        SAL_CALL release() throw()  { OWeakObject::release(); }
63 
64     // ::com::sun::star::lang::XUnoTunnel
65     static const ::com::sun::star::uno::Sequence< sal_Int8 >&   GetUnoTunnelId() throw();
66     static VCLXBitmap*                                          GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw();
67     sal_Int64                                                   SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException);
68 
69     // ::com::sun::star::lang::XTypeProvider
70     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type >  SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException);
71     ::com::sun::star::uno::Sequence< sal_Int8 >                     SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException);
72 
73     // ::com::sun::star::awt::XBitmap
74     ::com::sun::star::awt::Size                 SAL_CALL getSize() throw(::com::sun::star::uno::RuntimeException);
75     ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getDIB() throw(::com::sun::star::uno::RuntimeException);
76     ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getMaskDIB() throw(::com::sun::star::uno::RuntimeException);
77 };
78 
79 
80 
81 
82 #endif // _TOOLKIT_AWT_VCLXBITMAP_HXX_
83 
84