xref: /trunk/main/sc/source/ui/vba/vbaassistant.cxx (revision b3f79822)
1*b3f79822SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*b3f79822SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*b3f79822SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*b3f79822SAndrew Rist  * distributed with this work for additional information
6*b3f79822SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*b3f79822SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*b3f79822SAndrew Rist  * "License"); you may not use this file except in compliance
9*b3f79822SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*b3f79822SAndrew Rist  *
11*b3f79822SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*b3f79822SAndrew Rist  *
13*b3f79822SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*b3f79822SAndrew Rist  * software distributed under the License is distributed on an
15*b3f79822SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b3f79822SAndrew Rist  * KIND, either express or implied.  See the License for the
17*b3f79822SAndrew Rist  * specific language governing permissions and limitations
18*b3f79822SAndrew Rist  * under the License.
19*b3f79822SAndrew Rist  *
20*b3f79822SAndrew Rist  *************************************************************/
21*b3f79822SAndrew Rist 
22*b3f79822SAndrew Rist 
23cdf0e10cSrcweir #include <sfx2/app.hxx>
24cdf0e10cSrcweir #include <svtools/helpopt.hxx>
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <ooo/vba/office/MsoAnimationType.hpp>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include"vbaassistant.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir 
31cdf0e10cSrcweir using namespace com::sun::star;
32cdf0e10cSrcweir using namespace ooo::vba;
33cdf0e10cSrcweir 
34cdf0e10cSrcweir using namespace ooo::vba::office::MsoAnimationType;
35cdf0e10cSrcweir 
ScVbaAssistant(const uno::Reference<XHelperInterface> xParent,const uno::Reference<uno::XComponentContext> xContext)36cdf0e10cSrcweir ScVbaAssistant::ScVbaAssistant( const uno::Reference< XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext ): ScVbaAssistantImpl_BASE( xParent, xContext )
37cdf0e10cSrcweir {
38cdf0e10cSrcweir     m_bIsVisible = sal_False;
39cdf0e10cSrcweir     m_nPointsLeft = 795;
40cdf0e10cSrcweir     m_nPointsTop = 248;
41cdf0e10cSrcweir     m_sName = rtl::OUString::createFromAscii( "Clippit" );
42cdf0e10cSrcweir     m_nAnimation = msoAnimationIdle;
43cdf0e10cSrcweir }
44cdf0e10cSrcweir 
~ScVbaAssistant()45cdf0e10cSrcweir ScVbaAssistant::~ScVbaAssistant()
46cdf0e10cSrcweir {
47cdf0e10cSrcweir }
48cdf0e10cSrcweir 
getVisible()49cdf0e10cSrcweir sal_Bool SAL_CALL ScVbaAssistant::getVisible() throw (uno::RuntimeException)
50cdf0e10cSrcweir {
51cdf0e10cSrcweir     return m_bIsVisible;
52cdf0e10cSrcweir }
53cdf0e10cSrcweir 
setVisible(sal_Bool bVisible)54cdf0e10cSrcweir void SAL_CALL ScVbaAssistant::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException)
55cdf0e10cSrcweir {
56cdf0e10cSrcweir     m_bIsVisible = bVisible;
57cdf0e10cSrcweir }
58cdf0e10cSrcweir 
getOn()59cdf0e10cSrcweir sal_Bool SAL_CALL ScVbaAssistant::getOn() throw (uno::RuntimeException)
60cdf0e10cSrcweir {
61cdf0e10cSrcweir     if( SvtHelpOptions().IsHelpAgentAutoStartMode() )
62cdf0e10cSrcweir         return sal_True;
63cdf0e10cSrcweir     else
64cdf0e10cSrcweir         return sal_False;
65cdf0e10cSrcweir }
66cdf0e10cSrcweir 
setOn(sal_Bool bOn)67cdf0e10cSrcweir void SAL_CALL ScVbaAssistant::setOn( sal_Bool bOn ) throw (uno::RuntimeException)
68cdf0e10cSrcweir {
69cdf0e10cSrcweir     SvtHelpOptions().SetHelpAgentAutoStartMode( bOn );
70cdf0e10cSrcweir     setVisible( bOn );
71cdf0e10cSrcweir }
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 
74cdf0e10cSrcweir ::sal_Int32 SAL_CALL
getTop()75cdf0e10cSrcweir ScVbaAssistant::getTop() throw (css::uno::RuntimeException)
76cdf0e10cSrcweir {
77cdf0e10cSrcweir     return m_nPointsTop;
78cdf0e10cSrcweir }
79cdf0e10cSrcweir void SAL_CALL
setTop(::sal_Int32 _top)80cdf0e10cSrcweir ScVbaAssistant::setTop( ::sal_Int32 _top ) throw (css::uno::RuntimeException)
81cdf0e10cSrcweir {
82cdf0e10cSrcweir     m_nPointsTop = _top;
83cdf0e10cSrcweir }
84cdf0e10cSrcweir ::sal_Int32 SAL_CALL
getLeft()85cdf0e10cSrcweir ScVbaAssistant::getLeft() throw (css::uno::RuntimeException)
86cdf0e10cSrcweir {
87cdf0e10cSrcweir     return m_nPointsLeft;
88cdf0e10cSrcweir }
89cdf0e10cSrcweir void SAL_CALL
setLeft(::sal_Int32 _left)90cdf0e10cSrcweir ScVbaAssistant::setLeft( ::sal_Int32 _left ) throw (css::uno::RuntimeException)
91cdf0e10cSrcweir {
92cdf0e10cSrcweir     m_nPointsLeft = _left;
93cdf0e10cSrcweir }
94cdf0e10cSrcweir ::sal_Int32 SAL_CALL
getAnimation()95cdf0e10cSrcweir ScVbaAssistant::getAnimation() throw (css::uno::RuntimeException)
96cdf0e10cSrcweir {
97cdf0e10cSrcweir     return m_nAnimation;
98cdf0e10cSrcweir }
99cdf0e10cSrcweir void SAL_CALL
setAnimation(::sal_Int32 _animation)100cdf0e10cSrcweir ScVbaAssistant::setAnimation( ::sal_Int32 _animation ) throw (css::uno::RuntimeException)
101cdf0e10cSrcweir {
102cdf0e10cSrcweir     m_nAnimation = _animation;
103cdf0e10cSrcweir }
104cdf0e10cSrcweir 
105cdf0e10cSrcweir ::rtl::OUString SAL_CALL
Name()106cdf0e10cSrcweir ScVbaAssistant::Name(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException)
107cdf0e10cSrcweir {
108cdf0e10cSrcweir     return m_sName;
109cdf0e10cSrcweir }
110cdf0e10cSrcweir 
111cdf0e10cSrcweir rtl::OUString&
getServiceImplName()112cdf0e10cSrcweir ScVbaAssistant::getServiceImplName()
113cdf0e10cSrcweir {
114cdf0e10cSrcweir 	static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaAssistant") );
115cdf0e10cSrcweir 	return sImplName;
116cdf0e10cSrcweir }
117cdf0e10cSrcweir 
118cdf0e10cSrcweir uno::Sequence< rtl::OUString >
getServiceNames()119cdf0e10cSrcweir ScVbaAssistant::getServiceNames()
120cdf0e10cSrcweir {
121cdf0e10cSrcweir 	static uno::Sequence< rtl::OUString > aServiceNames;
122cdf0e10cSrcweir 	if ( aServiceNames.getLength() == 0 )
123cdf0e10cSrcweir 	{
124cdf0e10cSrcweir 		aServiceNames.realloc( 1 );
125cdf0e10cSrcweir 		aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.Assistant" ) );
126cdf0e10cSrcweir 	}
127cdf0e10cSrcweir 	return aServiceNames;
128cdf0e10cSrcweir }
129