bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / framework / configuration / GenericConfigurationChangeRequest.cxx
blobc4f569109684d886b6433abeb898e8277c3037e5
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 .
20 #include "GenericConfigurationChangeRequest.hxx"
22 #include "framework/FrameworkHelper.hxx"
24 using namespace ::com::sun::star;
25 using namespace ::com::sun::star::uno;
26 using namespace ::com::sun::star::drawing::framework;
28 namespace sd { namespace framework {
30 GenericConfigurationChangeRequest::GenericConfigurationChangeRequest (
31 const Reference<XResourceId>& rxResourceId,
32 const Mode eMode) throw(::com::sun::star::lang::IllegalArgumentException)
33 : GenericConfigurationChangeRequestInterfaceBase(MutexOwner::maMutex),
34 mxResourceId(rxResourceId),
35 meMode(eMode)
37 if ( ! rxResourceId.is() || rxResourceId->getResourceURL().isEmpty())
38 throw ::com::sun::star::lang::IllegalArgumentException();
41 GenericConfigurationChangeRequest::~GenericConfigurationChangeRequest() throw()
45 void SAL_CALL GenericConfigurationChangeRequest::execute (
46 const Reference<XConfiguration>& rxConfiguration)
47 throw (RuntimeException, std::exception)
49 if (rxConfiguration.is())
51 switch (meMode)
53 case Activation:
54 rxConfiguration->addResource(mxResourceId);
55 break;
57 case Deactivation:
58 rxConfiguration->removeResource(mxResourceId);
59 break;
64 OUString SAL_CALL GenericConfigurationChangeRequest::getName()
65 throw (RuntimeException, std::exception)
67 return "GenericConfigurationChangeRequest "
68 + (meMode==Activation ? OUString("activate ") : OUString("deactivate "))
69 + FrameworkHelper::ResourceIdToString(mxResourceId);
72 void SAL_CALL GenericConfigurationChangeRequest::setName (const OUString& rsName)
73 throw (RuntimeException, std::exception)
75 (void)rsName;
76 // Ignored.
79 } } // end of namespace sd::framework
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */