xref: /aoo41x/main/sd/source/ui/dlg/dlgpage.cxx (revision 5b190011)
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 
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 	mpColorTab = aColorTableItem.GetColorTable();
69 	mpGradientList = aGradientListItem.GetGradientList();
70 	mpHatchingList = aHatchListItem.GetHatchList();
71 	mpBitmapList = 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 
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(mpColorTab,SID_COLOR_TABLE));
102 			aSet.Put (SvxGradientListItem(mpGradientList,SID_GRADIENT_LIST));
103 			aSet.Put (SvxHatchListItem(mpHatchingList,SID_HATCH_LIST));
104 			aSet.Put (SvxBitmapListItem(mpBitmapList,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