LibreOffice Module cui (master) 1
bbdlg.cxx
Go to the documentation of this file.
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 <bbdlg.hxx>
21#include <border.hxx>
22#include <backgrnd.hxx>
23#include <svx/svxids.hrc>
24#include <svl/intitem.hxx>
25#include <cuitabarea.hxx>
26
28 const SfxItemSet& rCoreSet,
29 bool bEnableSelector,
30 bool bEnableDrawingLayerFillStyles)
31 : SfxTabDialogController(pParent,
32 bEnableDrawingLayerFillStyles
33 ? OUString("cui/ui/borderareatransparencydialog.ui")
34 : OUString("cui/ui/borderbackgrounddialog.ui"),
35 bEnableDrawingLayerFillStyles
36 ? OUString("BorderAreaTransparencyDialog")
37 : OUString("BorderBackgroundDialog"),
38 &rCoreSet)
39 , mbEnableBackgroundSelector(bEnableSelector)
40{
41 AddTabPage("borders", SvxBorderTabPage::Create, nullptr );
42 if (bEnableDrawingLayerFillStyles)
43 {
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);
47 }
48 else
49 {
50 AddTabPage("background", SvxBkgTabPage::Create, nullptr );
51 }
52}
53
54void SvxBorderBackgroundDlg::PageCreated(const OUString& rPageId, SfxTabPage& rTabPage)
55{
56 if (rPageId == "background")
57 {
58 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
59 // allow switching between Color/graphic
61 aSet.Put(SfxUInt32Item(SID_FLAG_TYPE, static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_SELECTOR)));
62 rTabPage.PageCreated(aSet);
63 }
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")
71 {
72 SfxItemSetFixed<SID_COLOR_TABLE, SID_PATTERN_LIST,
73 SID_OFFER_IMPORT, SID_OFFER_IMPORT>
74 aNew(*GetInputSetImpl()->GetPool());
75
76 aNew.Put(*GetInputSetImpl());
77
78 // add flag for direct graphic content selection
79 aNew.Put(SfxBoolItem(SID_OFFER_IMPORT, true));
80
81 rTabPage.PageCreated(aNew);
82 }
83 else if (rPageId == "transparence")
84 {
85 rTabPage.PageCreated(*GetInputSetImpl());
86 }
87}
88
89/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void AddTabPage(const OUString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
SfxItemSet * GetInputSetImpl()
virtual void PageCreated(const SfxAllItemSet &aSet)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: tparea.cxx:368
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: backgrnd.cxx:227
virtual void PageCreated(const OUString &rPageId, SfxTabPage &rTabPage) override
Definition: bbdlg.cxx:54
SvxBorderBackgroundDlg(weld::Window *pParent, const SfxItemSet &rCoreSet, bool bEnableSelector, bool bEnableDrawingLayerFillStyles)
Definition: bbdlg.cxx:27
bool mbEnableBackgroundSelector
for Border/Background
Definition: bbdlg.hxx:38
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
Definition: border.cxx:608
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: tptrans.cxx:239