xref: /aoo41x/main/toolkit/source/awt/vclxplugin.cxx (revision b0724fc6)
1*b0724fc6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*b0724fc6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*b0724fc6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*b0724fc6SAndrew Rist  * distributed with this work for additional information
6*b0724fc6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*b0724fc6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*b0724fc6SAndrew Rist  * "License"); you may not use this file except in compliance
9*b0724fc6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*b0724fc6SAndrew Rist  *
11*b0724fc6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*b0724fc6SAndrew Rist  *
13*b0724fc6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*b0724fc6SAndrew Rist  * software distributed under the License is distributed on an
15*b0724fc6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b0724fc6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*b0724fc6SAndrew Rist  * specific language governing permissions and limitations
18*b0724fc6SAndrew Rist  * under the License.
19*b0724fc6SAndrew Rist  *
20*b0724fc6SAndrew Rist  *************************************************************/
21*b0724fc6SAndrew Rist 
22*b0724fc6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include "vclxplugin.hxx"
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <com/sun/star/awt/PosSize.hpp>
27cdf0e10cSrcweir #include <toolkit/helper/convert.hxx>
28cdf0e10cSrcweir #include <toolkit/helper/property.hxx>
29cdf0e10cSrcweir #include <vcl/ctrl.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include "forward.hxx"
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace layoutimpl
34cdf0e10cSrcweir {
35cdf0e10cSrcweir 
36cdf0e10cSrcweir using namespace ::com::sun::star;
37cdf0e10cSrcweir 
VCLXPlugin(Window * p,WinBits b)38cdf0e10cSrcweir VCLXPlugin::VCLXPlugin( Window *p, WinBits b )
39cdf0e10cSrcweir     : VCLXWindow()
40cdf0e10cSrcweir     , mpWindow( p )
41cdf0e10cSrcweir     , mpPlugin( 0 )
42cdf0e10cSrcweir     , mStyle( b )
43cdf0e10cSrcweir {
44cdf0e10cSrcweir }
45cdf0e10cSrcweir 
~VCLXPlugin()46cdf0e10cSrcweir VCLXPlugin::~VCLXPlugin()
47cdf0e10cSrcweir {
48cdf0e10cSrcweir }
49cdf0e10cSrcweir 
dispose()50cdf0e10cSrcweir void SAL_CALL VCLXPlugin::dispose() throw(uno::RuntimeException)
51cdf0e10cSrcweir {
52cdf0e10cSrcweir     {
53cdf0e10cSrcweir         ::vos::OGuard aGuard( GetMutex() );
54cdf0e10cSrcweir 
55cdf0e10cSrcweir         lang::EventObject aDisposeEvent;
56cdf0e10cSrcweir         aDisposeEvent.Source = W3K_EXPLICIT_CAST (*this);
57cdf0e10cSrcweir     }
58cdf0e10cSrcweir 
59cdf0e10cSrcweir     VCLXWindow::dispose();
60cdf0e10cSrcweir }
61cdf0e10cSrcweir 
SetPlugin(::Control * p)62cdf0e10cSrcweir void VCLXPlugin::SetPlugin( ::Control *p )
63cdf0e10cSrcweir {
64cdf0e10cSrcweir     mpPlugin = p;
65cdf0e10cSrcweir }
66cdf0e10cSrcweir 
getMinimumSize()67cdf0e10cSrcweir awt::Size SAL_CALL VCLXPlugin::getMinimumSize()
68cdf0e10cSrcweir     throw(::com::sun::star::uno::RuntimeException)
69cdf0e10cSrcweir {
70cdf0e10cSrcweir     ::vos::OClearableGuard aGuard( GetMutex() );
71cdf0e10cSrcweir     if ( mpPlugin )
72cdf0e10cSrcweir         return AWTSize( mpPlugin->GetSizePixel() );
73cdf0e10cSrcweir     return awt::Size();
74cdf0e10cSrcweir }
75cdf0e10cSrcweir 
76cdf0e10cSrcweir } // namespace layoutimpl
77