Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / ucb / source / ucp / file / filinsreq.hxx
blobd73d59b84842577fe1ec3da00e208f41446e2389
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 #ifndef _FILINSREQ_HXX_
22 #define _FILINSREQ_HXX_
24 #include <cppuhelper/weak.hxx>
25 #include <ucbhelper/macros.hxx>
26 #include <rtl/ustring.hxx>
27 #include <com/sun/star/uno/XInterface.hpp>
28 #include <com/sun/star/lang/XTypeProvider.hpp>
29 #include <com/sun/star/task/XInteractionAbort.hpp>
30 #include <com/sun/star/ucb/XInteractionSupplyName.hpp>
31 #include <com/sun/star/task/XInteractionRequest.hpp>
34 namespace fileaccess {
37 class shell;
40 class XInteractionSupplyNameImpl
41 : public cppu::OWeakObject,
42 public com::sun::star::lang::XTypeProvider,
43 public com::sun::star::ucb::XInteractionSupplyName
45 public:
47 XInteractionSupplyNameImpl()
48 : m_bSelected(false)
52 virtual com::sun::star::uno::Any SAL_CALL
53 queryInterface(
54 const com::sun::star::uno::Type& rType )
55 throw( com::sun::star::uno::RuntimeException);
57 virtual void SAL_CALL
58 acquire(
59 void )
60 throw();
62 virtual void SAL_CALL
63 release(
64 void )
65 throw();
68 // XTypeProvider
70 XTYPEPROVIDER_DECL()
73 virtual void SAL_CALL select()
74 throw (::com::sun::star::uno::RuntimeException)
76 m_bSelected = true;
79 void SAL_CALL setName(const ::rtl::OUString& Name)
80 throw(::com::sun::star::uno::RuntimeException)
82 m_aNewName = Name;
85 rtl::OUString getName() const
87 return m_aNewName;
90 bool isSelected() const
92 return m_bSelected;
95 private:
97 bool m_bSelected;
98 rtl::OUString m_aNewName;
103 class XInteractionAbortImpl
104 : public cppu::OWeakObject,
105 public com::sun::star::lang::XTypeProvider,
106 public com::sun::star::task::XInteractionAbort
108 public:
110 XInteractionAbortImpl()
111 : m_bSelected(false)
115 virtual com::sun::star::uno::Any SAL_CALL
116 queryInterface(
117 const com::sun::star::uno::Type& rType )
118 throw( com::sun::star::uno::RuntimeException);
120 virtual void SAL_CALL
121 acquire(
122 void )
123 throw();
125 virtual void SAL_CALL
126 release(
127 void )
128 throw();
131 // XTypeProvider
133 XTYPEPROVIDER_DECL()
136 virtual void SAL_CALL select()
137 throw (::com::sun::star::uno::RuntimeException)
139 m_bSelected = true;
143 bool isSelected() const
145 return m_bSelected;
148 private:
150 bool m_bSelected;
155 class XInteractionRequestImpl
156 : public cppu::OWeakObject,
157 public com::sun::star::lang::XTypeProvider,
158 public com::sun::star::task::XInteractionRequest
160 public:
162 XInteractionRequestImpl(
163 const rtl::OUString& aClashingName,
164 const com::sun::star::uno::Reference<
165 com::sun::star::uno::XInterface>& xOrigin,
166 shell* pShell,
167 sal_Int32 CommandId);
169 virtual com::sun::star::uno::Any SAL_CALL
170 queryInterface(
171 const com::sun::star::uno::Type& rType )
172 throw( com::sun::star::uno::RuntimeException);
174 virtual void SAL_CALL
175 acquire(
176 void )
177 throw();
179 virtual void SAL_CALL
180 release(
181 void )
182 throw();
185 // XTypeProvider
187 XTYPEPROVIDER_DECL()
189 ::com::sun::star::uno::Any SAL_CALL getRequest( )
190 throw (::com::sun::star::uno::RuntimeException);
192 com::sun::star::uno::Sequence<
193 com::sun::star::uno::Reference<
194 com::sun::star::task::XInteractionContinuation > > SAL_CALL
195 getContinuations( )
196 throw (::com::sun::star::uno::RuntimeException)
198 return m_aSeq;
201 bool aborted() const
203 return p2->isSelected();
206 rtl::OUString newName() const
208 if( p1->isSelected() )
209 return p1->getName();
210 else
211 return rtl::OUString();
214 private:
216 XInteractionSupplyNameImpl* p1;
217 XInteractionAbortImpl* p2;
218 sal_Int32 m_nErrorCode,m_nMinorError;
220 com::sun::star::uno::Sequence<
221 com::sun::star::uno::Reference<
222 com::sun::star::task::XInteractionContinuation > > m_aSeq;
224 rtl::OUString m_aClashingName;
225 com::sun::star::uno::Reference<
226 com::sun::star::uno::XInterface> m_xOrigin;
232 #endif
234 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */