Bump for 3.6-28
[LibreOffice.git] / ucb / source / ucp / file / filinsreq.hxx
blob03c2ab758f58a660a3c94d231de76e46759e33e6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
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.
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).
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.
27 ************************************************************************/
30 #ifndef _FILINSREQ_HXX_
31 #define _FILINSREQ_HXX_
33 #include <cppuhelper/weak.hxx>
34 #include <ucbhelper/macros.hxx>
35 #include <rtl/ustring.hxx>
36 #include <com/sun/star/uno/XInterface.hpp>
37 #include <com/sun/star/lang/XTypeProvider.hpp>
38 #include <com/sun/star/task/XInteractionAbort.hpp>
39 #include <com/sun/star/ucb/XInteractionSupplyName.hpp>
40 #include <com/sun/star/task/XInteractionRequest.hpp>
43 namespace fileaccess {
46 class shell;
49 class XInteractionSupplyNameImpl
50 : public cppu::OWeakObject,
51 public com::sun::star::lang::XTypeProvider,
52 public com::sun::star::ucb::XInteractionSupplyName
54 public:
56 XInteractionSupplyNameImpl()
57 : m_bSelected(false)
61 virtual com::sun::star::uno::Any SAL_CALL
62 queryInterface(
63 const com::sun::star::uno::Type& rType )
64 throw( com::sun::star::uno::RuntimeException);
66 virtual void SAL_CALL
67 acquire(
68 void )
69 throw();
71 virtual void SAL_CALL
72 release(
73 void )
74 throw();
77 // XTypeProvider
79 XTYPEPROVIDER_DECL()
82 virtual void SAL_CALL select()
83 throw (::com::sun::star::uno::RuntimeException)
85 m_bSelected = true;
88 void SAL_CALL setName(const ::rtl::OUString& Name)
89 throw(::com::sun::star::uno::RuntimeException)
91 m_aNewName = Name;
94 rtl::OUString getName() const
96 return m_aNewName;
99 bool isSelected() const
101 return m_bSelected;
104 private:
106 bool m_bSelected;
107 rtl::OUString m_aNewName;
112 class XInteractionAbortImpl
113 : public cppu::OWeakObject,
114 public com::sun::star::lang::XTypeProvider,
115 public com::sun::star::task::XInteractionAbort
117 public:
119 XInteractionAbortImpl()
120 : m_bSelected(false)
124 virtual com::sun::star::uno::Any SAL_CALL
125 queryInterface(
126 const com::sun::star::uno::Type& rType )
127 throw( com::sun::star::uno::RuntimeException);
129 virtual void SAL_CALL
130 acquire(
131 void )
132 throw();
134 virtual void SAL_CALL
135 release(
136 void )
137 throw();
140 // XTypeProvider
142 XTYPEPROVIDER_DECL()
145 virtual void SAL_CALL select()
146 throw (::com::sun::star::uno::RuntimeException)
148 m_bSelected = true;
152 bool isSelected() const
154 return m_bSelected;
157 private:
159 bool m_bSelected;
164 class XInteractionRequestImpl
165 : public cppu::OWeakObject,
166 public com::sun::star::lang::XTypeProvider,
167 public com::sun::star::task::XInteractionRequest
169 public:
171 XInteractionRequestImpl(
172 const rtl::OUString& aClashingName,
173 const com::sun::star::uno::Reference<
174 com::sun::star::uno::XInterface>& xOrigin,
175 shell* pShell,
176 sal_Int32 CommandId);
178 virtual com::sun::star::uno::Any SAL_CALL
179 queryInterface(
180 const com::sun::star::uno::Type& rType )
181 throw( com::sun::star::uno::RuntimeException);
183 virtual void SAL_CALL
184 acquire(
185 void )
186 throw();
188 virtual void SAL_CALL
189 release(
190 void )
191 throw();
194 // XTypeProvider
196 XTYPEPROVIDER_DECL()
198 ::com::sun::star::uno::Any SAL_CALL getRequest( )
199 throw (::com::sun::star::uno::RuntimeException);
201 com::sun::star::uno::Sequence<
202 com::sun::star::uno::Reference<
203 com::sun::star::task::XInteractionContinuation > > SAL_CALL
204 getContinuations( )
205 throw (::com::sun::star::uno::RuntimeException)
207 return m_aSeq;
210 bool aborted() const
212 return p2->isSelected();
215 rtl::OUString newName() const
217 if( p1->isSelected() )
218 return p1->getName();
219 else
220 return rtl::OUString();
223 private:
225 XInteractionSupplyNameImpl* p1;
226 XInteractionAbortImpl* p2;
227 sal_Int32 m_nErrorCode,m_nMinorError;
229 com::sun::star::uno::Sequence<
230 com::sun::star::uno::Reference<
231 com::sun::star::task::XInteractionContinuation > > m_aSeq;
233 rtl::OUString m_aClashingName;
234 com::sun::star::uno::Reference<
235 com::sun::star::uno::XInterface> m_xOrigin;
241 #endif
243 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */