LibreOffice Module sd (master) 1
ChangeRequestQueueProcessor.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
23#include <osl/mutex.hxx>
24
25#include <tools/link.hxx>
26
27#include <memory>
28
30{
31class XConfiguration;
32}
34{
35class XConfigurationChangeRequest;
36}
37
38struct ImplSVEvent;
39
40namespace sd::framework
41{
42class ConfigurationUpdater;
43
54{
55public:
60 explicit ChangeRequestQueueProcessor(std::shared_ptr<ConfigurationUpdater> pUpdater);
62
68 const css::uno::Reference<css::drawing::framework::XConfiguration>& rxConfiguration);
69
74 void AddRequest(
75 const css::uno::Reference<css::drawing::framework::XConfigurationChangeRequest>& rxRequest);
76
79 bool IsEmpty() const;
80
86 void ProcessUntilEmpty();
87
90 void ProcessOneEvent();
91
97 void Clear();
98
99private:
100 mutable ::osl::Mutex maMutex;
101
103
109
110 css::uno::Reference<css::drawing::framework::XConfiguration> mxConfiguration;
111
112 std::shared_ptr<ConfigurationUpdater> mpConfigurationUpdater;
113
117 void StartProcessing();
118
121 DECL_LINK(ProcessEvent, void*, void);
122};
123
124} // end of namespace sd::framework
125
126/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
The ChangeRequestQueueProcessor owns the ChangeRequestQueue and processes the configuration change re...
void AddRequest(const css::uno::Reference< css::drawing::framework::XConfigurationChangeRequest > &rxRequest)
The given request is appended to the end of the queue and will eventually be processed when all other...
DECL_LINK(ProcessEvent, void *, void)
Callback function for the PostUserEvent() call.
ChangeRequestQueueProcessor(std::shared_ptr< ConfigurationUpdater > pUpdater)
The queue processor is created with a reference to an ConfigurationController so that its UpdateConfi...
ImplSVEvent * mnUserEventId
The id returned by the last PostUserEvent() call.
void StartProcessing()
Initiate the processing of the entries in the queue.
void ProcessUntilEmpty()
Process all events in the queue synchronously.
void ProcessOneEvent()
Process the first event in queue.
void SetConfiguration(const css::uno::Reference< css::drawing::framework::XConfiguration > &rxConfiguration)
Sets the configuration who will be changed by subsequent change requests.
void Clear()
Remove all events from the queue.
bool IsEmpty() const
Returns </sal_True> when the queue is empty.
std::shared_ptr< ConfigurationUpdater > mpConfigurationUpdater
css::uno::Reference< css::drawing::framework::XConfiguration > mxConfiguration
The ChangeRequestQueue stores the pending requests for changes to the requested configuration.