1 /*************************************************************************
3 * $RCSfile: addon.hxx,v $
7 * last change: $Author: rt $ $Date: 2008-04-10 16:28:30 $
9 * The Contents of this file are made available subject to the terms of
12 * Copyright (c) 2003 by Sun Microsystems, Inc.
13 * All rights reserved.
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 * 3. Neither the name of Sun Microsystems, Inc. nor the names of its
24 * contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
30 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
31 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
32 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
33 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
34 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
35 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
36 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
37 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *************************************************************************/
44 #include <com/sun/star/lang/XInitialization.hpp>
45 #include <com/sun/star/frame/XDispatchProvider.hpp>
46 #include <com/sun/star/lang/XServiceInfo.hpp>
47 #include <cppuhelper/implbase4.hxx>
49 #define IMPLEMENTATION_NAME "org.openoffice.Office.addon.example"
69 class Addon
: public cppu::WeakImplHelper4
71 com::sun::star::frame::XDispatchProvider
,
72 com::sun::star::frame::XDispatch
,
73 com::sun::star::lang::XInitialization
,
74 com::sun::star::lang::XServiceInfo
78 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> mxMSF
;
79 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> mxFrame
;
80 ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XToolkit
> mxToolkit
;
83 Addon( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> &rxMSF
)
87 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
>
88 SAL_CALL
queryDispatch( const ::com::sun::star::util::URL
& aURL
,
89 const ::rtl::OUString
& sTargetFrameName
, sal_Int32 nSearchFlags
)
90 throw( ::com::sun::star::uno::RuntimeException
);
91 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XDispatch
> >
92 SAL_CALL
queryDispatches(
93 const ::com::sun::star::uno::Sequence
< ::com::sun::star::frame::DispatchDescriptor
>& seqDescriptor
)
94 throw( ::com::sun::star::uno::RuntimeException
);
97 virtual void SAL_CALL
dispatch( const ::com::sun::star::util::URL
& aURL
,
98 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& lArgs
)
99 throw (::com::sun::star::uno::RuntimeException
);
100 virtual void SAL_CALL
addStatusListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XStatusListener
>& xControl
,
101 const ::com::sun::star::util::URL
& aURL
) throw (::com::sun::star::uno::RuntimeException
);
102 virtual void SAL_CALL
removeStatusListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XStatusListener
>& xControl
,
103 const ::com::sun::star::util::URL
& aURL
) throw (::com::sun::star::uno::RuntimeException
);
106 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
)
107 throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
110 virtual ::rtl::OUString SAL_CALL
getImplementationName( )
111 throw (::com::sun::star::uno::RuntimeException
);
112 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
)
113 throw (::com::sun::star::uno::RuntimeException
);
114 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames( )
115 throw (::com::sun::star::uno::RuntimeException
);
118 ::rtl::OUString
Addon_getImplementationName()
119 throw ( ::com::sun::star::uno::RuntimeException
);
121 sal_Bool SAL_CALL
Addon_supportsService( const ::rtl::OUString
& ServiceName
)
122 throw ( ::com::sun::star::uno::RuntimeException
);
124 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
Addon_getSupportedServiceNames( )
125 throw ( ::com::sun::star::uno::RuntimeException
);
127 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>
128 SAL_CALL
Addon_createInstance( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> & rSMgr
)
129 throw ( ::com::sun::star::uno::Exception
);