1*d119d52dSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*d119d52dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*d119d52dSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*d119d52dSAndrew Rist * distributed with this work for additional information 6*d119d52dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*d119d52dSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*d119d52dSAndrew Rist * "License"); you may not use this file except in compliance 9*d119d52dSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*d119d52dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*d119d52dSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*d119d52dSAndrew Rist * software distributed under the License is distributed on an 15*d119d52dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*d119d52dSAndrew Rist * KIND, either express or implied. See the License for the 17*d119d52dSAndrew Rist * specific language governing permissions and limitations 18*d119d52dSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*d119d52dSAndrew Rist *************************************************************/ 21*d119d52dSAndrew Rist 22*d119d52dSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_sfx2.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "iframe.hxx" 28cdf0e10cSrcweir #include <sfx2/sfxdlg.hxx> 29cdf0e10cSrcweir #include <sfx2/sfxsids.hrc> 30cdf0e10cSrcweir #include <com/sun/star/frame/XDispatchProvider.hpp> 31cdf0e10cSrcweir #include <com/sun/star/frame/XDispatch.hpp> 32cdf0e10cSrcweir #include <com/sun/star/frame/XFramesSupplier.hpp> 33cdf0e10cSrcweir #include <com/sun/star/util/XURLTransformer.hpp> 34cdf0e10cSrcweir 35cdf0e10cSrcweir #include <tools/urlobj.hxx> 36cdf0e10cSrcweir #include <tools/debug.hxx> 37cdf0e10cSrcweir #include <rtl/ustring.hxx> 38cdf0e10cSrcweir #include <toolkit/helper/vclunohelper.hxx> 39cdf0e10cSrcweir #include <svtools/miscopt.hxx> 40cdf0e10cSrcweir #include <vcl/window.hxx> 41cdf0e10cSrcweir 42cdf0e10cSrcweir using namespace ::com::sun::star; 43cdf0e10cSrcweir 44cdf0e10cSrcweir namespace sfx2 45cdf0e10cSrcweir { 46cdf0e10cSrcweir 47cdf0e10cSrcweir class IFrameWindow_Impl : public Window 48cdf0e10cSrcweir { 49cdf0e10cSrcweir uno::Reference < frame::XFrame > mxFrame; 50cdf0e10cSrcweir sal_Bool bActive; 51cdf0e10cSrcweir sal_Bool bBorder; 52cdf0e10cSrcweir 53cdf0e10cSrcweir public: 54cdf0e10cSrcweir IFrameWindow_Impl( Window *pParent, 55cdf0e10cSrcweir sal_Bool bHasBorder, 56cdf0e10cSrcweir WinBits nWinBits = 0 ); 57cdf0e10cSrcweir 58cdf0e10cSrcweir public: 59cdf0e10cSrcweir void SetBorder( sal_Bool bNewBorder = sal_True ); 60cdf0e10cSrcweir sal_Bool HasBorder() const { return bBorder; } 61cdf0e10cSrcweir }; 62cdf0e10cSrcweir 63cdf0e10cSrcweir IFrameWindow_Impl::IFrameWindow_Impl( Window *pParent, sal_Bool bHasBorder, WinBits nWinBits ) 64cdf0e10cSrcweir : Window( pParent, nWinBits | WB_CLIPCHILDREN | WB_NODIALOGCONTROL | WB_DOCKBORDER ) 65cdf0e10cSrcweir , bActive(sal_False) 66cdf0e10cSrcweir , bBorder(bHasBorder) 67cdf0e10cSrcweir { 68cdf0e10cSrcweir if ( !bHasBorder ) 69cdf0e10cSrcweir SetBorderStyle( WINDOW_BORDER_NOBORDER ); 70cdf0e10cSrcweir else 71cdf0e10cSrcweir SetBorderStyle( WINDOW_BORDER_NORMAL ); 72cdf0e10cSrcweir //SetActivateMode( ACTIVATE_MODE_GRABFOCUS ); 73cdf0e10cSrcweir } 74cdf0e10cSrcweir 75cdf0e10cSrcweir void IFrameWindow_Impl::SetBorder( sal_Bool bNewBorder ) 76cdf0e10cSrcweir { 77cdf0e10cSrcweir if ( bBorder != bNewBorder ) 78cdf0e10cSrcweir { 79cdf0e10cSrcweir Size aSize = GetSizePixel(); 80cdf0e10cSrcweir bBorder = bNewBorder; 81cdf0e10cSrcweir if ( bBorder ) 82cdf0e10cSrcweir SetBorderStyle( WINDOW_BORDER_NORMAL ); 83cdf0e10cSrcweir else 84cdf0e10cSrcweir SetBorderStyle( WINDOW_BORDER_NOBORDER ); 85cdf0e10cSrcweir if ( GetSizePixel() != aSize ) 86cdf0e10cSrcweir SetSizePixel( aSize ); 87cdf0e10cSrcweir } 88cdf0e10cSrcweir } 89cdf0e10cSrcweir 90cdf0e10cSrcweir #define PROPERTY_UNBOUND 0 91cdf0e10cSrcweir 92cdf0e10cSrcweir #define WID_FRAME_URL 1 93cdf0e10cSrcweir #define WID_FRAME_NAME 2 94cdf0e10cSrcweir #define WID_FRAME_IS_AUTO_SCROLL 3 95cdf0e10cSrcweir #define WID_FRAME_IS_SCROLLING_MODE 4 96cdf0e10cSrcweir #define WID_FRAME_IS_BORDER 5 97cdf0e10cSrcweir #define WID_FRAME_IS_AUTO_BORDER 6 98cdf0e10cSrcweir #define WID_FRAME_MARGIN_WIDTH 7 99cdf0e10cSrcweir #define WID_FRAME_MARGIN_HEIGHT 8 100cdf0e10cSrcweir 101cdf0e10cSrcweir const SfxItemPropertyMapEntry* lcl_GetIFramePropertyMap_Impl() 102cdf0e10cSrcweir { 103cdf0e10cSrcweir static SfxItemPropertyMapEntry aIFramePropertyMap_Impl[] = 104cdf0e10cSrcweir { 105cdf0e10cSrcweir { MAP_CHAR_LEN("FrameIsAutoBorder"), WID_FRAME_IS_AUTO_BORDER, &::getBooleanCppuType(), PROPERTY_UNBOUND, 0 }, 106cdf0e10cSrcweir { MAP_CHAR_LEN("FrameIsAutoScroll"), WID_FRAME_IS_AUTO_SCROLL, &::getBooleanCppuType(), PROPERTY_UNBOUND, 0 }, 107cdf0e10cSrcweir { MAP_CHAR_LEN("FrameIsBorder"), WID_FRAME_IS_BORDER, &::getBooleanCppuType(), PROPERTY_UNBOUND, 0 }, 108cdf0e10cSrcweir { MAP_CHAR_LEN("FrameIsScrollingMode"), WID_FRAME_IS_SCROLLING_MODE, &::getBooleanCppuType(), PROPERTY_UNBOUND, 0 }, 109cdf0e10cSrcweir { MAP_CHAR_LEN("FrameMarginHeight"), WID_FRAME_MARGIN_HEIGHT, &::getCppuType( (sal_Int32*)0 ), PROPERTY_UNBOUND, 0 }, 110cdf0e10cSrcweir { MAP_CHAR_LEN("FrameMarginWidth"), WID_FRAME_MARGIN_WIDTH, &::getCppuType( (sal_Int32*)0 ), PROPERTY_UNBOUND, 0 }, 111cdf0e10cSrcweir { MAP_CHAR_LEN("FrameName"), WID_FRAME_NAME, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 }, 112cdf0e10cSrcweir { MAP_CHAR_LEN("FrameURL"), WID_FRAME_URL, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 }, 113cdf0e10cSrcweir {0,0,0,0,0,0} 114cdf0e10cSrcweir }; 115cdf0e10cSrcweir return aIFramePropertyMap_Impl; 116cdf0e10cSrcweir } 117cdf0e10cSrcweir 118cdf0e10cSrcweir SFX_IMPL_XSERVICEINFO( IFrameObject, "com.sun.star.embed.SpecialEmbeddedObject", "com.sun.star.comp.sfx2.IFrameObject" ) 119cdf0e10cSrcweir SFX_IMPL_SINGLEFACTORY( IFrameObject ); 120cdf0e10cSrcweir 121cdf0e10cSrcweir IFrameObject::IFrameObject( const uno::Reference < lang::XMultiServiceFactory >& rFact ) 122cdf0e10cSrcweir : mxFact( rFact ) 123cdf0e10cSrcweir , maPropMap( lcl_GetIFramePropertyMap_Impl() ) 124cdf0e10cSrcweir { 125cdf0e10cSrcweir } 126cdf0e10cSrcweir 127cdf0e10cSrcweir IFrameObject::~IFrameObject() 128cdf0e10cSrcweir { 129cdf0e10cSrcweir } 130cdf0e10cSrcweir 131cdf0e10cSrcweir 132cdf0e10cSrcweir void SAL_CALL IFrameObject::initialize( const uno::Sequence< uno::Any >& aArguments ) throw ( uno::Exception, uno::RuntimeException ) 133cdf0e10cSrcweir { 134cdf0e10cSrcweir if ( aArguments.getLength() ) 135cdf0e10cSrcweir aArguments[0] >>= mxObj; 136cdf0e10cSrcweir } 137cdf0e10cSrcweir 138cdf0e10cSrcweir sal_Bool SAL_CALL IFrameObject::load( 139cdf0e10cSrcweir const uno::Sequence < com::sun::star::beans::PropertyValue >& /*lDescriptor*/, 140cdf0e10cSrcweir const uno::Reference < frame::XFrame >& xFrame ) 141cdf0e10cSrcweir throw( uno::RuntimeException ) 142cdf0e10cSrcweir { 143cdf0e10cSrcweir if ( SvtMiscOptions().IsPluginsEnabled() ) 144cdf0e10cSrcweir { 145cdf0e10cSrcweir DBG_ASSERT( !mxFrame.is(), "Frame already existing!" ); 146cdf0e10cSrcweir Window* pParent = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() ); 147cdf0e10cSrcweir IFrameWindow_Impl* pWin = new IFrameWindow_Impl( pParent, maFrmDescr.IsFrameBorderOn() ); 148cdf0e10cSrcweir pWin->SetSizePixel( pParent->GetOutputSizePixel() ); 149cdf0e10cSrcweir pWin->SetBackground(); 150cdf0e10cSrcweir pWin->Show(); 151cdf0e10cSrcweir 152cdf0e10cSrcweir uno::Reference < awt::XWindow > xWindow( pWin->GetComponentInterface(), uno::UNO_QUERY ); 153cdf0e10cSrcweir xFrame->setComponent( xWindow, uno::Reference < frame::XController >() ); 154cdf0e10cSrcweir 155cdf0e10cSrcweir // we must destroy the IFrame before the parent is destroyed 156cdf0e10cSrcweir xWindow->addEventListener( this ); 157cdf0e10cSrcweir 158cdf0e10cSrcweir mxFrame = uno::Reference< frame::XFrame >( mxFact->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.frame.Frame" ) ), 159cdf0e10cSrcweir uno::UNO_QUERY ); 160cdf0e10cSrcweir uno::Reference < awt::XWindow > xWin( pWin->GetComponentInterface(), uno::UNO_QUERY ); 161cdf0e10cSrcweir mxFrame->initialize( xWin ); 162cdf0e10cSrcweir mxFrame->setName( maFrmDescr.GetName() ); 163cdf0e10cSrcweir 164cdf0e10cSrcweir uno::Reference < frame::XFramesSupplier > xFramesSupplier( xFrame, uno::UNO_QUERY ); 165cdf0e10cSrcweir if ( xFramesSupplier.is() ) 166cdf0e10cSrcweir mxFrame->setCreator( xFramesSupplier ); 167cdf0e10cSrcweir 168cdf0e10cSrcweir uno::Reference< frame::XDispatchProvider > xProv( mxFrame, uno::UNO_QUERY ); 169cdf0e10cSrcweir 170cdf0e10cSrcweir util::URL aTargetURL; 171cdf0e10cSrcweir aTargetURL.Complete = ::rtl::OUString( maFrmDescr.GetURL().GetMainURL( INetURLObject::NO_DECODE ) ); 172cdf0e10cSrcweir uno::Reference < util::XURLTransformer > xTrans( mxFact->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), uno::UNO_QUERY ); 173cdf0e10cSrcweir xTrans->parseStrict( aTargetURL ); 174cdf0e10cSrcweir 175cdf0e10cSrcweir uno::Sequence < beans::PropertyValue > aProps(2); 176cdf0e10cSrcweir aProps[0].Name = ::rtl::OUString::createFromAscii("PluginMode"); 177cdf0e10cSrcweir aProps[0].Value <<= (sal_Int16) 2; 178cdf0e10cSrcweir aProps[1].Name = ::rtl::OUString::createFromAscii("ReadOnly"); 179cdf0e10cSrcweir aProps[1].Value <<= (sal_Bool) sal_True; 180cdf0e10cSrcweir uno::Reference < frame::XDispatch > xDisp = xProv->queryDispatch( aTargetURL, ::rtl::OUString::createFromAscii("_self"), 0 ); 181cdf0e10cSrcweir if ( xDisp.is() ) 182cdf0e10cSrcweir xDisp->dispatch( aTargetURL, aProps ); 183cdf0e10cSrcweir 184cdf0e10cSrcweir return sal_True; 185cdf0e10cSrcweir } 186cdf0e10cSrcweir 187cdf0e10cSrcweir return sal_False; 188cdf0e10cSrcweir } 189cdf0e10cSrcweir 190cdf0e10cSrcweir void SAL_CALL IFrameObject::cancel() throw( com::sun::star::uno::RuntimeException ) 191cdf0e10cSrcweir { 192cdf0e10cSrcweir try 193cdf0e10cSrcweir { 194cdf0e10cSrcweir uno::Reference < util::XCloseable > xClose( mxFrame, uno::UNO_QUERY ); 195cdf0e10cSrcweir if ( xClose.is() ) 196cdf0e10cSrcweir xClose->close( sal_True ); 197cdf0e10cSrcweir mxFrame = 0; 198cdf0e10cSrcweir } 199cdf0e10cSrcweir catch ( uno::Exception& ) 200cdf0e10cSrcweir {} 201cdf0e10cSrcweir } 202cdf0e10cSrcweir 203cdf0e10cSrcweir void SAL_CALL IFrameObject::close( sal_Bool /*bDeliverOwnership*/ ) throw( com::sun::star::util::CloseVetoException, com::sun::star::uno::RuntimeException ) 204cdf0e10cSrcweir { 205cdf0e10cSrcweir } 206cdf0e10cSrcweir 207cdf0e10cSrcweir void SAL_CALL IFrameObject::addCloseListener( const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& ) throw( com::sun::star::uno::RuntimeException ) 208cdf0e10cSrcweir { 209cdf0e10cSrcweir } 210cdf0e10cSrcweir 211cdf0e10cSrcweir void SAL_CALL IFrameObject::removeCloseListener( const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& ) throw( com::sun::star::uno::RuntimeException ) 212cdf0e10cSrcweir { 213cdf0e10cSrcweir } 214cdf0e10cSrcweir 215cdf0e10cSrcweir void SAL_CALL IFrameObject::disposing( const com::sun::star::lang::EventObject& ) throw (com::sun::star::uno::RuntimeException) 216cdf0e10cSrcweir { 217cdf0e10cSrcweir cancel(); 218cdf0e10cSrcweir } 219cdf0e10cSrcweir 220cdf0e10cSrcweir uno::Reference< beans::XPropertySetInfo > SAL_CALL IFrameObject::getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException ) 221cdf0e10cSrcweir { 222cdf0e10cSrcweir static uno::Reference< beans::XPropertySetInfo > xInfo = new SfxItemPropertySetInfo( &maPropMap ); 223cdf0e10cSrcweir return xInfo; 224cdf0e10cSrcweir } 225cdf0e10cSrcweir 226cdf0e10cSrcweir void SAL_CALL IFrameObject::setPropertyValue(const ::rtl::OUString& aPropertyName, const uno::Any& aAny) 227cdf0e10cSrcweir throw ( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) 228cdf0e10cSrcweir { 229cdf0e10cSrcweir const SfxItemPropertySimpleEntry* pEntry = maPropMap.getByName( aPropertyName ); 230cdf0e10cSrcweir if( !pEntry ) 231cdf0e10cSrcweir throw beans::UnknownPropertyException(); 232cdf0e10cSrcweir switch( pEntry->nWID ) 233cdf0e10cSrcweir { 234cdf0e10cSrcweir case WID_FRAME_URL: 235cdf0e10cSrcweir { 236cdf0e10cSrcweir ::rtl::OUString aURL; 237cdf0e10cSrcweir aAny >>= aURL; 238cdf0e10cSrcweir maFrmDescr.SetURL( String(aURL) ); 239cdf0e10cSrcweir } 240cdf0e10cSrcweir break; 241cdf0e10cSrcweir case WID_FRAME_NAME: 242cdf0e10cSrcweir { 243cdf0e10cSrcweir ::rtl::OUString aName; 244cdf0e10cSrcweir if ( aAny >>= aName ) 245cdf0e10cSrcweir maFrmDescr.SetName( aName ); 246cdf0e10cSrcweir } 247cdf0e10cSrcweir break; 248cdf0e10cSrcweir case WID_FRAME_IS_AUTO_SCROLL: 249cdf0e10cSrcweir { 250cdf0e10cSrcweir sal_Bool bIsAutoScroll = sal_Bool(); 251cdf0e10cSrcweir if ( (aAny >>= bIsAutoScroll) && bIsAutoScroll ) 252cdf0e10cSrcweir maFrmDescr.SetScrollingMode( ScrollingAuto ); 253cdf0e10cSrcweir } 254cdf0e10cSrcweir break; 255cdf0e10cSrcweir case WID_FRAME_IS_SCROLLING_MODE: 256cdf0e10cSrcweir { 257cdf0e10cSrcweir sal_Bool bIsScroll = sal_Bool(); 258cdf0e10cSrcweir if ( aAny >>= bIsScroll ) 259cdf0e10cSrcweir maFrmDescr.SetScrollingMode( bIsScroll ? ScrollingYes : ScrollingNo ); 260cdf0e10cSrcweir } 261cdf0e10cSrcweir break; 262cdf0e10cSrcweir case WID_FRAME_IS_BORDER: 263cdf0e10cSrcweir { 264cdf0e10cSrcweir sal_Bool bIsBorder = sal_Bool(); 265cdf0e10cSrcweir if ( aAny >>= bIsBorder ) 266cdf0e10cSrcweir maFrmDescr.SetFrameBorder( bIsBorder ); 267cdf0e10cSrcweir } 268cdf0e10cSrcweir break; 269cdf0e10cSrcweir case WID_FRAME_IS_AUTO_BORDER: 270cdf0e10cSrcweir { 271cdf0e10cSrcweir sal_Bool bIsAutoBorder = sal_Bool(); 272cdf0e10cSrcweir if ( (aAny >>= bIsAutoBorder) ) 273cdf0e10cSrcweir { 274cdf0e10cSrcweir sal_Bool bBorder = maFrmDescr.IsFrameBorderOn(); 275cdf0e10cSrcweir maFrmDescr.ResetBorder(); 276cdf0e10cSrcweir if ( bIsAutoBorder ) 277cdf0e10cSrcweir maFrmDescr.SetFrameBorder( bBorder ); 278cdf0e10cSrcweir } 279cdf0e10cSrcweir } 280cdf0e10cSrcweir break; 281cdf0e10cSrcweir case WID_FRAME_MARGIN_WIDTH: 282cdf0e10cSrcweir { 283cdf0e10cSrcweir sal_Int32 nMargin = 0; 284cdf0e10cSrcweir Size aSize = maFrmDescr.GetMargin(); 285cdf0e10cSrcweir if ( aAny >>= nMargin ) 286cdf0e10cSrcweir { 287cdf0e10cSrcweir aSize.Width() = nMargin; 288cdf0e10cSrcweir maFrmDescr.SetMargin( aSize ); 289cdf0e10cSrcweir } 290cdf0e10cSrcweir } 291cdf0e10cSrcweir break; 292cdf0e10cSrcweir case WID_FRAME_MARGIN_HEIGHT: 293cdf0e10cSrcweir { 294cdf0e10cSrcweir sal_Int32 nMargin = 0; 295cdf0e10cSrcweir Size aSize = maFrmDescr.GetMargin(); 296cdf0e10cSrcweir if ( aAny >>= nMargin ) 297cdf0e10cSrcweir { 298cdf0e10cSrcweir aSize.Height() = nMargin; 299cdf0e10cSrcweir maFrmDescr.SetMargin( aSize ); 300cdf0e10cSrcweir } 301cdf0e10cSrcweir } 302cdf0e10cSrcweir break; 303cdf0e10cSrcweir default: ; 304cdf0e10cSrcweir } 305cdf0e10cSrcweir } 306cdf0e10cSrcweir 307cdf0e10cSrcweir uno::Any SAL_CALL IFrameObject::getPropertyValue(const ::rtl::OUString& aPropertyName) 308cdf0e10cSrcweir throw ( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) 309cdf0e10cSrcweir { 310cdf0e10cSrcweir const SfxItemPropertySimpleEntry* pEntry = maPropMap.getByName( aPropertyName ); 311cdf0e10cSrcweir if( !pEntry ) 312cdf0e10cSrcweir throw beans::UnknownPropertyException(); 313cdf0e10cSrcweir uno::Any aAny; 314cdf0e10cSrcweir switch( pEntry->nWID ) 315cdf0e10cSrcweir { 316cdf0e10cSrcweir case WID_FRAME_URL: 317cdf0e10cSrcweir { 318cdf0e10cSrcweir aAny <<= ::rtl::OUString( maFrmDescr.GetURL().GetMainURL( INetURLObject::NO_DECODE ) ); 319cdf0e10cSrcweir } 320cdf0e10cSrcweir break; 321cdf0e10cSrcweir case WID_FRAME_NAME: 322cdf0e10cSrcweir { 323cdf0e10cSrcweir aAny <<= ::rtl::OUString( maFrmDescr.GetName() ); 324cdf0e10cSrcweir } 325cdf0e10cSrcweir break; 326cdf0e10cSrcweir case WID_FRAME_IS_AUTO_SCROLL: 327cdf0e10cSrcweir { 328cdf0e10cSrcweir sal_Bool bIsAutoScroll = ( maFrmDescr.GetScrollingMode() == ScrollingAuto ); 329cdf0e10cSrcweir aAny <<= bIsAutoScroll; 330cdf0e10cSrcweir } 331cdf0e10cSrcweir break; 332cdf0e10cSrcweir case WID_FRAME_IS_SCROLLING_MODE: 333cdf0e10cSrcweir { 334cdf0e10cSrcweir sal_Bool bIsScroll = ( maFrmDescr.GetScrollingMode() == ScrollingYes ); 335cdf0e10cSrcweir aAny <<= bIsScroll; 336cdf0e10cSrcweir } 337cdf0e10cSrcweir break; 338cdf0e10cSrcweir case WID_FRAME_IS_BORDER: 339cdf0e10cSrcweir { 340cdf0e10cSrcweir sal_Bool bIsBorder = maFrmDescr.IsFrameBorderOn(); 341cdf0e10cSrcweir aAny <<= bIsBorder; 342cdf0e10cSrcweir } 343cdf0e10cSrcweir break; 344cdf0e10cSrcweir case WID_FRAME_IS_AUTO_BORDER: 345cdf0e10cSrcweir { 346cdf0e10cSrcweir sal_Bool bIsAutoBorder = !maFrmDescr.IsFrameBorderSet(); 347cdf0e10cSrcweir aAny <<= bIsAutoBorder; 348cdf0e10cSrcweir } 349cdf0e10cSrcweir break; 350cdf0e10cSrcweir case WID_FRAME_MARGIN_WIDTH: 351cdf0e10cSrcweir { 352cdf0e10cSrcweir aAny <<= (sal_Int32 ) maFrmDescr.GetMargin().Width(); 353cdf0e10cSrcweir } 354cdf0e10cSrcweir break; 355cdf0e10cSrcweir case WID_FRAME_MARGIN_HEIGHT: 356cdf0e10cSrcweir { 357cdf0e10cSrcweir aAny <<= (sal_Int32 ) maFrmDescr.GetMargin().Height(); 358cdf0e10cSrcweir } 359cdf0e10cSrcweir default: ; 360cdf0e10cSrcweir } 361cdf0e10cSrcweir return aAny; 362cdf0e10cSrcweir } 363cdf0e10cSrcweir 364cdf0e10cSrcweir void SAL_CALL IFrameObject::addPropertyChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException ) 365cdf0e10cSrcweir { 366cdf0e10cSrcweir } 367cdf0e10cSrcweir 368cdf0e10cSrcweir void SAL_CALL IFrameObject::removePropertyChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException ) 369cdf0e10cSrcweir { 370cdf0e10cSrcweir } 371cdf0e10cSrcweir 372cdf0e10cSrcweir void SAL_CALL IFrameObject::addVetoableChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException ) 373cdf0e10cSrcweir { 374cdf0e10cSrcweir } 375cdf0e10cSrcweir 376cdf0e10cSrcweir void SAL_CALL IFrameObject::removeVetoableChangeListener(const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & ) throw( ::com::sun::star::uno::RuntimeException ) 377cdf0e10cSrcweir { 378cdf0e10cSrcweir } 379cdf0e10cSrcweir 380cdf0e10cSrcweir ::sal_Int16 SAL_CALL IFrameObject::execute() throw (::com::sun::star::uno::RuntimeException) 381cdf0e10cSrcweir { 382cdf0e10cSrcweir SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); 383cdf0e10cSrcweir VclAbstractDialog* pDlg = pFact->CreateEditObjectDialog( NULL, rtl::OUString::createFromAscii(".uno:InsertObjectFloatingFrame"), mxObj ); 384cdf0e10cSrcweir if ( pDlg ) 385cdf0e10cSrcweir pDlg->Execute(); 386cdf0e10cSrcweir return 0; 387cdf0e10cSrcweir } 388cdf0e10cSrcweir 389cdf0e10cSrcweir void SAL_CALL IFrameObject::setTitle( const ::rtl::OUString& ) throw (::com::sun::star::uno::RuntimeException) 390cdf0e10cSrcweir { 391cdf0e10cSrcweir } 392cdf0e10cSrcweir 393cdf0e10cSrcweir } 394