Update ooo320-m1
[ooovba.git] / toolkit / source / awt / vclxplugin.cxx
blob8145174c6ec62444c88edb32688e6e6bf43fd68b
1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
5 * $RCSfile$
7 * $Revision$
9 * last change: $Author$ $Date$
11 * The Contents of this file are made available subject to
12 * the terms of GNU Lesser General Public License Version 2.1.
15 * GNU Lesser General Public License Version 2.1
16 * =============================================
17 * Copyright 2005 by Sun Microsystems, Inc.
18 * 901 San Antonio Road, Palo Alto, CA 94303, USA
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License version 2.1, as published by the Free Software Foundation.
24 * This library is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * Lesser General Public License for more details.
29 * You should have received a copy of the GNU Lesser General Public
30 * License along with this library; if not, write to the Free Software
31 * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston,
32 * MA 02110-1301 USA
34 ************************************************************************/
36 #include "vclxplugin.hxx"
38 #include <com/sun/star/awt/PosSize.hpp>
39 #include <toolkit/helper/convert.hxx>
40 #include <toolkit/helper/property.hxx>
41 #include <vcl/ctrl.hxx>
43 #include "forward.hxx"
45 namespace layoutimpl
48 using namespace ::com::sun::star;
50 VCLXPlugin::VCLXPlugin( Window *p, WinBits b )
51 : VCLXWindow()
52 , mpWindow( p )
53 , mpPlugin( 0 )
54 , mStyle( b )
58 VCLXPlugin::~VCLXPlugin()
62 void SAL_CALL VCLXPlugin::dispose() throw(uno::RuntimeException)
65 ::vos::OGuard aGuard( GetMutex() );
67 lang::EventObject aDisposeEvent;
68 aDisposeEvent.Source = W3K_EXPLICIT_CAST (*this);
71 VCLXWindow::dispose();
74 void VCLXPlugin::SetPlugin( ::Control *p )
76 mpPlugin = p;
79 awt::Size SAL_CALL VCLXPlugin::getMinimumSize()
80 throw(::com::sun::star::uno::RuntimeException)
82 ::vos::OClearableGuard aGuard( GetMutex() );
83 if ( mpPlugin )
84 return AWTSize( mpPlugin->GetSizePixel() );
85 return awt::Size();
88 } // namespace layoutimpl