Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / ucb / source / ucp / file / filinsreq.hxx
blob035b51a05ea8fa08f913c36dfaa6cee90b67f448
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 INCLUDED_UCB_SOURCE_UCP_FILE_FILINSREQ_HXX
22 #define INCLUDED_UCB_SOURCE_UCP_FILE_FILINSREQ_HXX
24 #include <rtl/ustring.hxx>
25 #include <com/sun/star/uno/XInterface.hpp>
26 #include <com/sun/star/task/XInteractionAbort.hpp>
27 #include <com/sun/star/ucb/XInteractionSupplyName.hpp>
28 #include <com/sun/star/task/XInteractionRequest.hpp>
29 #include <cppuhelper/implbase.hxx>
32 namespace fileaccess {
35 class TaskManager;
38 class XInteractionSupplyNameImpl : public cppu::WeakImplHelper<
39 css::ucb::XInteractionSupplyName >
41 public:
43 XInteractionSupplyNameImpl()
44 : m_bSelected(false)
48 virtual void SAL_CALL select() override
50 m_bSelected = true;
53 void SAL_CALL setName(const OUString& Name) override
55 m_aNewName = Name;
58 const OUString& getName() const
60 return m_aNewName;
63 bool isSelected() const
65 return m_bSelected;
68 private:
70 bool m_bSelected;
71 OUString m_aNewName;
75 class XInteractionAbortImpl : public cppu::WeakImplHelper<
76 css::task::XInteractionAbort >
78 public:
80 XInteractionAbortImpl()
81 : m_bSelected(false)
85 virtual void SAL_CALL select() override
87 m_bSelected = true;
91 bool isSelected() const
93 return m_bSelected;
96 private:
98 bool m_bSelected;
102 class XInteractionRequestImpl
104 public:
106 XInteractionRequestImpl(
107 const OUString& aClashingName,
108 const css::uno::Reference< css::uno::XInterface>& xOrigin,
109 TaskManager* pShell,
110 sal_Int32 CommandId);
112 bool aborted() const
114 return p2->isSelected();
117 OUString newName() const
119 if( p1->isSelected() )
120 return p1->getName();
121 else
122 return OUString();
125 css::uno::Reference<css::task::XInteractionRequest> const& getRequest() const
127 return m_xRequest;
130 private:
132 XInteractionSupplyNameImpl* const p1;
133 XInteractionAbortImpl* const p2;
135 css::uno::Reference<css::task::XInteractionRequest> m_xRequest;
137 css::uno::Reference< css::uno::XInterface> m_xOrigin;
143 #endif
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */