1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SD_SOURCE_UI_SIDEBAR_DOCUMENTHELPER_HXX
21 #define INCLUDED_SD_SOURCE_UI_SIDEBAR_DOCUMENTHELPER_HXX
23 #include <rtl/ustring.hxx>
30 namespace sd
{ namespace sidebar
{
32 /** A collection of methods supporting the handling of master pages.
37 /** Return a copy of the given master page in the given document.
39 static SdPage
* CopyMasterPageToLocalDocument (
40 SdDrawDocument
& rTargetDocument
,
43 /** Return and, when not yet present, create a slide that uses the given
46 static SdPage
* GetSlideForMasterPage (SdPage
const * pMasterPage
);
48 /** Copy the styles used by the given page from the source document to
51 static void ProvideStyles (
52 SdDrawDocument
const & rSourceDocument
,
53 SdDrawDocument
& rTargetDocument
,
54 SdPage
const * pPage
);
56 /** Assign the given master page to the list of pages.
57 @param rTargetDocument
58 The document that is the owner of the pages in rPageList.
60 This master page will usually be a member of the list of all
61 available master pages as provided by the MasterPageContainer.
63 The pages to which to assign the master page. These pages may
64 be slides or master pages themselves.
66 static void AssignMasterPageToPageList (
67 SdDrawDocument
& rTargetDocument
,
69 const std::shared_ptr
<std::vector
<SdPage
*> >& rPageList
);
72 static SdPage
* AddMasterPage (
73 SdDrawDocument
& rTargetDocument
,
74 SdPage
const * pMasterPage
);
75 static SdPage
* AddMasterPage (
76 SdDrawDocument
& rTargetDocument
,
77 SdPage
const * pMasterPage
,
78 sal_uInt16 nInsertionIndex
);
79 static SdPage
* ProvideMasterPage (
80 SdDrawDocument
& rTargetDocument
,
82 const std::shared_ptr
<std::vector
<SdPage
*> >& rpPageList
);
84 /** Assign the given master page to the given page.
86 In contrast to AssignMasterPageToPageList() this page is assumed
87 to be in the target document, i.e. the same document that pPage
88 is in. The caller will usually call AddMasterPage() to create a
89 clone of a master page in a another document to create it.
90 @param rsBaseLayoutName
91 The layout name of the given master page. It is given so that
92 it has not to be created on every call. It could be generated
93 from the given master page, though.
95 The page to which to assign the master page. It can be a slide
96 or a master page itself.
98 static void AssignMasterPageToPage (
99 SdPage
const * pMasterPage
,
100 const OUString
& rsBaseLayoutName
,
104 } } // end of namespace sd::sidebar
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */