Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include <com/sun/star/ucb/UnsupportedNameClashException.hpp>
31 : : #include <com/sun/star/ucb/NameClash.hpp>
32 : : #include "ftpintreq.hxx"
33 : :
34 : : using namespace cppu;
35 : : using namespace com::sun::star;
36 : : using namespace com::sun::star::uno;
37 : : using namespace com::sun::star::lang;
38 : : using namespace com::sun::star::ucb;
39 : : using namespace com::sun::star::task;
40 : : using namespace ftp;
41 : :
42 : :
43 : 0 : XInteractionApproveImpl::XInteractionApproveImpl()
44 : 0 : : m_bSelected(false)
45 : : {
46 : 0 : }
47 : :
48 : :
49 : : void SAL_CALL
50 : 0 : XInteractionApproveImpl::acquire( void )
51 : : throw()
52 : : {
53 : 0 : OWeakObject::acquire();
54 : 0 : }
55 : :
56 : :
57 : : void SAL_CALL
58 : 0 : XInteractionApproveImpl::release( void )
59 : : throw()
60 : : {
61 : 0 : OWeakObject::release();
62 : 0 : }
63 : :
64 : :
65 : :
66 : : Any SAL_CALL
67 : 0 : XInteractionApproveImpl::queryInterface( const Type& rType )
68 : : throw( RuntimeException )
69 : : {
70 : : Any aRet = cppu::queryInterface(
71 : : rType,
72 : : (static_cast< lang::XTypeProvider* >(this)),
73 [ # # ]: 0 : (static_cast< XInteractionApprove* >(this)) );
74 [ # # ][ # # ]: 0 : return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
75 : : }
76 : :
77 : :
78 : : //////////////////////////////////////////////////////////////////////////////
79 : : // XTypeProvider
80 : : //////////////////////////////////////////////////////////////////////////////
81 : :
82 [ # # ][ # # ]: 0 : XTYPEPROVIDER_IMPL_2( XInteractionApproveImpl,
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
83 : : XTypeProvider,
84 : : XInteractionApprove )
85 : :
86 : :
87 : 0 : void SAL_CALL XInteractionApproveImpl::select()
88 : : throw (RuntimeException)
89 : : {
90 : 0 : m_bSelected = true;
91 : 0 : }
92 : :
93 : :
94 : 0 : bool XInteractionApproveImpl::isSelected() const
95 : : {
96 : 0 : return m_bSelected;
97 : : }
98 : :
99 : :
100 : : // XInteractionDisapproveImpl
101 : :
102 : 0 : XInteractionDisapproveImpl::XInteractionDisapproveImpl()
103 : 0 : : m_bSelected(false)
104 : : {
105 : 0 : }
106 : :
107 : :
108 : : void SAL_CALL
109 : 0 : XInteractionDisapproveImpl::acquire( void )
110 : : throw()
111 : : {
112 : 0 : OWeakObject::acquire();
113 : 0 : }
114 : :
115 : :
116 : : void SAL_CALL
117 : 0 : XInteractionDisapproveImpl::release( void )
118 : : throw()
119 : : {
120 : 0 : OWeakObject::release();
121 : 0 : }
122 : :
123 : :
124 : :
125 : : Any SAL_CALL
126 : 0 : XInteractionDisapproveImpl::queryInterface( const Type& rType )
127 : : throw( RuntimeException )
128 : : {
129 : : Any aRet = cppu::queryInterface(
130 : : rType,
131 : : (static_cast< lang::XTypeProvider* >(this)),
132 [ # # ]: 0 : (static_cast< XInteractionDisapprove* >(this)) );
133 [ # # ][ # # ]: 0 : return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
134 : : }
135 : :
136 : :
137 : : //////////////////////////////////////////////////////////////////////////////
138 : : // XTypeProvider
139 : : //////////////////////////////////////////////////////////////////////////////
140 : :
141 [ # # ][ # # ]: 0 : XTYPEPROVIDER_IMPL_2( XInteractionDisapproveImpl,
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
142 : : XTypeProvider,
143 : : XInteractionDisapprove )
144 : :
145 : :
146 : 0 : void SAL_CALL XInteractionDisapproveImpl::select()
147 : : throw (RuntimeException)
148 : :
149 : : {
150 : 0 : m_bSelected = true;
151 : 0 : }
152 : :
153 : :
154 : : // XInteractionRequestImpl
155 : :
156 : 0 : XInteractionRequestImpl::XInteractionRequestImpl(const rtl::OUString& aName)
157 [ # # ]: 0 : : p1( new XInteractionApproveImpl ),
158 [ # # ]: 0 : p2( new XInteractionDisapproveImpl ),
159 : : m_aName(aName),
160 [ # # ]: 0 : m_aSeq( 2 )
161 : : {
162 [ # # ][ # # ]: 0 : m_aSeq[0] = Reference<XInteractionContinuation>(p1);
[ # # ][ # # ]
163 [ # # ][ # # ]: 0 : m_aSeq[1] = Reference<XInteractionContinuation>(p2);
[ # # ][ # # ]
164 : 0 : }
165 : :
166 : :
167 : : void SAL_CALL
168 : 0 : XInteractionRequestImpl::acquire( void )
169 : : throw()
170 : : {
171 : 0 : OWeakObject::acquire();
172 : 0 : }
173 : :
174 : :
175 : :
176 : : void SAL_CALL
177 : 0 : XInteractionRequestImpl::release( void )
178 : : throw()
179 : : {
180 : 0 : OWeakObject::release();
181 : 0 : }
182 : :
183 : :
184 : :
185 : : Any SAL_CALL
186 : 0 : XInteractionRequestImpl::queryInterface( const Type& rType )
187 : : throw( RuntimeException )
188 : : {
189 : : Any aRet = cppu::queryInterface(
190 : : rType,
191 : : (static_cast< lang::XTypeProvider* >(this)),
192 [ # # ]: 0 : (static_cast< XInteractionRequest* >(this)) );
193 [ # # ][ # # ]: 0 : return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
194 : : }
195 : :
196 : :
197 : : //////////////////////////////////////////////////////////////////////////////
198 : : // XTypeProvider
199 : : /////////////////////////////////////////////////////////////////////////////
200 : :
201 [ # # ][ # # ]: 0 : XTYPEPROVIDER_IMPL_2( XInteractionRequestImpl,
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
202 : : XTypeProvider,
203 : : XInteractionRequest )
204 : :
205 : :
206 : 0 : Any SAL_CALL XInteractionRequestImpl::getRequest( )
207 : : throw (RuntimeException)
208 : : {
209 : 0 : Any aAny;
210 [ # # ]: 0 : UnsupportedNameClashException excep;
211 : 0 : excep.NameClash = NameClash::ERROR;
212 [ # # ]: 0 : aAny <<= excep;
213 [ # # ]: 0 : return aAny;
214 : : }
215 : :
216 : :
217 : : Sequence<Reference<XInteractionContinuation > > SAL_CALL
218 : 0 : XInteractionRequestImpl::getContinuations( )
219 : : throw (RuntimeException)
220 : : {
221 : 0 : return m_aSeq;
222 : : }
223 : :
224 : :
225 : 0 : bool XInteractionRequestImpl::approved() const
226 : : {
227 : 0 : return p1->isSelected();
228 : : }
229 : :
230 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|