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 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_basic.hxx"
26 #include "basic/modsizeexceeded.hxx"
27 
28 #include <comphelper/interaction.hxx>
29 #include <com/sun/star/script/ModuleSizeExceededRequest.hpp>
30 
31 using namespace com::sun::star;
32 using namespace cppu;
33 using namespace rtl;
34 using namespace osl;
35 
ModuleSizeExceeded(const uno::Sequence<::rtl::OUString> & sModules)36 ModuleSizeExceeded::ModuleSizeExceeded( const uno::Sequence< ::rtl::OUString >& sModules )
37 {
38 	script::ModuleSizeExceededRequest aReq;
39 	aReq.Names = sModules;
40 
41 	m_aRequest <<= aReq;
42 
43     m_xAbort.set( uno::Reference< task::XInteractionAbort >(new comphelper::OInteractionAbort), uno::UNO_QUERY );
44     m_xApprove.set( uno::Reference< task::XInteractionApprove >(new comphelper::OInteractionApprove ), uno::UNO_QUERY );
45 	m_lContinuations.realloc( 2 );
46 	m_lContinuations[0] =  m_xApprove;
47 	m_lContinuations[1] = m_xAbort;
48 }
49 
50 sal_Bool
isAbort() const51 ModuleSizeExceeded::isAbort() const
52 {
53     comphelper::OInteractionAbort* pBase = static_cast< comphelper::OInteractionAbort* >( m_xAbort.get() );
54     return pBase->wasSelected();
55 }
56 
57 sal_Bool
isApprove() const58 ModuleSizeExceeded::isApprove() const
59 {
60     comphelper::OInteractionApprove* pBase = static_cast< comphelper::OInteractionApprove* >( m_xApprove.get() );
61     return pBase->wasSelected();
62 }
63 
64 
65