LibreOffice Module sd (master) 1
MasterPageContainerProviders.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 <sfx2/objsh.hxx>
24
25class Image;
26class SdDrawDocument;
27class SdPage;
28namespace sd
29{
30class PreviewRenderer;
31}
32namespace sd
33{
34class DrawDocShell;
35}
36
37namespace sd::sidebar
38{
43{
44public:
51 virtual SdPage* operator()(SdDrawDocument* pDocument) = 0;
52
60 virtual int GetCostIndex() = 0;
61
62protected:
64};
65
67{
68public:
82 virtual Image operator()(int nWidth, SdPage* pPage, ::sd::PreviewRenderer& rRenderer) = 0;
83
89 virtual int GetCostIndex() = 0;
90
94 virtual bool NeedsPageObject() = 0;
95
96protected:
98};
99
103{
104public:
107 virtual Image operator()(int nWidth, SdPage* pPage, ::sd::PreviewRenderer& rRenderer) override;
108 virtual int GetCostIndex() override;
109 virtual bool NeedsPageObject() override;
110
111private:
112};
113
118{
119public:
120 explicit TemplatePageObjectProvider(OUString sURL);
122 virtual SdPage* operator()(SdDrawDocument* pDocument) override;
123 virtual int GetCostIndex() override;
124
125private:
126 OUString msURL;
128 ::sd::DrawDocShell* LoadDocument(const OUString& sFileName);
129};
130
135{
136public:
137 explicit TemplatePreviewProvider(OUString sURL);
139 virtual Image operator()(int nWidth, SdPage* pPage, ::sd::PreviewRenderer& rRenderer) override;
140 virtual int GetCostIndex() override;
141 virtual bool NeedsPageObject() override;
142
143private:
144 OUString msURL;
145};
146
150{
151public:
154 virtual SdPage* operator()(SdDrawDocument* pDocument) override;
155 virtual int GetCostIndex() override;
156};
157
162{
163public:
164 explicit ExistingPageProvider(SdPage* pPage);
166 virtual SdPage* operator()(SdDrawDocument* pDocument) override;
167 virtual int GetCostIndex() override;
168
169private:
171};
172
173} // end of namespace sd::sidebar
174
175/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SdPage * operator()(SdDrawDocument *pDocument) override
Return a master page either by returning an already existing one, by creating a new page,...
virtual int GetCostIndex() override
An abstract value for the expected cost of providing a master page object.
This implementation of the PageObjectProvider simply returns an already existing master page object.
virtual SdPage * operator()(SdDrawDocument *pDocument) override
Return a master page either by returning an already existing one, by creating a new page,...
virtual int GetCostIndex() override
An abstract value for the expected cost of providing a master page object.
Interface for a provider of page objects.
virtual int GetCostIndex()=0
An abstract value for the expected cost of providing a master page object.
virtual SdPage * operator()(SdDrawDocument *pDocument)=0
Return a master page either by returning an already existing one, by creating a new page,...
Provide previews of existing page objects by rendering them.
virtual bool NeedsPageObject() override
Return whether the page object passed is necessary to create a preview.
virtual int GetCostIndex() override
Return a value that indicates how expensive the creation of a preview image is.
virtual Image operator()(int nWidth, SdPage *pPage, ::sd::PreviewRenderer &rRenderer) override
Create a preview image in the specified width.
virtual int GetCostIndex()=0
Return a value that indicates how expensive the creation of a preview image is.
virtual bool NeedsPageObject()=0
Return whether the page object passed is necessary to create a preview.
virtual Image operator()(int nWidth, SdPage *pPage, ::sd::PreviewRenderer &rRenderer)=0
Create a preview image in the specified width.
Provide master page objects for template documents for which only the URL is given.
::sd::DrawDocShell * LoadDocument(const OUString &sFileName)
virtual SdPage * operator()(SdDrawDocument *pDocument) override
Return a master page either by returning an already existing one, by creating a new page,...
virtual int GetCostIndex() override
An abstract value for the expected cost of providing a master page object.
Provide previews for template documents by loading the thumbnails from the documents.
virtual Image operator()(int nWidth, SdPage *pPage, ::sd::PreviewRenderer &rRenderer) override
Create a preview image in the specified width.
virtual int GetCostIndex() override
Return a value that indicates how expensive the creation of a preview image is.
virtual bool NeedsPageObject() override
Return whether the page object passed is necessary to create a preview.