1*ac9096f4SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*ac9096f4SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*ac9096f4SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*ac9096f4SAndrew Rist  * distributed with this work for additional information
6*ac9096f4SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*ac9096f4SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*ac9096f4SAndrew Rist  * "License"); you may not use this file except in compliance
9*ac9096f4SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*ac9096f4SAndrew Rist  *
11*ac9096f4SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*ac9096f4SAndrew Rist  *
13*ac9096f4SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*ac9096f4SAndrew Rist  * software distributed under the License is distributed on an
15*ac9096f4SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ac9096f4SAndrew Rist  * KIND, either express or implied.  See the License for the
17*ac9096f4SAndrew Rist  * specific language governing permissions and limitations
18*ac9096f4SAndrew Rist  * under the License.
19*ac9096f4SAndrew Rist  *
20*ac9096f4SAndrew Rist  *************************************************************/
21*ac9096f4SAndrew Rist 
22*ac9096f4SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_ucbhelper.hxx"
26cdf0e10cSrcweir #include <com/sun/star/ucb/NameClashResolveRequest.hpp>
27cdf0e10cSrcweir #include <ucbhelper/simplenameclashresolverequest.hxx>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir using namespace com::sun::star;
30cdf0e10cSrcweir using namespace ucbhelper;
31cdf0e10cSrcweir 
32cdf0e10cSrcweir //=========================================================================
SimpleNameClashResolveRequest(const rtl::OUString & rTargetFolderURL,const rtl::OUString & rClashingName,const rtl::OUString & rProposedNewName,sal_Bool bSupportsOverwriteData)33cdf0e10cSrcweir SimpleNameClashResolveRequest::SimpleNameClashResolveRequest(
34cdf0e10cSrcweir                                     const rtl::OUString & rTargetFolderURL,
35cdf0e10cSrcweir                                     const rtl::OUString & rClashingName,
36cdf0e10cSrcweir                                     const rtl::OUString & rProposedNewName,
37cdf0e10cSrcweir                                     sal_Bool bSupportsOverwriteData )
38cdf0e10cSrcweir {
39cdf0e10cSrcweir     // Fill request...
40cdf0e10cSrcweir     ucb::NameClashResolveRequest aRequest;
41cdf0e10cSrcweir //    aRequest.Message        = // OUString
42cdf0e10cSrcweir //    aRequest.Context        = // XInterface
43cdf0e10cSrcweir     aRequest.Classification  = task::InteractionClassification_QUERY;
44cdf0e10cSrcweir     aRequest.TargetFolderURL = rTargetFolderURL;
45cdf0e10cSrcweir     aRequest.ClashingName    = rClashingName;
46cdf0e10cSrcweir     aRequest.ProposedNewName = rProposedNewName;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir     setRequest( uno::makeAny( aRequest ) );
49cdf0e10cSrcweir 
50cdf0e10cSrcweir     // Fill continuations...
51cdf0e10cSrcweir     m_xNameSupplier = new InteractionSupplyName( this );
52cdf0e10cSrcweir 
53cdf0e10cSrcweir     uno::Sequence< uno::Reference< task::XInteractionContinuation > >
54cdf0e10cSrcweir                             aContinuations( bSupportsOverwriteData ? 3 : 2 );
55cdf0e10cSrcweir     aContinuations[ 0 ] = new InteractionAbort( this );
56cdf0e10cSrcweir     aContinuations[ 1 ] = m_xNameSupplier.get();
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     if ( bSupportsOverwriteData )
59cdf0e10cSrcweir         aContinuations[ 2 ] = new InteractionReplaceExistingData( this );
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     setContinuations( aContinuations );
62cdf0e10cSrcweir }
63cdf0e10cSrcweir 
64