Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / ucb / source / ucp / ftp / ftpintreq.cxx
blob966e332a146a0c9cdc0083b101c9bb96d94bd98b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <com/sun/star/ucb/UnsupportedNameClashException.hpp>
22 #include <com/sun/star/ucb/NameClash.hpp>
23 #include "ftpintreq.hxx"
25 using namespace cppu;
26 using namespace com::sun::star;
27 using namespace com::sun::star::uno;
28 using namespace com::sun::star::lang;
29 using namespace com::sun::star::ucb;
30 using namespace com::sun::star::task;
31 using namespace ftp;
34 XInteractionApproveImpl::XInteractionApproveImpl()
35 : m_bSelected(false)
40 void SAL_CALL
41 XInteractionApproveImpl::acquire( void )
42 throw()
44 OWeakObject::acquire();
48 void SAL_CALL
49 XInteractionApproveImpl::release( void )
50 throw()
52 OWeakObject::release();
57 Any SAL_CALL
58 XInteractionApproveImpl::queryInterface( const Type& rType )
59 throw( RuntimeException )
61 Any aRet = cppu::queryInterface(
62 rType,
63 (static_cast< lang::XTypeProvider* >(this)),
64 (static_cast< XInteractionApprove* >(this)) );
65 return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
69 //////////////////////////////////////////////////////////////////////////////
70 // XTypeProvider
71 //////////////////////////////////////////////////////////////////////////////
73 XTYPEPROVIDER_IMPL_2( XInteractionApproveImpl,
74 XTypeProvider,
75 XInteractionApprove )
78 void SAL_CALL XInteractionApproveImpl::select()
79 throw (RuntimeException)
81 m_bSelected = true;
85 bool XInteractionApproveImpl::isSelected() const
87 return m_bSelected;
91 // XInteractionDisapproveImpl
93 XInteractionDisapproveImpl::XInteractionDisapproveImpl()
94 : m_bSelected(false)
99 void SAL_CALL
100 XInteractionDisapproveImpl::acquire( void )
101 throw()
103 OWeakObject::acquire();
107 void SAL_CALL
108 XInteractionDisapproveImpl::release( void )
109 throw()
111 OWeakObject::release();
116 Any SAL_CALL
117 XInteractionDisapproveImpl::queryInterface( const Type& rType )
118 throw( RuntimeException )
120 Any aRet = cppu::queryInterface(
121 rType,
122 (static_cast< lang::XTypeProvider* >(this)),
123 (static_cast< XInteractionDisapprove* >(this)) );
124 return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
128 //////////////////////////////////////////////////////////////////////////////
129 // XTypeProvider
130 //////////////////////////////////////////////////////////////////////////////
132 XTYPEPROVIDER_IMPL_2( XInteractionDisapproveImpl,
133 XTypeProvider,
134 XInteractionDisapprove )
137 void SAL_CALL XInteractionDisapproveImpl::select()
138 throw (RuntimeException)
141 m_bSelected = true;
145 // XInteractionRequestImpl
147 XInteractionRequestImpl::XInteractionRequestImpl(const rtl::OUString& aName)
148 : p1( new XInteractionApproveImpl ),
149 p2( new XInteractionDisapproveImpl ),
150 m_aName(aName),
151 m_aSeq( 2 )
153 m_aSeq[0] = Reference<XInteractionContinuation>(p1);
154 m_aSeq[1] = Reference<XInteractionContinuation>(p2);
158 void SAL_CALL
159 XInteractionRequestImpl::acquire( void )
160 throw()
162 OWeakObject::acquire();
167 void SAL_CALL
168 XInteractionRequestImpl::release( void )
169 throw()
171 OWeakObject::release();
176 Any SAL_CALL
177 XInteractionRequestImpl::queryInterface( const Type& rType )
178 throw( RuntimeException )
180 Any aRet = cppu::queryInterface(
181 rType,
182 (static_cast< lang::XTypeProvider* >(this)),
183 (static_cast< XInteractionRequest* >(this)) );
184 return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
188 //////////////////////////////////////////////////////////////////////////////
189 // XTypeProvider
190 /////////////////////////////////////////////////////////////////////////////
192 XTYPEPROVIDER_IMPL_2( XInteractionRequestImpl,
193 XTypeProvider,
194 XInteractionRequest )
197 Any SAL_CALL XInteractionRequestImpl::getRequest( )
198 throw (RuntimeException)
200 Any aAny;
201 UnsupportedNameClashException excep;
202 excep.NameClash = NameClash::ERROR;
203 aAny <<= excep;
204 return aAny;
208 Sequence<Reference<XInteractionContinuation > > SAL_CALL
209 XInteractionRequestImpl::getContinuations( )
210 throw (RuntimeException)
212 return m_aSeq;
216 bool XInteractionRequestImpl::approved() const
218 return p1->isSelected();
221 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */