1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SD_FRAMEWORK_UPDATE_REQUEST_HXX
29 #define SD_FRAMEWORK_UPDATE_REQUEST_HXX
30 
31 #include "MutexOwner.hxx"
32 #include <com/sun/star/drawing/framework/XConfigurationChangeRequest.hpp>
33 #include <com/sun/star/container/XNamed.hpp>
34 #include <com/sun/star/drawing/framework/XConfiguration.hpp>
35 #include <cppuhelper/compbase2.hxx>
36 
37 
38 namespace {
39 
40 typedef ::cppu::WeakComponentImplHelper2 <
41       ::com::sun::star::drawing::framework::XConfigurationChangeRequest,
42       ::com::sun::star::container::XNamed
43     > UpdateRequestInterfaceBase;
44 
45 } // end of anonymous namespace.
46 
47 
48 
49 namespace sd { namespace framework {
50 
51 /** This update request is used to request configuration updates
52     asynchronous when no other requests are being processed.  When there are
53     other requests then we can simply wait until the last one is executed:
54     the configuration is updated when the request queue becomes empty.  This
55     is use by this implementation as well.  The execute() method does not
56     really do anything.  This request just triggers the update of the
57     configuration when it is removed as last request from the queue.
58 */
59 class UpdateRequest
60     : private MutexOwner,
61       public UpdateRequestInterfaceBase
62 {
63 public:
64 	UpdateRequest (void) throw();
65 	virtual ~UpdateRequest (void) throw();
66 
67 
68     // XConfigurationChangeOperation
69 
70     virtual void SAL_CALL execute (
71         const ::com::sun::star::uno::Reference<
72             com::sun::star::drawing::framework::XConfiguration>& rxConfiguration)
73         throw (::com::sun::star::uno::RuntimeException);
74 
75 
76     // XNamed
77 
78     /** Return a human readable string representation.  This is used for
79         debugging purposes.
80     */
81     virtual ::rtl::OUString SAL_CALL getName (void)
82         throw (::com::sun::star::uno::RuntimeException);
83 
84     /** This call is ignored because the XNamed interface is (mis)used to
85         give access to a human readable name for debugging purposes.
86     */
87     virtual void SAL_CALL setName (const ::rtl::OUString& rName)
88         throw (::com::sun::star::uno::RuntimeException);
89 };
90 
91 } } // end of namespace sd::framework
92 
93 #endif
94