1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SD_FRAMEWORK_UPDATE_REQUEST_HXX
25 #define SD_FRAMEWORK_UPDATE_REQUEST_HXX
26 
27 #include "MutexOwner.hxx"
28 #include <com/sun/star/drawing/framework/XConfigurationChangeRequest.hpp>
29 #include <com/sun/star/container/XNamed.hpp>
30 #include <com/sun/star/drawing/framework/XConfiguration.hpp>
31 #include <cppuhelper/compbase2.hxx>
32 
33 
34 namespace {
35 
36 typedef ::cppu::WeakComponentImplHelper2 <
37       ::com::sun::star::drawing::framework::XConfigurationChangeRequest,
38       ::com::sun::star::container::XNamed
39     > UpdateRequestInterfaceBase;
40 
41 } // end of anonymous namespace.
42 
43 
44 
45 namespace sd { namespace framework {
46 
47 /** This update request is used to request configuration updates
48     asynchronous when no other requests are being processed.  When there are
49     other requests then we can simply wait until the last one is executed:
50     the configuration is updated when the request queue becomes empty.  This
51     is use by this implementation as well.  The execute() method does not
52     really do anything.  This request just triggers the update of the
53     configuration when it is removed as last request from the queue.
54 */
55 class UpdateRequest
56     : private MutexOwner,
57       public UpdateRequestInterfaceBase
58 {
59 public:
60 	UpdateRequest (void) throw();
61 	virtual ~UpdateRequest (void) throw();
62 
63 
64     // XConfigurationChangeOperation
65 
66     virtual void SAL_CALL execute (
67         const ::com::sun::star::uno::Reference<
68             com::sun::star::drawing::framework::XConfiguration>& rxConfiguration)
69         throw (::com::sun::star::uno::RuntimeException);
70 
71 
72     // XNamed
73 
74     /** Return a human readable string representation.  This is used for
75         debugging purposes.
76     */
77     virtual ::rtl::OUString SAL_CALL getName (void)
78         throw (::com::sun::star::uno::RuntimeException);
79 
80     /** This call is ignored because the XNamed interface is (mis)used to
81         give access to a human readable name for debugging purposes.
82     */
83     virtual void SAL_CALL setName (const ::rtl::OUString& rName)
84         throw (::com::sun::star::uno::RuntimeException);
85 };
86 
87 } } // end of namespace sd::framework
88 
89 #endif
90