Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 :
21 : #ifdef SD_DLLIMPLEMENTATION
22 : #undef SD_DLLIMPLEMENTATION
23 : #endif
24 :
25 : #include <svl/intitem.hxx>
26 : #include <svx/dialogs.hrc>
27 : #include <svx/drawitem.hxx>
28 :
29 : #include "sdresid.hxx"
30 : #include "dlgpage.hxx"
31 :
32 : #include "DrawDocShell.hxx"
33 : #include <svl/aeitem.hxx>
34 : #include <svx/flagsdef.hxx>
35 : #include <editeng/svxenum.hxx>
36 :
37 : /*************************************************************************
38 : |*
39 : |* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu
40 : |*
41 : \************************************************************************/
42 :
43 0 : SdPageDlg::SdPageDlg( SfxObjectShell* pDocSh, Window* pParent, const SfxItemSet* pAttr, sal_Bool bAreaPage ) :
44 : SfxTabDialog ( pParent, SdResId( TAB_PAGE ), pAttr ),
45 0 : mpDocShell ( pDocSh )
46 : {
47 : SvxColorListItem aColorListItem(*( (const SvxColorListItem*)
48 0 : ( mpDocShell->GetItem( SID_COLOR_TABLE ) ) ) );
49 : SvxGradientListItem aGradientListItem(*( (const SvxGradientListItem*)
50 0 : ( mpDocShell->GetItem( SID_GRADIENT_LIST ) ) ) );
51 : SvxBitmapListItem aBitmapListItem(*( (const SvxBitmapListItem*)
52 0 : ( mpDocShell->GetItem( SID_BITMAP_LIST ) ) ) );
53 : SvxHatchListItem aHatchListItem(*( (const SvxHatchListItem*)
54 0 : ( mpDocShell->GetItem( SID_HATCH_LIST ) ) ) );
55 :
56 0 : mpColorList = aColorListItem.GetColorList();
57 0 : mpGradientList = aGradientListItem.GetGradientList();
58 0 : mpHatchingList = aHatchListItem.GetHatchList();
59 0 : mpBitmapList = aBitmapListItem.GetBitmapList();
60 :
61 0 : FreeResource();
62 :
63 0 : AddTabPage( RID_SVXPAGE_PAGE);
64 0 : AddTabPage( RID_SVXPAGE_AREA);
65 :
66 0 : if(!bAreaPage) // I have to add the page before I remove it !
67 0 : RemoveTabPage( RID_SVXPAGE_AREA );
68 0 : }
69 :
70 :
71 : /*************************************************************************
72 : |*
73 : |* Seite wird erzeugt
74 : |*
75 : \************************************************************************/
76 :
77 0 : void SdPageDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
78 : {
79 0 : SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
80 0 : switch(nId)
81 : {
82 : case RID_SVXPAGE_PAGE:
83 0 : aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_ENUM_PAGE_MODE, SVX_PAGE_MODE_PRESENTATION));
84 0 : aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_PAPER_START, PAPER_A0));
85 0 : aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_PAPER_END, PAPER_E));
86 0 : rPage.PageCreated(aSet);
87 0 : break;
88 : case RID_SVXPAGE_AREA:
89 0 : aSet.Put (SvxColorListItem(mpColorList,SID_COLOR_TABLE));
90 0 : aSet.Put (SvxGradientListItem(mpGradientList,SID_GRADIENT_LIST));
91 0 : aSet.Put (SvxHatchListItem(mpHatchingList,SID_HATCH_LIST));
92 0 : aSet.Put (SvxBitmapListItem(mpBitmapList,SID_BITMAP_LIST));
93 0 : aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
94 0 : aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
95 0 : aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,0));
96 0 : rPage.PageCreated(aSet);
97 0 : break;
98 0 : }
99 0 : }
100 :
101 :
102 :
103 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|