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 .
22 #include <com/sun/star/drawing/framework/XConfigurationChangeRequest.hpp>
23 #include <com/sun/star/container/XNamed.hpp>
24 #include <comphelper/compbase.hxx>
26 namespace com::sun::star::drawing::framework
{ class XConfiguration
; }
27 namespace com::sun::star::drawing::framework
{ class XResourceId
; }
29 namespace sd::framework
{
31 typedef comphelper::WeakComponentImplHelper
<
32 css::drawing::framework::XConfigurationChangeRequest
,
33 css::container::XNamed
34 > GenericConfigurationChangeRequestInterfaceBase
;
36 /** This implementation of the XConfigurationChangeRequest interface
37 represents a single explicit request for a configuration change. On its
38 execution it may result in other, implicit, configuration changes. For
39 example this is the case when the deactivation of a unique resource is
40 requested: the resources linked to it have to be deactivated as well.
42 class GenericConfigurationChangeRequest final
43 : public GenericConfigurationChangeRequestInterfaceBase
46 /** This enum specified whether the activation or deactivation of a
47 resource is requested.
49 enum Mode
{ Activation
, Deactivation
};
51 /** Create a new object that represents the request for activation or
52 deactivation of the specified resource.
54 Id of the resource that is to be activated or deactivated.
56 The mode specifies whether to activate or to deactivate the
58 @throws css::css::lang::IllegalArgumentException
60 GenericConfigurationChangeRequest (
61 const css::uno::Reference
<css::drawing::framework::XResourceId
>&
65 virtual ~GenericConfigurationChangeRequest() noexcept override
;
67 // XConfigurationChangeOperation
69 /** The requested configuration change is executed on the given
70 configuration. Additionally to the explicitly requested change
71 other changes have to be made as well. See class description for an
73 @param rxConfiguration
74 The configuration to which the requested change is made.
76 virtual void SAL_CALL
execute (
77 const css::uno::Reference
<css::drawing::framework::XConfiguration
>& rxConfiguration
) override
;
81 /** Return a human readable string representation. This is used for
84 virtual OUString SAL_CALL
getName() override
;
86 /** This call is ignored because the XNamed interface is (mis)used to
87 give access to a human readable name for debugging purposes.
89 virtual void SAL_CALL
setName (const OUString
& rName
) override
;
92 const css::uno::Reference
<css::drawing::framework::XResourceId
> mxResourceId
;
96 } // end of namespace sd::framework
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */