1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _Addon_HXX 25 #define _Addon_HXX 26 27 #include <com/sun/star/lang/XInitialization.hpp> 28 #include <com/sun/star/frame/XDispatchProvider.hpp> 29 #include <com/sun/star/lang/XServiceInfo.hpp> 30 #include <cppuhelper/implbase4.hxx> 31 32 #define IMPLEMENTATION_NAME "org.openoffice.Office.addon.example" 33 34 namespace com 35 { 36 namespace sun 37 { 38 namespace star 39 { 40 namespace frame 41 { 42 class XFrame; 43 } 44 namespace awt 45 { 46 class XToolkit; 47 } 48 } 49 } 50 } 51 52 class Addon : public cppu::WeakImplHelper4 53 < 54 com::sun::star::frame::XDispatchProvider, 55 com::sun::star::frame::XDispatch, 56 com::sun::star::lang::XInitialization, 57 com::sun::star::lang::XServiceInfo 58 > 59 { 60 private: 61 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF; 62 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame; 63 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > mxToolkit; 64 65 public: Addon(const::com::sun::star::uno::Reference<::com::sun::star::lang::XMultiServiceFactory> & rxMSF)66 Addon( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > &rxMSF) 67 : mxMSF( rxMSF ) {} 68 69 // XDispatchProvider 70 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > 71 SAL_CALL queryDispatch( const ::com::sun::star::util::URL& aURL, 72 const ::rtl::OUString& sTargetFrameName, sal_Int32 nSearchFlags ); 73 virtual ::com::sun::star::uno::Sequence < ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > 74 SAL_CALL queryDispatches( 75 const ::com::sun::star::uno::Sequence < ::com::sun::star::frame::DispatchDescriptor >& seqDescriptor ); 76 77 // XDispatch 78 virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL& aURL, 79 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArgs ); 80 virtual void SAL_CALL addStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xControl, 81 const ::com::sun::star::util::URL& aURL ); 82 virtual void SAL_CALL removeStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >& xControl, 83 const ::com::sun::star::util::URL& aURL ); 84 85 // XInitialization 86 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ); 87 88 // XServiceInfo 89 virtual ::rtl::OUString SAL_CALL getImplementationName( ); 90 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ); 91 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ); 92 }; 93 94 ::rtl::OUString Addon_getImplementationName(); 95 96 sal_Bool SAL_CALL Addon_supportsService( const ::rtl::OUString& ServiceName ); 97 98 ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL Addon_getSupportedServiceNames( ); 99 100 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > 101 SAL_CALL Addon_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr); 102 103 #endif // _Addon_HXX 104