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 #ifndef INCLUDED_SD_SOURCE_UI_FRAMEWORK_CONFIGURATION_GENERICCONFIGURATIONCHANGEREQUEST_HXX
21 #define INCLUDED_SD_SOURCE_UI_FRAMEWORK_CONFIGURATION_GENERICCONFIGURATIONCHANGEREQUEST_HXX
23 #include "MutexOwner.hxx"
24 #include <com/sun/star/drawing/framework/XConfigurationChangeRequest.hpp>
25 #include <com/sun/star/container/XNamed.hpp>
26 #include <com/sun/star/drawing/framework/XConfiguration.hpp>
27 #include <com/sun/star/drawing/framework/XResourceId.hpp>
28 #include <com/sun/star/lang/IllegalArgumentException.hpp>
29 #include <com/sun/star/beans/PropertyValues.hpp>
30 #include <cppuhelper/compbase2.hxx>
34 typedef ::cppu::WeakComponentImplHelper2
<
35 ::com::sun::star::drawing::framework::XConfigurationChangeRequest
,
36 ::com::sun::star::container::XNamed
37 > GenericConfigurationChangeRequestInterfaceBase
;
39 } // end of anonymous namespace.
41 namespace sd
{ namespace framework
{
43 /** This implementation of the XConfigurationChangeRequest interface
44 represents a single explicit request for a configuration change. On its
45 execution it may result in other, implicit, configuration changes. For
46 example this is the case when the deactivation of a unique resource is
47 requested: the resources linked to it have to be deactivated as well.
49 class GenericConfigurationChangeRequest
51 public GenericConfigurationChangeRequestInterfaceBase
54 /** This enum specified whether the activation or deactivation of a
55 resource is requested.
57 enum Mode
{ Activation
, Deactivation
};
59 /** Create a new object that represents the request for activation or
60 deactivation of the specified resource.
62 Id of the resource that is to be activated or deactivated.
64 The mode specifies whether to activate or to deactivate the
67 GenericConfigurationChangeRequest (
68 const ::com::sun::star::uno::Reference
<com::sun::star::drawing::framework::XResourceId
>&
71 throw (::com::sun::star::lang::IllegalArgumentException
);
73 virtual ~GenericConfigurationChangeRequest() throw();
75 // XConfigurationChangeOperation
77 /** The requested configuration change is executed on the given
78 configuration. Additionally to the explicitly requested change
79 other changes have to be made as well. See class description for an
81 @param rxConfiguration
82 The configuration to which the requested change is made.
84 virtual void SAL_CALL
execute (
85 const ::com::sun::star::uno::Reference
<
86 com::sun::star::drawing::framework::XConfiguration
>& rxConfiguration
)
87 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
91 /** Return a human readable string representation. This is used for
94 virtual OUString SAL_CALL
getName()
95 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
97 /** This call is ignored because the XNamed interface is (mis)used to
98 give access to a human readable name for debugging purposes.
100 virtual void SAL_CALL
setName (const OUString
& rName
)
101 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
104 const css::uno::Reference
<css::drawing::framework::XResourceId
> mxResourceId
;
108 } } // end of namespace sd::framework
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */