1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef SW_VBA_GLOBALS_HXX 28 #define SW_VBA_GLOBALS_HXX 29 30 #include <com/sun/star/lang/XServiceInfo.hpp> 31 #include <com/sun/star/lang/XInitialization.hpp> 32 #include <com/sun/star/uno/XComponentContext.hpp> 33 #include <ooo/vba/word/XGlobals.hpp> 34 #include <ooo/vba/word/XApplication.hpp> 35 #include <ooo/vba/word/XSystem.hpp> 36 #include <ooo/vba/word/XOptions.hpp> 37 #include <ooo/vba/word/XSelection.hpp> 38 #include <cppuhelper/implbase1.hxx> 39 #include <vbahelper/vbahelper.hxx> 40 #include <vbahelper/vbaglobalbase.hxx> 41 42 // ============================================================================= 43 // class SwVbaGlobals 44 // ============================================================================= 45 46 47 typedef ::cppu::ImplInheritanceHelper1< VbaGlobalsBase, ov::word::XGlobals > SwVbaGlobals_BASE; 48 49 class SwVbaGlobals : public SwVbaGlobals_BASE 50 { 51 private: 52 css::uno::Reference< ooo::vba::word::XApplication > mxApplication; 53 54 virtual css::uno::Reference< ooo::vba::word::XApplication > getApplication() throw (css::uno::RuntimeException); 55 56 public: 57 58 SwVbaGlobals( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& rxContext ); 59 virtual ~SwVbaGlobals(); 60 61 // XGlobals 62 virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); 63 virtual css::uno::Reference< ooo::vba::word::XSystem > SAL_CALL getSystem() throw (css::uno::RuntimeException); 64 virtual css::uno::Reference< ov::word::XDocument > SAL_CALL getActiveDocument() throw (css::uno::RuntimeException); 65 virtual css::uno::Reference< ov::word::XWindow > SAL_CALL getActiveWindow() throw (css::uno::RuntimeException); 66 virtual css::uno::Reference< ooo::vba::word::XOptions > SAL_CALL getOptions() throw (css::uno::RuntimeException); 67 virtual css::uno::Reference< ooo::vba::word::XSelection > SAL_CALL getSelection() throw (css::uno::RuntimeException); 68 virtual css::uno::Any SAL_CALL CommandBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); 69 virtual css::uno::Any SAL_CALL Documents( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); 70 virtual css::uno::Any SAL_CALL Addins( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); 71 virtual css::uno::Any SAL_CALL Dialogs( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); 72 virtual float SAL_CALL CentimetersToPoints( float _Centimeters ) throw (css::uno::RuntimeException); 73 // XMultiServiceFactory 74 virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames( ) throw (css::uno::RuntimeException); 75 76 // XHelperInterface 77 virtual rtl::OUString& getServiceImplName(); 78 virtual css::uno::Sequence<rtl::OUString> getServiceNames(); 79 }; 80 #endif /* SW_VBA_GLOBALS_HXX */ 81