bump product version to 4.1.6.2
[LibreOffice.git] / sd / source / ui / framework / configuration / GenericConfigurationChangeRequest.hxx
blob4fa341a239c1adb3e62074dd3bb49e5d6eb8cfa7
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 #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>
32 namespace {
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
51 : private MutexOwner,
52 public GenericConfigurationChangeRequestInterfaceBase
54 public:
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.
62 @param rxsResourceId
63 Id of the resource that is to be activated or deactivated.
64 @param eMode
65 The mode specifies whether to activate or to deactivate the
66 resource.
68 GenericConfigurationChangeRequest (
69 const ::com::sun::star::uno::Reference<com::sun::star::drawing::framework::XResourceId>&
70 rxResourceId,
71 const Mode eMode)
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
82 example.
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);
92 // XNamed
94 /** Return a human readable string representation. This is used for
95 debugging purposes.
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);
106 private:
107 const css::uno::Reference<css::drawing::framework::XResourceId> mxResourceId;
108 const Mode meMode;
111 } } // end of namespace sd::framework
113 #endif
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */