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 #include <sfx2/app.hxx> 28 #include <svtools/helpopt.hxx> 29 30 #include <ooo/vba/office/MsoAnimationType.hpp> 31 32 #include"vbaassistant.hxx" 33 34 35 using namespace com::sun::star; 36 using namespace ooo::vba; 37 38 using namespace ooo::vba::office::MsoAnimationType; 39 40 ScVbaAssistant::ScVbaAssistant( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext ): ScVbaAssistantImpl_BASE( xParent, xContext ) 41 { 42 m_bIsVisible = sal_False; 43 m_nPointsLeft = 795; 44 m_nPointsTop = 248; 45 m_sName = rtl::OUString::createFromAscii( "Clippit" ); 46 m_nAnimation = msoAnimationIdle; 47 } 48 49 ScVbaAssistant::~ScVbaAssistant() 50 { 51 } 52 53 sal_Bool SAL_CALL ScVbaAssistant::getVisible() throw (uno::RuntimeException) 54 { 55 return m_bIsVisible; 56 } 57 58 void SAL_CALL ScVbaAssistant::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException) 59 { 60 m_bIsVisible = bVisible; 61 } 62 63 sal_Bool SAL_CALL ScVbaAssistant::getOn() throw (uno::RuntimeException) 64 { 65 if( SvtHelpOptions().IsHelpAgentAutoStartMode() ) 66 return sal_True; 67 else 68 return sal_False; 69 } 70 71 void SAL_CALL ScVbaAssistant::setOn( sal_Bool bOn ) throw (uno::RuntimeException) 72 { 73 SvtHelpOptions().SetHelpAgentAutoStartMode( bOn ); 74 setVisible( bOn ); 75 } 76 77 78 ::sal_Int32 SAL_CALL 79 ScVbaAssistant::getTop() throw (css::uno::RuntimeException) 80 { 81 return m_nPointsTop; 82 } 83 void SAL_CALL 84 ScVbaAssistant::setTop( ::sal_Int32 _top ) throw (css::uno::RuntimeException) 85 { 86 m_nPointsTop = _top; 87 } 88 ::sal_Int32 SAL_CALL 89 ScVbaAssistant::getLeft() throw (css::uno::RuntimeException) 90 { 91 return m_nPointsLeft; 92 } 93 void SAL_CALL 94 ScVbaAssistant::setLeft( ::sal_Int32 _left ) throw (css::uno::RuntimeException) 95 { 96 m_nPointsLeft = _left; 97 } 98 ::sal_Int32 SAL_CALL 99 ScVbaAssistant::getAnimation() throw (css::uno::RuntimeException) 100 { 101 return m_nAnimation; 102 } 103 void SAL_CALL 104 ScVbaAssistant::setAnimation( ::sal_Int32 _animation ) throw (css::uno::RuntimeException) 105 { 106 m_nAnimation = _animation; 107 } 108 109 ::rtl::OUString SAL_CALL 110 ScVbaAssistant::Name( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) 111 { 112 return m_sName; 113 } 114 115 rtl::OUString& 116 ScVbaAssistant::getServiceImplName() 117 { 118 static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaAssistant") ); 119 return sImplName; 120 } 121 122 uno::Sequence< rtl::OUString > 123 ScVbaAssistant::getServiceNames() 124 { 125 static uno::Sequence< rtl::OUString > aServiceNames; 126 if ( aServiceNames.getLength() == 0 ) 127 { 128 aServiceNames.realloc( 1 ); 129 aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.Assistant" ) ); 130 } 131 return aServiceNames; 132 } 133