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 SD_TOOLPANEL_CONTROLS_DCUMENT_HELPER_HXX
21 #define SD_TOOLPANEL_CONTROLS_DCUMENT_HELPER_HXX
23 #include <tools/solar.h>
24 #include <boost/shared_ptr.hpp>
31 namespace sd
{ namespace toolpanel
{ namespace controls
{
33 /** A collection of methods supporting the handling of master pages.
38 /** Return a copy of the given master page in the given document.
40 static SdPage
* CopyMasterPageToLocalDocument (
41 SdDrawDocument
& rTargetDocument
,
44 /** Return and, when not yet present, create a slide that uses the given
47 static SdPage
* GetSlideForMasterPage (SdPage
* pMasterPage
);
49 /** Copy the styles used by the given page from the source document to
52 static void ProvideStyles (
53 SdDrawDocument
& rSourceDocument
,
54 SdDrawDocument
& rTargetDocument
,
57 /** Assign the given master page to the list of pages.
58 @param rTargetDocument
59 The document that is the owner of the pages in rPageList.
61 This master page will usually be a member of the list of all
62 available master pages as provided by the MasterPageContainer.
64 The pages to which to assign the master page. These pages may
65 be slides or master pages themselves.
67 static void AssignMasterPageToPageList (
68 SdDrawDocument
& rTargetDocument
,
70 const ::boost::shared_ptr
<std::vector
<SdPage
*> >& rPageList
);
73 static SdPage
* AddMasterPage (
74 SdDrawDocument
& rTargetDocument
,
76 static SdPage
* AddMasterPage (
77 SdDrawDocument
& rTargetDocument
,
79 sal_uInt16 nInsertionIndex
);
80 static SdPage
* ProvideMasterPage (
81 SdDrawDocument
& rTargetDocument
,
83 const ::boost::shared_ptr
<std::vector
<SdPage
*> >& rpPageList
);
85 /** Assign the given master page to the given page.
87 In contrast to AssignMasterPageToPageList() this page is assumed
88 to be in the target document, i.e. the same document that pPage
89 is in. The caller will usually call AddMasterPage() to create a
90 clone of a master page in a another document to create it.
91 @param rsBaseLayoutName
92 The layout name of the given master page. It is given so that
93 it has not to be created on every call. It could be generated
94 from the given master page, though.
96 The page to which to assign the master page. It can be a slide
97 or a master page itself.
99 static void AssignMasterPageToPage (
101 const String
& rsBaseLayoutName
,
106 } } } // end of namespace ::sd::toolpanel::controls
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */