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 : #include <svl/intitem.hxx>
21 : #include <svx/dialogs.hrc>
22 : #include <svx/drawitem.hxx>
23 :
24 : #include "sdresid.hxx"
25 : #include "dlgpage.hxx"
26 :
27 : #include "DrawDocShell.hxx"
28 : #include <svl/aeitem.hxx>
29 : #include <svx/flagsdef.hxx>
30 : #include <editeng/svxenum.hxx>
31 :
32 : /**
33 : * Constructor of tab dialog: appends pages to the dialog
34 : */
35 0 : SdPageDlg::SdPageDlg( SfxObjectShell* pDocSh, Window* pParent, const SfxItemSet* pAttr, sal_Bool bAreaPage ) :
36 : SfxTabDialog ( pParent, SdResId( TAB_PAGE ), pAttr ),
37 0 : mpDocShell ( pDocSh )
38 : {
39 : SvxColorListItem aColorListItem(*( (const SvxColorListItem*)
40 0 : ( mpDocShell->GetItem( SID_COLOR_TABLE ) ) ) );
41 : SvxGradientListItem aGradientListItem(*( (const SvxGradientListItem*)
42 0 : ( mpDocShell->GetItem( SID_GRADIENT_LIST ) ) ) );
43 : SvxBitmapListItem aBitmapListItem(*( (const SvxBitmapListItem*)
44 0 : ( mpDocShell->GetItem( SID_BITMAP_LIST ) ) ) );
45 : SvxHatchListItem aHatchListItem(*( (const SvxHatchListItem*)
46 0 : ( mpDocShell->GetItem( SID_HATCH_LIST ) ) ) );
47 :
48 0 : mpColorList = aColorListItem.GetColorList();
49 0 : mpGradientList = aGradientListItem.GetGradientList();
50 0 : mpHatchingList = aHatchListItem.GetHatchList();
51 0 : mpBitmapList = aBitmapListItem.GetBitmapList();
52 :
53 0 : FreeResource();
54 :
55 0 : AddTabPage( RID_SVXPAGE_PAGE);
56 0 : AddTabPage( RID_SVXPAGE_AREA);
57 :
58 0 : if(!bAreaPage) // I have to add the page before I remove it !
59 0 : RemoveTabPage( RID_SVXPAGE_AREA );
60 0 : }
61 :
62 :
63 0 : void SdPageDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
64 : {
65 0 : SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
66 0 : switch(nId)
67 : {
68 : case RID_SVXPAGE_PAGE:
69 0 : aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_ENUM_PAGE_MODE, SVX_PAGE_MODE_PRESENTATION));
70 0 : aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_PAPER_START, PAPER_A0));
71 0 : aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_PAPER_END, PAPER_E));
72 0 : rPage.PageCreated(aSet);
73 0 : break;
74 : case RID_SVXPAGE_AREA:
75 0 : aSet.Put (SvxColorListItem(mpColorList,SID_COLOR_TABLE));
76 0 : aSet.Put (SvxGradientListItem(mpGradientList,SID_GRADIENT_LIST));
77 0 : aSet.Put (SvxHatchListItem(mpHatchingList,SID_HATCH_LIST));
78 0 : aSet.Put (SvxBitmapListItem(mpBitmapList,SID_BITMAP_LIST));
79 0 : aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
80 0 : aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
81 0 : aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,0));
82 0 : rPage.PageCreated(aSet);
83 0 : break;
84 0 : }
85 0 : }
86 :
87 :
88 :
89 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|