xref: /trunk/main/sd/source/ui/dlg/dlgpage.cxx (revision c7be74b1)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sd.hxx"
26 
27 #ifdef SD_DLLIMPLEMENTATION
28 #undef SD_DLLIMPLEMENTATION
29 #endif
30 
31 #include <svl/intitem.hxx>
32 #ifndef _SVX_DIALOGS_HRC
33 #include <svx/dialogs.hrc>
34 #endif
35 #include <svx/tabarea.hxx>
36 #include <svx/drawitem.hxx>
37 
38 #ifndef _SD_SDRESID_HXX
39 #include "sdresid.hxx"
40 #endif
41 #include "dlgpage.hxx"
42 
43 #include "DrawDocShell.hxx"
44 #include <svl/aeitem.hxx>
45 #include <svx/flagsdef.hxx>
46 #include <editeng/svxenum.hxx>
47 
48 /*************************************************************************
49 |*
50 |* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu
51 |*
52 \************************************************************************/
53 
SdPageDlg(SfxObjectShell * pDocSh,Window * pParent,const SfxItemSet * pAttr,sal_Bool bAreaPage)54 SdPageDlg::SdPageDlg( SfxObjectShell* pDocSh, Window* pParent, const SfxItemSet* pAttr, sal_Bool bAreaPage ) :
55 		SfxTabDialog ( pParent, SdResId( TAB_PAGE ), pAttr ),
56 		mrOutAttrs			( *pAttr ),
57 		mpDocShell			( pDocSh )
58 {
59 	SvxColorTableItem aColorTableItem(*( (const SvxColorTableItem*)
60 		( mpDocShell->GetItem( SID_COLOR_TABLE ) ) ) );
61 	SvxGradientListItem aGradientListItem(*( (const SvxGradientListItem*)
62 		( mpDocShell->GetItem( SID_GRADIENT_LIST ) ) ) );
63 	SvxBitmapListItem aBitmapListItem(*( (const SvxBitmapListItem*)
64 		( mpDocShell->GetItem( SID_BITMAP_LIST ) ) ) );
65 	SvxHatchListItem aHatchListItem(*( (const SvxHatchListItem*)
66 		( mpDocShell->GetItem( SID_HATCH_LIST ) ) ) );
67 
68 	maColorTab = aColorTableItem.GetColorTable();
69 	maGradientList = aGradientListItem.GetGradientList();
70 	maHatchingList = aHatchListItem.GetHatchList();
71 	maBitmapList = aBitmapListItem.GetBitmapList();
72 
73 	FreeResource();
74 
75 	AddTabPage( RID_SVXPAGE_PAGE);
76 	AddTabPage( RID_SVXPAGE_AREA);
77 
78 	if(!bAreaPage)  // I have to add the page before I remove it !
79 		RemoveTabPage( RID_SVXPAGE_AREA );
80 }
81 
82 
83 /*************************************************************************
84 |*
85 |* Seite wird erzeugt
86 |*
87 \************************************************************************/
88 
PageCreated(sal_uInt16 nId,SfxTabPage & rPage)89 void SdPageDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
90 {
91 	SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
92 	switch(nId)
93 	{
94 	case RID_SVXPAGE_PAGE:
95 		aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_ENUM_PAGE_MODE, SVX_PAGE_MODE_PRESENTATION));
96 		aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_PAPER_START, PAPER_A0));
97 		aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_PAPER_END, PAPER_E));
98 		rPage.PageCreated(aSet);
99 		break;
100 	case RID_SVXPAGE_AREA:
101 			aSet.Put (SvxColorTableItem(maColorTab,SID_COLOR_TABLE));
102 			aSet.Put (SvxGradientListItem(maGradientList,SID_GRADIENT_LIST));
103 			aSet.Put (SvxHatchListItem(maHatchingList,SID_HATCH_LIST));
104 			aSet.Put (SvxBitmapListItem(maBitmapList,SID_BITMAP_LIST));
105 			aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
106 			aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
107 			aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,0));
108 			rPage.PageCreated(aSet);
109 		break;
110 	}
111 }
112 
113 
114 
115