bump product version to 4.1.6.2
[LibreOffice.git] / sd / source / ui / framework / configuration / GenericConfigurationChangeRequest.cxx
blobcde24baacd29e005840d968a7897588159625e4e
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 #include "GenericConfigurationChangeRequest.hxx"
23 #include "framework/FrameworkHelper.hxx"
25 using namespace ::com::sun::star;
26 using namespace ::com::sun::star::uno;
27 using namespace ::com::sun::star::drawing::framework;
30 namespace sd { namespace framework {
32 GenericConfigurationChangeRequest::GenericConfigurationChangeRequest (
33 const Reference<XResourceId>& rxResourceId,
34 const Mode eMode) throw(::com::sun::star::lang::IllegalArgumentException)
35 : GenericConfigurationChangeRequestInterfaceBase(MutexOwner::maMutex),
36 mxResourceId(rxResourceId),
37 meMode(eMode)
39 if ( ! rxResourceId.is() || rxResourceId->getResourceURL().isEmpty())
40 throw ::com::sun::star::lang::IllegalArgumentException();
46 GenericConfigurationChangeRequest::~GenericConfigurationChangeRequest (void) throw()
53 void SAL_CALL GenericConfigurationChangeRequest::execute (
54 const Reference<XConfiguration>& rxConfiguration)
55 throw (RuntimeException)
57 if (rxConfiguration.is())
59 switch (meMode)
61 case Activation:
62 rxConfiguration->addResource(mxResourceId);
63 break;
65 case Deactivation:
66 rxConfiguration->removeResource(mxResourceId);
67 break;
75 OUString SAL_CALL GenericConfigurationChangeRequest::getName (void)
76 throw (RuntimeException)
78 return OUString("GenericConfigurationChangeRequest ")
79 + (meMode==Activation ? OUString("activate ") : OUString("deactivate "))
80 + FrameworkHelper::ResourceIdToString(mxResourceId);
86 void SAL_CALL GenericConfigurationChangeRequest::setName (const OUString& rsName)
87 throw (RuntimeException)
89 (void)rsName;
90 // Ignored.
93 } } // end of namespace sd::framework
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */