1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <svl/intitem.hxx>
21 #include <svx/dialogs.hrc>
22 #include <svx/drawitem.hxx>
24 #include "sdresid.hxx"
25 #include "dlgpage.hxx"
27 #include "DrawDocShell.hxx"
28 #include <svl/aeitem.hxx>
29 #include <svx/flagsdef.hxx>
30 #include <editeng/svxenum.hxx>
33 * Constructor of tab dialog: appends pages to the dialog
35 SdPageDlg::SdPageDlg( SfxObjectShell
* pDocSh
, Window
* pParent
, const SfxItemSet
* pAttr
, sal_Bool bAreaPage
) :
36 SfxTabDialog ( pParent
, SdResId( TAB_PAGE
), pAttr
),
39 SvxColorListItem
aColorListItem(*( (const SvxColorListItem
*)
40 ( mpDocShell
->GetItem( SID_COLOR_TABLE
) ) ) );
41 SvxGradientListItem
aGradientListItem(*( (const SvxGradientListItem
*)
42 ( mpDocShell
->GetItem( SID_GRADIENT_LIST
) ) ) );
43 SvxBitmapListItem
aBitmapListItem(*( (const SvxBitmapListItem
*)
44 ( mpDocShell
->GetItem( SID_BITMAP_LIST
) ) ) );
45 SvxHatchListItem
aHatchListItem(*( (const SvxHatchListItem
*)
46 ( mpDocShell
->GetItem( SID_HATCH_LIST
) ) ) );
48 mpColorList
= aColorListItem
.GetColorList();
49 mpGradientList
= aGradientListItem
.GetGradientList();
50 mpHatchingList
= aHatchListItem
.GetHatchList();
51 mpBitmapList
= aBitmapListItem
.GetBitmapList();
55 AddTabPage( RID_SVXPAGE_PAGE
);
56 AddTabPage( RID_SVXPAGE_AREA
);
58 if(!bAreaPage
) // I have to add the page before I remove it !
59 RemoveTabPage( RID_SVXPAGE_AREA
);
63 void SdPageDlg::PageCreated(sal_uInt16 nId
, SfxTabPage
& rPage
)
65 SfxAllItemSet
aSet(*(GetInputSetImpl()->GetPool()));
68 case RID_SVXPAGE_PAGE
:
69 aSet
.Put (SfxAllEnumItem((const sal_uInt16
)SID_ENUM_PAGE_MODE
, SVX_PAGE_MODE_PRESENTATION
));
70 aSet
.Put (SfxAllEnumItem((const sal_uInt16
)SID_PAPER_START
, PAPER_A0
));
71 aSet
.Put (SfxAllEnumItem((const sal_uInt16
)SID_PAPER_END
, PAPER_E
));
72 rPage
.PageCreated(aSet
);
74 case RID_SVXPAGE_AREA
:
75 aSet
.Put (SvxColorListItem(mpColorList
,SID_COLOR_TABLE
));
76 aSet
.Put (SvxGradientListItem(mpGradientList
,SID_GRADIENT_LIST
));
77 aSet
.Put (SvxHatchListItem(mpHatchingList
,SID_HATCH_LIST
));
78 aSet
.Put (SvxBitmapListItem(mpBitmapList
,SID_BITMAP_LIST
));
79 aSet
.Put (SfxUInt16Item(SID_PAGE_TYPE
,0));
80 aSet
.Put (SfxUInt16Item(SID_DLG_TYPE
,1));
81 aSet
.Put (SfxUInt16Item(SID_TABPAGE_POS
,0));
82 rPage
.PageCreated(aSet
);
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */