merge the formfield patch from ooo-build
[ooovba.git] / odk / examples / DevelopersGuide / Components / Addons / ProtocolHandlerAddon_cpp / addon.hxx
blobb07e30cba369e61bd7f2813050de663fc68b26b4
1 /*************************************************************************
3 * $RCSfile: addon.hxx,v $
5 * $Revision: 1.5 $
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
10 * the BSD license.
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
17 * are met:
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 *************************************************************************/
41 #ifndef _Addon_HXX
42 #define _Addon_HXX
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"
51 namespace com
53 namespace sun
55 namespace star
57 namespace frame
59 class XFrame;
61 namespace awt
63 class XToolkit;
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
77 private:
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;
82 public:
83 Addon( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF)
84 : mxMSF( rxMSF ) {}
86 // XDispatchProvider
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 );
96 // XDispatch
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);
105 // XInitialization
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);
109 // XServiceInfo
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 );
131 #endif // _Addon_HXX