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 #ifndef SW_VBA_GLOBALS_HXX 24 #define SW_VBA_GLOBALS_HXX 25 26 #include <com/sun/star/lang/XServiceInfo.hpp> 27 #include <com/sun/star/lang/XInitialization.hpp> 28 #include <com/sun/star/uno/XComponentContext.hpp> 29 #include <ooo/vba/word/XGlobals.hpp> 30 #include <ooo/vba/word/XApplication.hpp> 31 #include <ooo/vba/word/XSystem.hpp> 32 #include <ooo/vba/word/XOptions.hpp> 33 #include <ooo/vba/word/XSelection.hpp> 34 #include <cppuhelper/implbase1.hxx> 35 #include <vbahelper/vbahelper.hxx> 36 #include <vbahelper/vbaglobalbase.hxx> 37 38 // ============================================================================= 39 // class SwVbaGlobals 40 // ============================================================================= 41 42 43 typedef ::cppu::ImplInheritanceHelper1< VbaGlobalsBase, ov::word::XGlobals > SwVbaGlobals_BASE; 44 45 class SwVbaGlobals : public SwVbaGlobals_BASE 46 { 47 private: 48 css::uno::Reference< ooo::vba::word::XApplication > mxApplication; 49 50 virtual css::uno::Reference< ooo::vba::word::XApplication > getApplication() throw (css::uno::RuntimeException); 51 52 public: 53 54 SwVbaGlobals( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& rxContext ); 55 virtual ~SwVbaGlobals(); 56 57 // XGlobals 58 virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); 59 virtual css::uno::Reference< ooo::vba::word::XSystem > SAL_CALL getSystem() throw (css::uno::RuntimeException); 60 virtual css::uno::Reference< ov::word::XDocument > SAL_CALL getActiveDocument() throw (css::uno::RuntimeException); 61 virtual css::uno::Reference< ov::word::XWindow > SAL_CALL getActiveWindow() throw (css::uno::RuntimeException); 62 virtual css::uno::Reference< ooo::vba::word::XOptions > SAL_CALL getOptions() throw (css::uno::RuntimeException); 63 virtual css::uno::Reference< ooo::vba::word::XSelection > SAL_CALL getSelection() throw (css::uno::RuntimeException); 64 virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); 65 virtual css::uno::Any SAL_CALL Documents( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); 66 virtual css::uno::Any SAL_CALL Addins( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); 67 virtual css::uno::Any SAL_CALL Dialogs( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); 68 virtual float SAL_CALL CentimetersToPoints( float _Centimeters ) throw (css::uno::RuntimeException); 69 // XMultiServiceFactory 70 virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames( ) throw (css::uno::RuntimeException); 71 72 // XHelperInterface 73 virtual rtl::OUString& getServiceImplName(); 74 virtual css::uno::Sequence<rtl::OUString> getServiceNames(); 75 }; 76 #endif /* SW_VBA_GLOBALS_HXX */ 77