1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: GenericConfigurationChangeRequest.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SD_FRAMEWORK_GENERIC_CONFIGURATTION_CHANGE_REQUEST_HXX
32 #define SD_FRAMEWORK_GENERIC_CONFIGURATTION_CHANGE_REQUEST_HXX
34 #include "MutexOwner.hxx"
35 #include <com/sun/star/drawing/framework/XConfigurationChangeRequest.hpp>
36 #include <com/sun/star/container/XNamed.hpp>
37 #include <com/sun/star/drawing/framework/XConfiguration.hpp>
38 #include <com/sun/star/drawing/framework/XResourceId.hpp>
39 #include <com/sun/star/lang/IllegalArgumentException.hpp>
40 #include <com/sun/star/beans/PropertyValues.hpp>
41 #include <cppuhelper/compbase2.hxx>
43 namespace css
= ::com::sun::star
;
47 typedef ::cppu::WeakComponentImplHelper2
<
48 ::com::sun::star::drawing::framework::XConfigurationChangeRequest
,
49 ::com::sun::star::container::XNamed
50 > GenericConfigurationChangeRequestInterfaceBase
;
52 } // end of anonymous namespace.
55 namespace sd
{ namespace framework
{
57 /** This implementation of the XConfigurationChangeRequest interface
58 represents a single explicit request for a configuration change. On its
59 execution it may result in other, implicit, configuration changes. For
60 example this is the case when the deactivation of a unique resource is
61 requested: the resources linked to it have to be deactivated as well.
63 class GenericConfigurationChangeRequest
65 public GenericConfigurationChangeRequestInterfaceBase
68 /** This enum specified whether the activation or deactivation of a
69 resource is requested.
71 enum Mode
{ Activation
, Deactivation
};
73 /** Create a new object that represents the request for activation or
74 deactivation of the specified resource.
76 Id of the resource that is to be activated or deactivated.
78 The mode specifies whether to activate or to deactivate the
81 GenericConfigurationChangeRequest (
82 const ::com::sun::star::uno::Reference
<com::sun::star::drawing::framework::XResourceId
>&
85 throw (::com::sun::star::lang::IllegalArgumentException
);
87 virtual ~GenericConfigurationChangeRequest (void) throw();
90 // XConfigurationChangeOperation
92 /** The requested configuration change is executed on the given
93 configuration. Additionally to the explicitly requested change
94 other changes have to be made as well. See class description for an
96 @param rxConfiguration
97 The configuration to which the requested change is made.
99 virtual void SAL_CALL
execute (
100 const ::com::sun::star::uno::Reference
<
101 com::sun::star::drawing::framework::XConfiguration
>& rxConfiguration
)
102 throw (::com::sun::star::uno::RuntimeException
);
107 /** Return a human readable string representation. This is used for
110 virtual ::rtl::OUString SAL_CALL
getName (void)
111 throw (::com::sun::star::uno::RuntimeException
);
113 /** This call is ignored because the XNamed interface is (mis)used to
114 give access to a human readable name for debugging purposes.
116 virtual void SAL_CALL
setName (const ::rtl::OUString
& rName
)
117 throw (::com::sun::star::uno::RuntimeException
);
120 const css::uno::Reference
<css::drawing::framework::XResourceId
> mxResourceId
;
124 } } // end of namespace sd::framework