xref: /trunk/main/toolkit/source/awt/vclxplugin.cxx (revision b0724fc6)
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 #include "vclxplugin.hxx"
25 
26 #include <com/sun/star/awt/PosSize.hpp>
27 #include <toolkit/helper/convert.hxx>
28 #include <toolkit/helper/property.hxx>
29 #include <vcl/ctrl.hxx>
30 
31 #include "forward.hxx"
32 
33 namespace layoutimpl
34 {
35 
36 using namespace ::com::sun::star;
37 
VCLXPlugin(Window * p,WinBits b)38 VCLXPlugin::VCLXPlugin( Window *p, WinBits b )
39     : VCLXWindow()
40     , mpWindow( p )
41     , mpPlugin( 0 )
42     , mStyle( b )
43 {
44 }
45 
~VCLXPlugin()46 VCLXPlugin::~VCLXPlugin()
47 {
48 }
49 
dispose()50 void SAL_CALL VCLXPlugin::dispose() throw(uno::RuntimeException)
51 {
52     {
53         ::vos::OGuard aGuard( GetMutex() );
54 
55         lang::EventObject aDisposeEvent;
56         aDisposeEvent.Source = W3K_EXPLICIT_CAST (*this);
57     }
58 
59     VCLXWindow::dispose();
60 }
61 
SetPlugin(::Control * p)62 void VCLXPlugin::SetPlugin( ::Control *p )
63 {
64     mpPlugin = p;
65 }
66 
getMinimumSize()67 awt::Size SAL_CALL VCLXPlugin::getMinimumSize()
68     throw(::com::sun::star::uno::RuntimeException)
69 {
70     ::vos::OClearableGuard aGuard( GetMutex() );
71     if ( mpPlugin )
72         return AWTSize( mpPlugin->GetSizePixel() );
73     return awt::Size();
74 }
75 
76 } // namespace layoutimpl
77