1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _UCBHELPER_SIMPLENAMECLASHRESOLVEREQUEST_HXX
25 #define _UCBHELPER_SIMPLENAMECLASHRESOLVEREQUEST_HXX
26 
27 #include <rtl/ref.hxx>
28 #include <ucbhelper/interactionrequest.hxx>
29 #include "ucbhelper/ucbhelperdllapi.h"
30 
31 namespace ucbhelper {
32 
33 /**
34   * This class implements a simple name clash resolve interaction request.
35   * Instances can be passed directly to XInteractionHandler::handle(...). Each
36   * instance contains a NameClashResolveRequest and two interaction
37   * continuations: "Abort" and "SupplyName". Another continuation
38   * ("ReplaceExistingData") may be supplied optionally.
39   *
40   * @see com::sun::star::ucb::NameClashResolveRequest
41   * @see InteractionAbort
42   * @see InteractioneplaceExistingData
43   * @see InteractionSupplyName
44   */
45 class UCBHELPER_DLLPUBLIC SimpleNameClashResolveRequest : public ucbhelper::InteractionRequest
46 {
47     rtl::Reference< InteractionSupplyName > m_xNameSupplier;
48 
49 public:
50     /**
51       * Constructor.
52       *
53       * @param rTargetFolderURL contains the URL of the folder that contains
54       *        the clashing resource.
55       * @param rClashingName contains the clashing name.
56       * @param rProposedNewName contains a proposal for the new name or is
57       *        empty.
58       * @param bSupportsOverwriteData indicates whether an
59       *        InteractionReplaceExistingData continuation shall be supplied
60       *        with the interaction request.
61       */
62     SimpleNameClashResolveRequest( const rtl::OUString & rTargetFolderURL,
63                                    const rtl::OUString & rClashingName,
64                                    const rtl::OUString & rProposedNewName,
65                                    sal_Bool bSupportsOverwriteData = sal_True );
66     /**
67       * This method returns the new name that was supplied by the interaction
68       * handler.
69       *
70       * @return the new name, if supplied.
71       */
getNewName() const72     const rtl::OUString getNewName() const
73     { return m_xNameSupplier->getName(); }
74 
75 };
76 
77 } // namespace ucbhelper
78 
79 #endif /* !_UCBHELPER_SIMPLENAMECLASHRESOLVEREQUEST_HXX */
80