1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
20 #include <sal/config.h>
22 #include <string_view>
24 #include "GenericConfigurationChangeRequest.hxx"
26 #include <framework/FrameworkHelper.hxx>
28 using namespace ::com::sun::star
;
29 using namespace ::com::sun::star::uno
;
30 using namespace ::com::sun::star::drawing::framework
;
32 namespace sd::framework
{
34 GenericConfigurationChangeRequest::GenericConfigurationChangeRequest (
35 const Reference
<XResourceId
>& rxResourceId
,
37 : mxResourceId(rxResourceId
),
40 if ( ! rxResourceId
.is() || rxResourceId
->getResourceURL().isEmpty())
41 throw css::lang::IllegalArgumentException();
44 GenericConfigurationChangeRequest::~GenericConfigurationChangeRequest() noexcept
48 void SAL_CALL
GenericConfigurationChangeRequest::execute (
49 const Reference
<XConfiguration
>& rxConfiguration
)
51 if (!rxConfiguration
.is())
57 rxConfiguration
->addResource(mxResourceId
);
61 rxConfiguration
->removeResource(mxResourceId
);
66 OUString SAL_CALL
GenericConfigurationChangeRequest::getName()
68 return OUString::Concat("GenericConfigurationChangeRequest ")
70 ? std::u16string_view(u
"activate ") : std::u16string_view(u
"deactivate "))
71 + FrameworkHelper::ResourceIdToString(mxResourceId
);
74 void SAL_CALL
GenericConfigurationChangeRequest::setName (const OUString
&)
79 } // end of namespace sd::framework
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */