12ee96f1cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
32ee96f1cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
42ee96f1cSAndrew Rist * or more contributor license agreements. See the NOTICE file
52ee96f1cSAndrew Rist * distributed with this work for additional information
62ee96f1cSAndrew Rist * regarding copyright ownership. The ASF licenses this file
72ee96f1cSAndrew Rist * to you under the Apache License, Version 2.0 (the
82ee96f1cSAndrew Rist * "License"); you may not use this file except in compliance
92ee96f1cSAndrew Rist * with the License. You may obtain a copy of the License at
102ee96f1cSAndrew Rist *
112ee96f1cSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
122ee96f1cSAndrew Rist *
132ee96f1cSAndrew Rist * Unless required by applicable law or agreed to in writing,
142ee96f1cSAndrew Rist * software distributed under the License is distributed on an
152ee96f1cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
162ee96f1cSAndrew Rist * KIND, either express or implied. See the License for the
172ee96f1cSAndrew Rist * specific language governing permissions and limitations
182ee96f1cSAndrew Rist * under the License.
192ee96f1cSAndrew Rist *
202ee96f1cSAndrew Rist *************************************************************/
212ee96f1cSAndrew Rist
222ee96f1cSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_cui.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir // include ---------------------------------------------------------------
28cdf0e10cSrcweir #include <tools/shl.hxx>
29cdf0e10cSrcweir #include <svx/dialogs.hrc>
30cdf0e10cSrcweir #include <cuires.hrc>
31cdf0e10cSrcweir #include "page.hrc"
32cdf0e10cSrcweir
33cdf0e10cSrcweir #include "bbdlg.hxx"
34cdf0e10cSrcweir #include "border.hxx"
35cdf0e10cSrcweir #include "backgrnd.hxx"
36cdf0e10cSrcweir #include <dialmgr.hxx>
37cdf0e10cSrcweir
38*56b35d86SArmin Le Grand //UUUU
39*56b35d86SArmin Le Grand #include "cuitabarea.hxx"
40cdf0e10cSrcweir
41*56b35d86SArmin Le Grand // class SvxBorderBackgroundDlg ------------------------------------------
42cdf0e10cSrcweir
SvxBorderBackgroundDlg(Window * pParent,const SfxItemSet & rCoreSet,bool bEnableSelector,bool bEnableDrawingLayerFillStyles)43*56b35d86SArmin Le Grand SvxBorderBackgroundDlg::SvxBorderBackgroundDlg(Window *pParent,
44*56b35d86SArmin Le Grand const SfxItemSet& rCoreSet,
45*56b35d86SArmin Le Grand bool bEnableSelector,
46*56b35d86SArmin Le Grand bool bEnableDrawingLayerFillStyles)
47*56b35d86SArmin Le Grand : SfxTabDialog(
48*56b35d86SArmin Le Grand pParent,
49*56b35d86SArmin Le Grand CUI_RES(
50*56b35d86SArmin Le Grand bEnableDrawingLayerFillStyles ? RID_SVXDLG_BBDLG_AREA_TRANS : RID_SVXDLG_BBDLG_BACKGROUND),
51*56b35d86SArmin Le Grand &rCoreSet),
52*56b35d86SArmin Le Grand mbEnableBackgroundSelector(bEnableSelector),
53*56b35d86SArmin Le Grand mbEnableDrawingLayerFillStyles(bEnableDrawingLayerFillStyles)
54cdf0e10cSrcweir {
55*56b35d86SArmin Le Grand FreeResource();
56*56b35d86SArmin Le Grand AddTabPage(RID_SVXPAGE_BORDER,SvxBorderTabPage::Create,0);
57*56b35d86SArmin Le Grand
58*56b35d86SArmin Le Grand if(mbEnableDrawingLayerFillStyles)
59*56b35d86SArmin Le Grand {
60*56b35d86SArmin Le Grand //UUUU Here we want full DrawingLayer FillStyle access, so add Area and Transparency TabPages
61*56b35d86SArmin Le Grand AddTabPage( RID_SVXPAGE_AREA, SvxAreaTabPage::Create, 0 );
62*56b35d86SArmin Le Grand AddTabPage( RID_SVXPAGE_TRANSPARENCE, SvxTransparenceTabPage::Create, 0);
63*56b35d86SArmin Le Grand }
64*56b35d86SArmin Le Grand else
65*56b35d86SArmin Le Grand {
66*56b35d86SArmin Le Grand //UUUU Use the more simple Background TabPage
67*56b35d86SArmin Le Grand AddTabPage(RID_SVXPAGE_BACKGROUND, SvxBackgroundTabPage::Create, 0);
68*56b35d86SArmin Le Grand }
69cdf0e10cSrcweir }
70cdf0e10cSrcweir
71cdf0e10cSrcweir // -----------------------------------------------------------------------
72cdf0e10cSrcweir
~SvxBorderBackgroundDlg()73cdf0e10cSrcweir SvxBorderBackgroundDlg::~SvxBorderBackgroundDlg()
74cdf0e10cSrcweir {
75cdf0e10cSrcweir }
76cdf0e10cSrcweir
77cdf0e10cSrcweir // -----------------------------------------------------------------------
78cdf0e10cSrcweir
PageCreated(sal_uInt16 nPageId,SfxTabPage & rTabPage)79*56b35d86SArmin Le Grand void SvxBorderBackgroundDlg::PageCreated(sal_uInt16 nPageId, SfxTabPage& rTabPage)
80cdf0e10cSrcweir {
81*56b35d86SArmin Le Grand switch(nPageId)
82*56b35d86SArmin Le Grand {
83*56b35d86SArmin Le Grand case RID_SVXPAGE_BACKGROUND:
84*56b35d86SArmin Le Grand {
85*56b35d86SArmin Le Grand // allow switching between Color/graphic
86*56b35d86SArmin Le Grand if(mbEnableBackgroundSelector)
87*56b35d86SArmin Le Grand {
88*56b35d86SArmin Le Grand static_cast< SvxBackgroundTabPage& >(rTabPage).ShowSelector();
89*56b35d86SArmin Le Grand }
90*56b35d86SArmin Le Grand break;
91*56b35d86SArmin Le Grand }
92cdf0e10cSrcweir
93*56b35d86SArmin Le Grand //UUUU inits for Area and Transparency TabPages
94*56b35d86SArmin Le Grand // The selection attribute lists (XPropertyList derivates, e.g. XColorList for
95*56b35d86SArmin Le Grand // the color table) need to be added as items (e.g. SvxColorTableItem) to make
96*56b35d86SArmin Le Grand // these pages find the needed attributes for fill style suggestions.
97*56b35d86SArmin Le Grand // These are added in SwDocStyleSheet::GetItemSet() for the SFX_STYLE_FAMILY_PARA on
98*56b35d86SArmin Le Grand // demand, but could also be directly added from the DrawModel.
99*56b35d86SArmin Le Grand case RID_SVXPAGE_AREA:
100*56b35d86SArmin Le Grand {
101*56b35d86SArmin Le Grand SfxItemSet aNew(
102*56b35d86SArmin Le Grand *GetInputSetImpl()->GetPool(),
103*56b35d86SArmin Le Grand SID_COLOR_TABLE, SID_BITMAP_LIST,
104*56b35d86SArmin Le Grand SID_OFFER_IMPORT, SID_OFFER_IMPORT,
105*56b35d86SArmin Le Grand 0, 0);
106cdf0e10cSrcweir
107*56b35d86SArmin Le Grand aNew.Put(*GetInputSetImpl());
108*56b35d86SArmin Le Grand
109*56b35d86SArmin Le Grand // add flag for direct graphic content selection
110*56b35d86SArmin Le Grand aNew.Put(SfxBoolItem(SID_OFFER_IMPORT, true));
111*56b35d86SArmin Le Grand
112*56b35d86SArmin Le Grand rTabPage.PageCreated(aNew);
113*56b35d86SArmin Le Grand break;
114*56b35d86SArmin Le Grand }
115*56b35d86SArmin Le Grand case RID_SVXPAGE_TRANSPARENCE:
116*56b35d86SArmin Le Grand {
117*56b35d86SArmin Le Grand rTabPage.PageCreated(*GetInputSetImpl());
118*56b35d86SArmin Le Grand break;
119*56b35d86SArmin Le Grand }
120*56b35d86SArmin Le Grand }
121*56b35d86SArmin Le Grand }
122cdf0e10cSrcweir
123*56b35d86SArmin Le Grand //eof
124