update dev300-m58
[ooovba.git] / ucb / source / ucp / file / filinsreq.hxx
blobb90f3053c2b7507d60b1f0538b56cfffb9b05b67
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: filinsreq.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #ifndef _FILINSREQ_HXX_
33 #define _FILINSREQ_HXX_
35 #include <cppuhelper/weak.hxx>
36 #include <ucbhelper/macros.hxx>
37 #include <rtl/ustring.hxx>
38 #include <com/sun/star/uno/XInterface.hpp>
39 #include <com/sun/star/lang/XTypeProvider.hpp>
40 #include <com/sun/star/task/XInteractionAbort.hpp>
41 #include <com/sun/star/ucb/XInteractionSupplyName.hpp>
42 #include <com/sun/star/task/XInteractionRequest.hpp>
45 namespace fileaccess {
48 class shell;
51 class XInteractionSupplyNameImpl
52 : public cppu::OWeakObject,
53 public com::sun::star::lang::XTypeProvider,
54 public com::sun::star::ucb::XInteractionSupplyName
56 public:
58 XInteractionSupplyNameImpl()
59 : m_bSelected(false)
63 virtual com::sun::star::uno::Any SAL_CALL
64 queryInterface(
65 const com::sun::star::uno::Type& rType )
66 throw( com::sun::star::uno::RuntimeException);
68 virtual void SAL_CALL
69 acquire(
70 void )
71 throw();
73 virtual void SAL_CALL
74 release(
75 void )
76 throw();
79 // XTypeProvider
81 XTYPEPROVIDER_DECL()
84 virtual void SAL_CALL select()
85 throw (::com::sun::star::uno::RuntimeException)
87 m_bSelected = true;
90 void SAL_CALL setName(const ::rtl::OUString& Name)
91 throw(::com::sun::star::uno::RuntimeException)
93 m_aNewName = Name;
96 rtl::OUString getName() const
98 return m_aNewName;
101 bool isSelected() const
103 return m_bSelected;
106 private:
108 bool m_bSelected;
109 rtl::OUString m_aNewName;
114 class XInteractionAbortImpl
115 : public cppu::OWeakObject,
116 public com::sun::star::lang::XTypeProvider,
117 public com::sun::star::task::XInteractionAbort
119 public:
121 XInteractionAbortImpl()
122 : m_bSelected(false)
126 virtual com::sun::star::uno::Any SAL_CALL
127 queryInterface(
128 const com::sun::star::uno::Type& rType )
129 throw( com::sun::star::uno::RuntimeException);
131 virtual void SAL_CALL
132 acquire(
133 void )
134 throw();
136 virtual void SAL_CALL
137 release(
138 void )
139 throw();
142 // XTypeProvider
144 XTYPEPROVIDER_DECL()
147 virtual void SAL_CALL select()
148 throw (::com::sun::star::uno::RuntimeException)
150 m_bSelected = true;
154 bool isSelected() const
156 return m_bSelected;
159 private:
161 bool m_bSelected;
166 class XInteractionRequestImpl
167 : public cppu::OWeakObject,
168 public com::sun::star::lang::XTypeProvider,
169 public com::sun::star::task::XInteractionRequest
171 public:
173 XInteractionRequestImpl(
174 const rtl::OUString& aClashingName,
175 const com::sun::star::uno::Reference<
176 com::sun::star::uno::XInterface>& xOrigin,
177 shell* pShell,
178 sal_Int32 CommandId);
180 virtual com::sun::star::uno::Any SAL_CALL
181 queryInterface(
182 const com::sun::star::uno::Type& rType )
183 throw( com::sun::star::uno::RuntimeException);
185 virtual void SAL_CALL
186 acquire(
187 void )
188 throw();
190 virtual void SAL_CALL
191 release(
192 void )
193 throw();
196 // XTypeProvider
198 XTYPEPROVIDER_DECL()
200 ::com::sun::star::uno::Any SAL_CALL getRequest( )
201 throw (::com::sun::star::uno::RuntimeException);
203 com::sun::star::uno::Sequence<
204 com::sun::star::uno::Reference<
205 com::sun::star::task::XInteractionContinuation > > SAL_CALL
206 getContinuations( )
207 throw (::com::sun::star::uno::RuntimeException)
209 return m_aSeq;
212 bool aborted() const
214 return p2->isSelected();
217 rtl::OUString newName() const
219 if( p1->isSelected() )
220 return p1->getName();
221 else
222 return rtl::OUString();
225 private:
227 XInteractionSupplyNameImpl* p1;
228 XInteractionAbortImpl* p2;
229 sal_Int32 m_nErrorCode,m_nMinorError;
231 com::sun::star::uno::Sequence<
232 com::sun::star::uno::Reference<
233 com::sun::star::task::XInteractionContinuation > > m_aSeq;
235 rtl::OUString m_aClashingName;
236 com::sun::star::uno::Reference<
237 com::sun::star::uno::XInterface> m_xOrigin;
243 #endif