LibreOffice Module sd (master) 1
MasterPageObserver.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
22#include <rtl/ustring.hxx>
23#include <tools/link.hxx>
25#include <memory>
26#include <set>
27
28namespace osl
29{
30class Mutex;
31}
32
33class SdDrawDocument;
34
35namespace sd
36{
37class MasterPageObserverEvent;
38
45{
46public:
47 typedef ::std::set<OUString> MasterPageNameSet;
48
52
56 void RegisterDocument(SdDrawDocument& rDocument);
57
61 void UnregisterDocument(SdDrawDocument& rDocument);
62
70
78
79private:
80 class Implementation;
81 ::std::unique_ptr<Implementation> mpImpl;
82
84 virtual ~MasterPageObserver() override;
85
87
89};
90
95{
96public:
98 {
105 };
106
108 const OUString& mrMasterPageName;
109
110 MasterPageObserverEvent(EventType eType, const OUString& rMasterPageName)
111 : meType(eType)
112 , mrMasterPageName(rMasterPageName)
113 {
114 }
115};
116
117} // end of namespace sd
118
119/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Objects of this class are sent to listeners of the MasterPageObserver singleton when the list of mast...
MasterPageObserverEvent(EventType eType, const OUString &rMasterPageName)
@ ET_MASTER_PAGE_EXISTS
Master page already exists when document is registered.
@ ET_MASTER_PAGE_ADDED
Master page has been added to a document.
@ ET_MASTER_PAGE_REMOVED
Master page has been removed from to a document.
This singleton observes all registered documents for changes in the used master pages and in turn inf...
::std::unique_ptr< Implementation > mpImpl
void UnregisterDocument(SdDrawDocument &rDocument)
The master page observer will stop to listen to events of this document.
MasterPageObserver & operator=(const MasterPageObserver &)=delete
::std::set< OUString > MasterPageNameSet
void AddEventListener(const Link< MasterPageObserverEvent &, void > &rEventListener)
Add a listener that is informed of master pages that are newly assigned to slides or become unassigne...
static MasterPageObserver & Instance()
Return the single instance of this class.
virtual ~MasterPageObserver() override
void RemoveEventListener(const Link< MasterPageObserverEvent &, void > &rEventListener)
Remove the given listener from the list of listeners.
void RegisterDocument(SdDrawDocument &rDocument)
The master page observer will listen to events of this document and detect changes of the use of mast...
MasterPageObserver(const MasterPageObserver &)=delete
DocumentType eType