LibreOffice Module sd (master) 1
MasterPageDescriptor.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 <memory>
24
25namespace sd { class PreviewRenderer; }
26class SdDrawDocument;
27
28namespace sd::sidebar {
29
30class PageObjectProvider;
31class PreviewProvider;
32
33class MasterPageDescriptor;
34typedef std::shared_ptr<MasterPageDescriptor> SharedMasterPageDescriptor;
35
40{
41public:
44 const sal_Int32 nTemplateIndex,
45 std::u16string_view rURL,
46 OUString sPageName,
47 OUString sStyleName,
48 const bool bIsPrecious,
49 std::shared_ptr<PageObjectProvider> pPageObjectProvider,
50 std::shared_ptr<PreviewProvider> pPreviewProvider);
51
53
62 ::std::unique_ptr<std::vector<MasterPageContainerChangeEvent::EventType> >
63 Update (
64 const MasterPageDescriptor& rDescriptor);
65
72 const Image& GetPreview (MasterPageContainer::PreviewSize ePreviewSize) const;
73
103 bool UpdatePreview (
104 sal_Int32 nCostThreshold,
105 const Size& rSmallSize,
106 const Size& rLargeSize,
107 ::sd::PreviewRenderer& rRenderer);
108
127 int UpdatePageObject (
128 sal_Int32 nCostThreshold,
129 SdDrawDocument* pDocument);
130
138 };
139
141
146
150
154 OUString msURL;
155
158 OUString msPageName;
159
162 OUString msStyleName;
163
164 const bool mbIsPrecious;
165
169
173
179
184
188 std::shared_ptr<PreviewProvider> mpPreviewProvider;
189
193 std::shared_ptr<PageObjectProvider> mpPageObjectProvider;
194
200
202
203 sal_Int32 mnUseCount;
204
205 class URLComparator { public:
206 OUString msURL;
207 explicit URLComparator (OUString sURL);
208 bool operator() (const SharedMasterPageDescriptor& rDescriptor);
209 };
210 class StyleNameComparator { public:
211 OUString msStyleName;
212 explicit StyleNameComparator (OUString sStyleName);
213 bool operator() (const SharedMasterPageDescriptor& rDescriptor);
214 };
215 class PageObjectComparator { public:
217 explicit PageObjectComparator (const SdPage* pPageObject);
218 bool operator() (const SharedMasterPageDescriptor& rDescriptor);
219 };
220 class AllComparator { public:
221 explicit AllComparator(SharedMasterPageDescriptor aDescriptor);
222 bool operator() (const SharedMasterPageDescriptor& rDescriptor);
223 private:
225 };
226
227};
228
229} // end of namespace sd::sidebar
230
231/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Origin
Each entry of the container is either the first page of a template document or is a master page of an...
bool operator()(const SharedMasterPageDescriptor &rDescriptor)
AllComparator(SharedMasterPageDescriptor aDescriptor)
bool operator()(const SharedMasterPageDescriptor &rDescriptor)
bool operator()(const SharedMasterPageDescriptor &rDescriptor)
bool operator()(const SharedMasterPageDescriptor &rDescriptor)
A collection of data that is stored for every master page in the MasterpageContainer.
void SetToken(MasterPageContainer::Token aToken)
MasterPageContainer::Origin meOrigin
A rough specification of the origin of the master page.
Image maSmallPreview
A small (the default size) preview of the master page.
MasterPageDescriptor(MasterPageContainer::Origin eOrigin, const sal_Int32 nTemplateIndex, std::u16string_view rURL, OUString sPageName, OUString sStyleName, const bool bIsPrecious, std::shared_ptr< PageObjectProvider > pPageObjectProvider, std::shared_ptr< PreviewProvider > pPreviewProvider)
sal_Int32 mnTemplateIndex
This index represents the order in which templates are provided via the TemplateScanner.
OUString msPageName
Taken from the title of the template file.
Image maLargePreview
A large preview of the master page.
::std::unique_ptr< std::vector< MasterPageContainerChangeEvent::EventType > > Update(const MasterPageDescriptor &rDescriptor)
Update the called MasterPageDescriptor object with values from the given one.
OUString msStyleName
Taken from the master page object.
SdPage * mpMasterPage
The actual master page.
MasterPageContainer::Token maToken
The Token under which the MasterPageContainer gives access to the object.
bool UpdatePreview(sal_Int32 nCostThreshold, const Size &rSmallSize, const Size &rLargeSize, ::sd::PreviewRenderer &rRenderer)
Use the PreviewProvider to get access to a preview of the master page.
std::shared_ptr< PageObjectProvider > mpPageObjectProvider
The master page provider.
std::shared_ptr< PreviewProvider > mpPreviewProvider
The preview provider.
const Image & GetPreview(MasterPageContainer::PreviewSize ePreviewSize) const
This convenience method returns either a small or a large preview, depending on the given size specif...
OUString msURL
The URL is not empty for master pages loaded from a template document.
SdPage * mpSlide
A slide that uses the master page.
int UpdatePageObject(sal_Int32 nCostThreshold, SdDrawDocument *pDocument)
Use the PageObjectProvider to get access to the master page object.
std::shared_ptr< MasterPageDescriptor > SharedMasterPageDescriptor