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 SD_FRAMEWORK_GENERIC_CONFIGURATTION_CHANGE_REQUEST_HXX
21 #define SD_FRAMEWORK_GENERIC_CONFIGURATTION_CHANGE_REQUEST_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.
42 namespace sd
{ namespace framework
{
44 /** This implementation of the XConfigurationChangeRequest interface
45 represents a single explicit request for a configuration change. On its
46 execution it may result in other, implicit, configuration changes. For
47 example this is the case when the deactivation of a unique resource is
48 requested: the resources linked to it have to be deactivated as well.
50 class GenericConfigurationChangeRequest
52 public GenericConfigurationChangeRequestInterfaceBase
55 /** This enum specified whether the activation or deactivation of a
56 resource is requested.
58 enum Mode
{ Activation
, Deactivation
};
60 /** Create a new object that represents the request for activation or
61 deactivation of the specified resource.
63 Id of the resource that is to be activated or deactivated.
65 The mode specifies whether to activate or to deactivate the
68 GenericConfigurationChangeRequest (
69 const ::com::sun::star::uno::Reference
<com::sun::star::drawing::framework::XResourceId
>&
72 throw (::com::sun::star::lang::IllegalArgumentException
);
74 virtual ~GenericConfigurationChangeRequest (void) throw();
77 // XConfigurationChangeOperation
79 /** The requested configuration change is executed on the given
80 configuration. Additionally to the explicitly requested change
81 other changes have to be made as well. See class description for an
83 @param rxConfiguration
84 The configuration to which the requested change is made.
86 virtual void SAL_CALL
execute (
87 const ::com::sun::star::uno::Reference
<
88 com::sun::star::drawing::framework::XConfiguration
>& rxConfiguration
)
89 throw (::com::sun::star::uno::RuntimeException
);
94 /** Return a human readable string representation. This is used for
97 virtual OUString SAL_CALL
getName (void)
98 throw (::com::sun::star::uno::RuntimeException
);
100 /** This call is ignored because the XNamed interface is (mis)used to
101 give access to a human readable name for debugging purposes.
103 virtual void SAL_CALL
setName (const OUString
& rName
)
104 throw (::com::sun::star::uno::RuntimeException
);
107 const css::uno::Reference
<css::drawing::framework::XResourceId
> mxResourceId
;
111 } } // end of namespace sd::framework
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */