xref: /aoo41x/main/ucb/source/ucp/ftp/ftpintreq.cxx (revision 2f86921c)
1*2f86921cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2f86921cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2f86921cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2f86921cSAndrew Rist  * distributed with this work for additional information
6*2f86921cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2f86921cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2f86921cSAndrew Rist  * "License"); you may not use this file except in compliance
9*2f86921cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*2f86921cSAndrew Rist  *
11*2f86921cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*2f86921cSAndrew Rist  *
13*2f86921cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2f86921cSAndrew Rist  * software distributed under the License is distributed on an
15*2f86921cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2f86921cSAndrew Rist  * KIND, either express or implied.  See the License for the
17*2f86921cSAndrew Rist  * specific language governing permissions and limitations
18*2f86921cSAndrew Rist  * under the License.
19*2f86921cSAndrew Rist  *
20*2f86921cSAndrew Rist  *************************************************************/
21*2f86921cSAndrew Rist 
22*2f86921cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir 
25cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
26cdf0e10cSrcweir #include "precompiled_ucb.hxx"
27cdf0e10cSrcweir #include <com/sun/star/ucb/UnsupportedNameClashException.hpp>
28cdf0e10cSrcweir #include <com/sun/star/ucb/NameClash.hpp>
29cdf0e10cSrcweir #include "ftpintreq.hxx"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir using namespace cppu;
32cdf0e10cSrcweir using namespace com::sun::star;
33cdf0e10cSrcweir using namespace com::sun::star::uno;
34cdf0e10cSrcweir using namespace com::sun::star::lang;
35cdf0e10cSrcweir using namespace com::sun::star::ucb;
36cdf0e10cSrcweir using namespace com::sun::star::task;
37cdf0e10cSrcweir using namespace ftp;
38cdf0e10cSrcweir 
39cdf0e10cSrcweir 
XInteractionApproveImpl()40cdf0e10cSrcweir XInteractionApproveImpl::XInteractionApproveImpl()
41cdf0e10cSrcweir     : m_bSelected(false)
42cdf0e10cSrcweir {
43cdf0e10cSrcweir }
44cdf0e10cSrcweir 
45cdf0e10cSrcweir 
46cdf0e10cSrcweir void SAL_CALL
acquire(void)47cdf0e10cSrcweir XInteractionApproveImpl::acquire( void )
48cdf0e10cSrcweir     throw()
49cdf0e10cSrcweir {
50cdf0e10cSrcweir     OWeakObject::acquire();
51cdf0e10cSrcweir }
52cdf0e10cSrcweir 
53cdf0e10cSrcweir 
54cdf0e10cSrcweir void SAL_CALL
release(void)55cdf0e10cSrcweir XInteractionApproveImpl::release( void )
56cdf0e10cSrcweir     throw()
57cdf0e10cSrcweir {
58cdf0e10cSrcweir     OWeakObject::release();
59cdf0e10cSrcweir }
60cdf0e10cSrcweir 
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 
63cdf0e10cSrcweir Any SAL_CALL
queryInterface(const Type & rType)64cdf0e10cSrcweir XInteractionApproveImpl::queryInterface( const Type& rType )
65cdf0e10cSrcweir     throw( RuntimeException )
66cdf0e10cSrcweir {
67cdf0e10cSrcweir     Any aRet = cppu::queryInterface(
68cdf0e10cSrcweir         rType,
69cdf0e10cSrcweir         SAL_STATIC_CAST( lang::XTypeProvider*, this ),
70cdf0e10cSrcweir         SAL_STATIC_CAST( XInteractionApprove*,this) );
71cdf0e10cSrcweir     return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
72cdf0e10cSrcweir }
73cdf0e10cSrcweir 
74cdf0e10cSrcweir 
75cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
76cdf0e10cSrcweir //  XTypeProvider
77cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
78cdf0e10cSrcweir 
XTYPEPROVIDER_IMPL_2(XInteractionApproveImpl,XTypeProvider,XInteractionApprove)79cdf0e10cSrcweir XTYPEPROVIDER_IMPL_2( XInteractionApproveImpl,
80cdf0e10cSrcweir                       XTypeProvider,
81cdf0e10cSrcweir                       XInteractionApprove )
82cdf0e10cSrcweir 
83cdf0e10cSrcweir 
84cdf0e10cSrcweir void SAL_CALL XInteractionApproveImpl::select()
85cdf0e10cSrcweir     throw (RuntimeException)
86cdf0e10cSrcweir {
87cdf0e10cSrcweir     m_bSelected = true;
88cdf0e10cSrcweir }
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 
isSelected() const91cdf0e10cSrcweir bool XInteractionApproveImpl::isSelected() const
92cdf0e10cSrcweir {
93cdf0e10cSrcweir     return m_bSelected;
94cdf0e10cSrcweir }
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 
97cdf0e10cSrcweir // XInteractionDisapproveImpl
98cdf0e10cSrcweir 
XInteractionDisapproveImpl()99cdf0e10cSrcweir XInteractionDisapproveImpl::XInteractionDisapproveImpl()
100cdf0e10cSrcweir     : m_bSelected(false)
101cdf0e10cSrcweir {
102cdf0e10cSrcweir }
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 
105cdf0e10cSrcweir void SAL_CALL
acquire(void)106cdf0e10cSrcweir XInteractionDisapproveImpl::acquire( void )
107cdf0e10cSrcweir     throw()
108cdf0e10cSrcweir {
109cdf0e10cSrcweir     OWeakObject::acquire();
110cdf0e10cSrcweir }
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 
113cdf0e10cSrcweir void SAL_CALL
release(void)114cdf0e10cSrcweir XInteractionDisapproveImpl::release( void )
115cdf0e10cSrcweir     throw()
116cdf0e10cSrcweir {
117cdf0e10cSrcweir     OWeakObject::release();
118cdf0e10cSrcweir }
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 
121cdf0e10cSrcweir 
122cdf0e10cSrcweir Any SAL_CALL
queryInterface(const Type & rType)123cdf0e10cSrcweir XInteractionDisapproveImpl::queryInterface( const Type& rType )
124cdf0e10cSrcweir     throw( RuntimeException )
125cdf0e10cSrcweir {
126cdf0e10cSrcweir     Any aRet = cppu::queryInterface(
127cdf0e10cSrcweir         rType,
128cdf0e10cSrcweir         SAL_STATIC_CAST( lang::XTypeProvider*, this ),
129cdf0e10cSrcweir         SAL_STATIC_CAST( XInteractionDisapprove*,this) );
130cdf0e10cSrcweir     return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
131cdf0e10cSrcweir }
132cdf0e10cSrcweir 
133cdf0e10cSrcweir 
134cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
135cdf0e10cSrcweir //  XTypeProvider
136cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
137cdf0e10cSrcweir 
XTYPEPROVIDER_IMPL_2(XInteractionDisapproveImpl,XTypeProvider,XInteractionDisapprove)138cdf0e10cSrcweir XTYPEPROVIDER_IMPL_2( XInteractionDisapproveImpl,
139cdf0e10cSrcweir                       XTypeProvider,
140cdf0e10cSrcweir                       XInteractionDisapprove )
141cdf0e10cSrcweir 
142cdf0e10cSrcweir 
143cdf0e10cSrcweir void SAL_CALL XInteractionDisapproveImpl::select()
144cdf0e10cSrcweir     throw (RuntimeException)
145cdf0e10cSrcweir 
146cdf0e10cSrcweir {
147cdf0e10cSrcweir     m_bSelected = true;
148cdf0e10cSrcweir }
149cdf0e10cSrcweir 
150cdf0e10cSrcweir 
151cdf0e10cSrcweir // XInteractionRequestImpl
152cdf0e10cSrcweir 
XInteractionRequestImpl(const rtl::OUString & aName)153cdf0e10cSrcweir XInteractionRequestImpl::XInteractionRequestImpl(const rtl::OUString& aName)
154cdf0e10cSrcweir     : p1( new XInteractionApproveImpl ),
155cdf0e10cSrcweir       p2( new XInteractionDisapproveImpl ),
156cdf0e10cSrcweir       m_aName(aName),
157cdf0e10cSrcweir       m_aSeq( 2 )
158cdf0e10cSrcweir {
159cdf0e10cSrcweir     m_aSeq[0] = Reference<XInteractionContinuation>(p1);
160cdf0e10cSrcweir     m_aSeq[1] = Reference<XInteractionContinuation>(p2);
161cdf0e10cSrcweir }
162cdf0e10cSrcweir 
163cdf0e10cSrcweir 
164cdf0e10cSrcweir void SAL_CALL
acquire(void)165cdf0e10cSrcweir XInteractionRequestImpl::acquire( void )
166cdf0e10cSrcweir     throw()
167cdf0e10cSrcweir {
168cdf0e10cSrcweir     OWeakObject::acquire();
169cdf0e10cSrcweir }
170cdf0e10cSrcweir 
171cdf0e10cSrcweir 
172cdf0e10cSrcweir 
173cdf0e10cSrcweir void SAL_CALL
release(void)174cdf0e10cSrcweir XInteractionRequestImpl::release( void )
175cdf0e10cSrcweir     throw()
176cdf0e10cSrcweir {
177cdf0e10cSrcweir     OWeakObject::release();
178cdf0e10cSrcweir }
179cdf0e10cSrcweir 
180cdf0e10cSrcweir 
181cdf0e10cSrcweir 
182cdf0e10cSrcweir Any SAL_CALL
queryInterface(const Type & rType)183cdf0e10cSrcweir XInteractionRequestImpl::queryInterface( const Type& rType )
184cdf0e10cSrcweir     throw( RuntimeException )
185cdf0e10cSrcweir {
186cdf0e10cSrcweir     Any aRet = cppu::queryInterface(
187cdf0e10cSrcweir         rType,
188cdf0e10cSrcweir         SAL_STATIC_CAST( lang::XTypeProvider*, this ),
189cdf0e10cSrcweir         SAL_STATIC_CAST( XInteractionRequest*,this) );
190cdf0e10cSrcweir     return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
191cdf0e10cSrcweir }
192cdf0e10cSrcweir 
193cdf0e10cSrcweir 
194cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////
195cdf0e10cSrcweir //  XTypeProvider
196cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////////////
197cdf0e10cSrcweir 
XTYPEPROVIDER_IMPL_2(XInteractionRequestImpl,XTypeProvider,XInteractionRequest)198cdf0e10cSrcweir XTYPEPROVIDER_IMPL_2( XInteractionRequestImpl,
199cdf0e10cSrcweir                       XTypeProvider,
200cdf0e10cSrcweir                       XInteractionRequest )
201cdf0e10cSrcweir 
202cdf0e10cSrcweir 
203cdf0e10cSrcweir Any SAL_CALL XInteractionRequestImpl::getRequest(  )
204cdf0e10cSrcweir     throw (RuntimeException)
205cdf0e10cSrcweir {
206cdf0e10cSrcweir     Any aAny;
207cdf0e10cSrcweir     UnsupportedNameClashException excep;
208cdf0e10cSrcweir     excep.NameClash = NameClash::ERROR;
209cdf0e10cSrcweir     aAny <<= excep;
210cdf0e10cSrcweir     return aAny;
211cdf0e10cSrcweir }
212cdf0e10cSrcweir 
213cdf0e10cSrcweir 
214cdf0e10cSrcweir Sequence<Reference<XInteractionContinuation > > SAL_CALL
getContinuations()215cdf0e10cSrcweir XInteractionRequestImpl::getContinuations(  )
216cdf0e10cSrcweir     throw (RuntimeException)
217cdf0e10cSrcweir {
218cdf0e10cSrcweir     return m_aSeq;
219cdf0e10cSrcweir }
220cdf0e10cSrcweir 
221cdf0e10cSrcweir 
approved() const222cdf0e10cSrcweir bool XInteractionRequestImpl::approved() const
223cdf0e10cSrcweir {
224cdf0e10cSrcweir     return p1->isSelected();
225cdf0e10cSrcweir }
226cdf0e10cSrcweir 
227