LibreOffice Module sd (master) 1
DocumentHelper.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 <sal/config.h>
23#include <sal/types.h>
24
25#include <memory>
26#include <string_view>
27#include <vector>
28
29class SdDrawDocument;
30class SdPage;
31
32namespace sd::sidebar {
33
37{
38public:
42 SdDrawDocument& rTargetDocument,
43 SdPage* pMasterPage);
44
48 static SdPage* GetSlideForMasterPage (SdPage const * pMasterPage);
49
53 static void ProvideStyles (
54 SdDrawDocument const & rSourceDocument,
55 SdDrawDocument& rTargetDocument,
56 SdPage const * pPage);
57
68 static void AssignMasterPageToPageList (
69 SdDrawDocument& rTargetDocument,
70 SdPage* pMasterPage,
71 const std::shared_ptr<std::vector<SdPage*> >& rPageList);
72
73private:
74 static SdPage* AddMasterPage (
75 SdDrawDocument& rTargetDocument,
76 SdPage const * pMasterPage);
77 static SdPage* AddMasterPage (
78 SdDrawDocument& rTargetDocument,
79 SdPage const * pMasterPage,
80 sal_uInt16 nInsertionIndex);
82 SdDrawDocument& rTargetDocument,
83 SdPage* pMasterPage,
84 const std::shared_ptr<std::vector<SdPage*> >& rpPageList);
85
100 static void AssignMasterPageToPage (
101 SdPage const * pMasterPage,
102 std::u16string_view rsBaseLayoutName,
103 SdPage* pPage);
104};
105
106} // end of namespace sd::sidebar
107
108/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A collection of methods supporting the handling of master pages.
static void AssignMasterPageToPage(SdPage const *pMasterPage, std::u16string_view rsBaseLayoutName, SdPage *pPage)
Assign the given master page to the given page.
static SdPage * CopyMasterPageToLocalDocument(SdDrawDocument &rTargetDocument, SdPage *pMasterPage)
Return a copy of the given master page in the given document.
static SdPage * AddMasterPage(SdDrawDocument &rTargetDocument, SdPage const *pMasterPage)
static void ProvideStyles(SdDrawDocument const &rSourceDocument, SdDrawDocument &rTargetDocument, SdPage const *pPage)
Copy the styles used by the given page from the source document to the target document.
static SdPage * GetSlideForMasterPage(SdPage const *pMasterPage)
Return and, when not yet present, create a slide that uses the given master page.
static SdPage * ProvideMasterPage(SdDrawDocument &rTargetDocument, SdPage *pMasterPage, const std::shared_ptr< std::vector< SdPage * > > &rpPageList)
static void AssignMasterPageToPageList(SdDrawDocument &rTargetDocument, SdPage *pMasterPage, const std::shared_ptr< std::vector< SdPage * > > &rPageList)
Assign the given master page to the list of pages.