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