1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DocumentHelper.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SD_TOOLPANEL_CONTROLS_DCUMENT_HELPER_HXX
32 #define SD_TOOLPANEL_CONTROLS_DCUMENT_HELPER_HXX
34 #include <tools/solar.h>
35 #include <boost/shared_ptr.hpp>
42 namespace sd
{ namespace toolpanel
{ namespace controls
{
44 /** A collection of methods supporting the handling of master pages.
49 /** Return a copy of the given master page in the given document.
51 static SdPage
* CopyMasterPageToLocalDocument (
52 SdDrawDocument
& rTargetDocument
,
55 /** Return and, when not yet present, create a slide that uses the given
58 static SdPage
* GetSlideForMasterPage (SdPage
* pMasterPage
);
60 /** Copy the styles used by the given page from the source document to
63 static void ProvideStyles (
64 SdDrawDocument
& rSourceDocument
,
65 SdDrawDocument
& rTargetDocument
,
68 /** Assign the given master page to the list of pages.
69 @param rTargetDocument
70 The document that is the owner of the pages in rPageList.
72 This master page will usually be a member of the list of all
73 available master pages as provided by the MasterPageContainer.
75 The pages to which to assign the master page. These pages may
76 be slides or master pages themselves.
78 static void AssignMasterPageToPageList (
79 SdDrawDocument
& rTargetDocument
,
81 const ::boost::shared_ptr
<std::vector
<SdPage
*> >& rPageList
);
84 static SdPage
* AddMasterPage (
85 SdDrawDocument
& rTargetDocument
,
87 static SdPage
* AddMasterPage (
88 SdDrawDocument
& rTargetDocument
,
90 USHORT nInsertionIndex
);
91 static SdPage
* ProvideMasterPage (
92 SdDrawDocument
& rTargetDocument
,
94 const ::boost::shared_ptr
<std::vector
<SdPage
*> >& rpPageList
);
96 /** Assign the given master page to the given page.
98 In contrast to AssignMasterPageToPageList() this page is assumed
99 to be in the target document, i.e. the same document that pPage
100 is in. The caller will usually call AddMasterPage() to create a
101 clone of a master page in a another document to create it.
102 @param rsBaseLayoutName
103 The layout name of the given master page. It is given so that
104 it has not to be created on every call. It could be generated
105 from the given master page, though.
107 The page to which to assign the master page. It can be a slide
108 or a master page itself.
110 static void AssignMasterPageToPage (
112 const String
& rsBaseLayoutName
,
117 } } } // end of namespace ::sd::toolpanel::controls