LibreOffice Module ucb (master)  1
filinsreq.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 
21 #ifndef INCLUDED_UCB_SOURCE_UCP_FILE_FILINSREQ_HXX
22 #define INCLUDED_UCB_SOURCE_UCP_FILE_FILINSREQ_HXX
23 
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>
30 
31 
32 namespace fileaccess {
33 
34 
35  class TaskManager;
36 
37 
38 class XInteractionSupplyNameImpl : public cppu::WeakImplHelper<
39  css::ucb::XInteractionSupplyName >
40  {
41  public:
42 
44  : m_bSelected(false)
45  {
46  }
47 
48  virtual void SAL_CALL select() override
49  {
50  m_bSelected = true;
51  }
52 
53  void SAL_CALL setName(const OUString& Name) override
54  {
55  m_aNewName = Name;
56  }
57 
58  const OUString& getName() const
59  {
60  return m_aNewName;
61  }
62 
63  bool isSelected() const
64  {
65  return m_bSelected;
66  }
67 
68  private:
69 
71  OUString m_aNewName;
72  };
73 
74 
75  class XInteractionAbortImpl : public cppu::WeakImplHelper<
76  css::task::XInteractionAbort >
77  {
78  public:
79 
81  : m_bSelected(false)
82  {
83  }
84 
85  virtual void SAL_CALL select() override
86  {
87  m_bSelected = true;
88  }
89 
90 
91  bool isSelected() const
92  {
93  return m_bSelected;
94  }
95 
96  private:
97 
99  };
100 
101 
103  {
104  public:
105 
107  const OUString& aClashingName,
108  const css::uno::Reference< css::uno::XInterface>& xOrigin,
109  TaskManager* pShell,
110  sal_Int32 CommandId);
111 
112  bool aborted() const
113  {
114  return p2->isSelected();
115  }
116 
117  OUString newName() const
118  {
119  if( p1->isSelected() )
120  return p1->getName();
121  else
122  return OUString();
123  }
124 
125  css::uno::Reference<css::task::XInteractionRequest> const& getRequest() const
126  {
127  return m_xRequest;
128  }
129 
130  private:
131 
134 
135  css::uno::Reference<css::task::XInteractionRequest> m_xRequest;
136 
137  css::uno::Reference< css::uno::XInterface> m_xOrigin;
138  };
139 
140 }
141 
142 
143 #endif
144 
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SAL_CALL setName(const OUString &Name) override
Definition: filinsreq.hxx:53
XInteractionRequestImpl(const OUString &aClashingName, const css::uno::Reference< css::uno::XInterface > &xOrigin, TaskManager *pShell, sal_Int32 CommandId)
virtual void SAL_CALL select() override
Definition: filinsreq.hxx:85
XInteractionAbortImpl *const p2
Definition: filinsreq.hxx:133
XInteractionSupplyNameImpl *const p1
Definition: filinsreq.hxx:132
css::uno::Reference< css::task::XInteractionRequest > m_xRequest
Definition: filinsreq.hxx:135
css::uno::Reference< css::uno::XInterface > m_xOrigin
Definition: filinsreq.hxx:137
css::uno::Reference< css::task::XInteractionRequest > const & getRequest() const
Definition: filinsreq.hxx:125
virtual void SAL_CALL select() override
Definition: filinsreq.hxx:48
const OUString & getName() const
Definition: filinsreq.hxx:58