xref: /trunk/main/sd/source/ui/dlg/dlgpage.cxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sd.hxx"
30 
31 #ifdef SD_DLLIMPLEMENTATION
32 #undef SD_DLLIMPLEMENTATION
33 #endif
34 
35 #include <svl/intitem.hxx>
36 #ifndef _SVX_DIALOGS_HRC
37 #include <svx/dialogs.hrc>
38 #endif
39 #include <svx/tabarea.hxx>
40 #include <svx/drawitem.hxx>
41 
42 #ifndef _SD_SDRESID_HXX
43 #include "sdresid.hxx"
44 #endif
45 #include "dlgpage.hxx"
46 
47 #include "DrawDocShell.hxx"
48 #include <svl/aeitem.hxx>
49 #include <svx/flagsdef.hxx>
50 #include <editeng/svxenum.hxx>
51 
52 /*************************************************************************
53 |*
54 |* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu
55 |*
56 \************************************************************************/
57 
58 SdPageDlg::SdPageDlg( SfxObjectShell* pDocSh, Window* pParent, const SfxItemSet* pAttr, sal_Bool bAreaPage ) :
59         SfxTabDialog ( pParent, SdResId( TAB_PAGE ), pAttr ),
60         mrOutAttrs          ( *pAttr ),
61         mpDocShell          ( pDocSh )
62 {
63     SvxColorTableItem aColorTableItem(*( (const SvxColorTableItem*)
64         ( mpDocShell->GetItem( SID_COLOR_TABLE ) ) ) );
65     SvxGradientListItem aGradientListItem(*( (const SvxGradientListItem*)
66         ( mpDocShell->GetItem( SID_GRADIENT_LIST ) ) ) );
67     SvxBitmapListItem aBitmapListItem(*( (const SvxBitmapListItem*)
68         ( mpDocShell->GetItem( SID_BITMAP_LIST ) ) ) );
69     SvxHatchListItem aHatchListItem(*( (const SvxHatchListItem*)
70         ( mpDocShell->GetItem( SID_HATCH_LIST ) ) ) );
71 
72     mpColorTab = aColorTableItem.GetColorTable();
73     mpGradientList = aGradientListItem.GetGradientList();
74     mpHatchingList = aHatchListItem.GetHatchList();
75     mpBitmapList = aBitmapListItem.GetBitmapList();
76 
77     FreeResource();
78 
79     AddTabPage( RID_SVXPAGE_PAGE);
80     AddTabPage( RID_SVXPAGE_AREA);
81 
82     if(!bAreaPage)  // I have to add the page before I remove it !
83         RemoveTabPage( RID_SVXPAGE_AREA );
84 }
85 
86 
87 /*************************************************************************
88 |*
89 |* Seite wird erzeugt
90 |*
91 \************************************************************************/
92 
93 void SdPageDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
94 {
95     SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
96     switch(nId)
97     {
98     case RID_SVXPAGE_PAGE:
99         aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_ENUM_PAGE_MODE, SVX_PAGE_MODE_PRESENTATION));
100         aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_PAPER_START, PAPER_A0));
101         aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_PAPER_END, PAPER_E));
102         rPage.PageCreated(aSet);
103         break;
104     case RID_SVXPAGE_AREA:
105             aSet.Put (SvxColorTableItem(mpColorTab,SID_COLOR_TABLE));
106             aSet.Put (SvxGradientListItem(mpGradientList,SID_GRADIENT_LIST));
107             aSet.Put (SvxHatchListItem(mpHatchingList,SID_HATCH_LIST));
108             aSet.Put (SvxBitmapListItem(mpBitmapList,SID_BITMAP_LIST));
109             aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
110             aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
111             aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,0));
112             rPage.PageCreated(aSet);
113         break;
114     }
115 }
116 
117 
118 
119