1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: applet.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SFX_APPLET_HXX
32 #define _SFX_APPLET_HXX
34 #include <com/sun/star/uno/Reference.hxx>
35 #include <com/sun/star/uno/Sequence.hxx>
36 #include <com/sun/star/util/XCloseable.hpp>
37 #include <com/sun/star/lang/XEventListener.hpp>
38 #include <com/sun/star/frame/XSynchronousFrameLoader.hpp>
39 #include <com/sun/star/beans/XPropertySet.hpp>
40 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
41 #include <com/sun/star/lang/XInitialization.hpp>
42 #include <com/sun/star/embed/XEmbeddedObject.hpp>
43 #include <cppuhelper/implbase6.hxx>
45 #include <rtl/ustring.hxx>
46 #include <svtools/ownlist.hxx>
47 #include <svtools/itemprop.hxx>
49 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{
50 class XComponentContext
;
58 class AppletObject
: public ::cppu::WeakImplHelper6
<
59 com::sun::star::util::XCloseable
,
60 com::sun::star::lang::XEventListener
,
61 com::sun::star::frame::XSynchronousFrameLoader
,
62 com::sun::star::ui::dialogs::XExecutableDialog
,
63 com::sun::star::lang::XInitialization
,
64 com::sun::star::beans::XPropertySet
>
66 com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>
68 com::sun::star::uno::Reference
< com::sun::star::embed::XEmbeddedObject
> mxObj
;
69 SfxItemPropertyMap maPropMap
;
70 SvCommandList maCmdList
;
71 ::rtl::OUString maClass
;
72 ::rtl::OUString maName
;
73 ::rtl::OUString maCodeBase
;
74 ::rtl::OUString maDocBase
;
78 AppletObject( AppletObject
& ); // not defined
79 void operator =( AppletObject
& ); // not defined
81 AppletObject( const com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>& rContext
);
84 virtual sal_Bool SAL_CALL
load( const com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
>& lDescriptor
,
85 const com::sun::star::uno::Reference
< com::sun::star::frame::XFrame
>& xFrame
) throw( com::sun::star::uno::RuntimeException
);
86 virtual void SAL_CALL
cancel() throw( com::sun::star::uno::RuntimeException
);
87 virtual void SAL_CALL
close( sal_Bool bDeliverOwnership
) throw( com::sun::star::util::CloseVetoException
, com::sun::star::uno::RuntimeException
);
88 virtual void SAL_CALL
addCloseListener( const com::sun::star::uno::Reference
< com::sun::star::util::XCloseListener
>& xListener
) throw( com::sun::star::uno::RuntimeException
);
89 virtual void SAL_CALL
removeCloseListener( const com::sun::star::uno::Reference
< com::sun::star::util::XCloseListener
>& xListener
) throw( com::sun::star::uno::RuntimeException
);
90 virtual void SAL_CALL
disposing( const com::sun::star::lang::EventObject
& aEvent
) throw (com::sun::star::uno::RuntimeException
) ;
91 virtual void SAL_CALL
setTitle( const ::rtl::OUString
& aTitle
) throw (::com::sun::star::uno::RuntimeException
);
92 virtual ::sal_Int16 SAL_CALL
execute( ) throw (::com::sun::star::uno::RuntimeException
);
93 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException
);
94 virtual void SAL_CALL
addPropertyChangeListener(const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
> & aListener
) throw( ::com::sun::star::uno::RuntimeException
);
95 virtual void SAL_CALL
removePropertyChangeListener(const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
> & aListener
) throw( ::com::sun::star::uno::RuntimeException
);
96 virtual void SAL_CALL
addVetoableChangeListener(const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
> & aListener
) throw( ::com::sun::star::uno::RuntimeException
);
97 virtual void SAL_CALL
removeVetoableChangeListener(const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
> & aListener
) throw( ::com::sun::star::uno::RuntimeException
);
98 virtual void SAL_CALL
setPropertyValue( const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Any
& aValue
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
99 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const ::rtl::OUString
& PropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
100 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
) throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
102 virtual ::rtl::OUString SAL_CALL
getImplementationName()
103 throw( ::com::sun::star::uno::RuntimeException
);
104 virtual ::sal_Bool SAL_CALL
supportsService(
105 const ::rtl::OUString
& sServiceName
)
106 throw( ::com::sun::star::uno::RuntimeException
);
107 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
108 getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException
);
110 static ::com::sun::star::uno::Sequence
< ::rtl::OUString
>
111 impl_getStaticSupportedServiceNames();
112 static ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>
113 SAL_CALL
impl_createInstance(
114 const ::com::sun::star::uno::Reference
<
115 ::com::sun::star::uno::XComponentContext
>& xContext
)
116 throw( ::com::sun::star::uno::Exception
);
119 static ::rtl::OUString
impl_getStaticImplementationName();
120 static ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>
121 impl_createFactory();