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 .
22 #include <backgrnd.hxx>
23 #include <svx/svxids.hrc>
24 #include <svl/intitem.hxx>
25 #include <cuitabarea.hxx>
27 SvxBorderBackgroundDlg::SvxBorderBackgroundDlg(weld::Window
*pParent
,
28 const SfxItemSet
& rCoreSet
,
30 bool bEnableDrawingLayerFillStyles
)
31 : SfxTabDialogController(pParent
,
32 bEnableDrawingLayerFillStyles
33 ? OUString("cui/ui/borderareatransparencydialog.ui")
34 : OUString("cui/ui/borderbackgrounddialog.ui"),
35 bEnableDrawingLayerFillStyles
36 ? OString("BorderAreaTransparencyDialog")
37 : OString("BorderBackgroundDialog"),
39 , mbEnableBackgroundSelector(bEnableSelector
)
41 AddTabPage("borders", SvxBorderTabPage::Create
, nullptr );
42 if (bEnableDrawingLayerFillStyles
)
44 // Here we want full DrawingLayer FillStyle access, so add Area and Transparency TabPages
45 AddTabPage("area", SvxAreaTabPage::Create
, nullptr);
46 AddTabPage("transparence", SvxTransparenceTabPage::Create
, nullptr);
50 AddTabPage("background", SvxBkgTabPage::Create
, nullptr );
54 void SvxBorderBackgroundDlg::PageCreated(const OString
& rPageId
, SfxTabPage
& rTabPage
)
56 if (rPageId
== "background")
58 SfxAllItemSet
aSet(*(GetInputSetImpl()->GetPool()));
59 // allow switching between Color/graphic
60 if (mbEnableBackgroundSelector
)
61 aSet
.Put(SfxUInt32Item(SID_FLAG_TYPE
, static_cast<sal_uInt32
>(SvxBackgroundTabFlags::SHOW_SELECTOR
)));
62 rTabPage
.PageCreated(aSet
);
64 // inits for Area and Transparency TabPages
65 // The selection attribute lists (XPropertyList derivates, e.g. XColorList for
66 // the color table) need to be added as items (e.g. SvxColorTableItem) to make
67 // these pages find the needed attributes for fill style suggestions.
68 // These are added in SwDocStyleSheet::GetItemSet() for the SfxStyleFamily::Para on
69 // demand, but could also be directly added from the DrawModel.
70 else if (rPageId
== "area")
73 *GetInputSetImpl()->GetPool(),
74 svl::Items
<SID_COLOR_TABLE
, SID_PATTERN_LIST
,
75 SID_OFFER_IMPORT
, SID_OFFER_IMPORT
>{});
77 aNew
.Put(*GetInputSetImpl());
79 // add flag for direct graphic content selection
80 aNew
.Put(SfxBoolItem(SID_OFFER_IMPORT
, true));
82 rTabPage
.PageCreated(aNew
);
84 else if (rPageId
== "transparence")
86 rTabPage
.PageCreated(*GetInputSetImpl());
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */