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