LibreOffice Module cui (master) 1
sdrcelldlg.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 <sdrcelldlg.hxx>
21#include <cuitabarea.hxx>
22#include <svx/svdmodel.hxx>
23#include <border.hxx>
24#include <paragrph.hxx>
25#include <svl/intitem.hxx>
26#include <svl/cjkoptions.hxx>
27#include <svx/flagsdef.hxx>
28#include <svx/svxids.hrc>
29#include <svx/dialogs.hrc>
30
31SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet& rAttr, const SdrModel& rModel, bool bStyle)
32 : SfxTabDialogController(pParent, "cui/ui/formatcellsdialog.ui", "FormatCellsDialog", &rAttr, bStyle)
33 , mrOutAttrs(rAttr)
34 , mpColorTab(rModel.GetColorList())
35 , mnColorTabState ( ChangeType::NONE )
36 , mpGradientList(rModel.GetGradientList())
37 , mpHatchingList(rModel.GetHatchList())
38 , mpBitmapList(rModel.GetBitmapList())
39 , mpPatternList(rModel.GetPatternList())
40{
41 AddTabPage("name", RID_SVXPAGE_CHAR_NAME);
42 AddTabPage("effects", RID_SVXPAGE_CHAR_EFFECTS);
43 AddTabPage("border", RID_SVXPAGE_BORDER );
44 AddTabPage("area", RID_SVXPAGE_AREA);
45
46 if (bStyle)
47 {
48 AddTabPage("position", RID_SVXPAGE_CHAR_POSITION);
49 AddTabPage("highlight", RID_SVXPAGE_BKG);
50 AddTabPage("indentspacing", RID_SVXPAGE_STD_PARAGRAPH);
52 RemoveTabPage("shadow");
53 }
54 else
55 {
56 RemoveTabPage("position");
57 RemoveTabPage("highlight");
58 RemoveTabPage("indentspacing");
59 RemoveTabPage("alignment");
60 AddTabPage("shadow", SvxShadowTabPage::Create, nullptr);
62 }
63
65 AddTabPage("asian", RID_SVXPAGE_PARA_ASIAN);
66 else
67 RemoveTabPage("asian");
68}
69
70void SvxFormatCellsDialog::PageCreated(const OUString& rId, SfxTabPage &rPage)
71{
72 if (rId == "area")
73 {
74 SvxAreaTabPage& rAreaPage = static_cast<SvxAreaTabPage&>(rPage);
75 rAreaPage.SetColorList( mpColorTab );
78 rAreaPage.SetBitmapList( mpBitmapList );
79 rAreaPage.SetPatternList( mpPatternList );
80 rAreaPage.ActivatePage( mrOutAttrs );
81 }
82 else if (rId == "border")
83 {
84 SvxBorderTabPage& rBorderPage = static_cast<SvxBorderTabPage&>(rPage);
85 rBorderPage.SetTableMode();
86 }
87 else if (rId == "shadow")
88 {
89 static_cast<SvxShadowTabPage&>(rPage).SetColorList( mpColorTab );
90 static_cast<SvxShadowTabPage&>(rPage).SetColorChgd( &mnColorTabState );
91 }
92 else if (rId == "alignment")
93 {
94 static_cast<SvxParaAlignTabPage&>(rPage).EnableSdrVertAlign();
95 }
96 else if (rId == "highlight")
97 {
98 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
99 aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR)));
100 rPage.PageCreated(aSet);
101 }
102 else
104}
105
106/* 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)
void RemoveTabPage(const OUString &rName)
virtual void PageCreated(const OUString &rName, SfxTabPage &rPage)
SfxItemSet * GetInputSetImpl()
virtual void PageCreated(const SfxAllItemSet &aSet)
void SetPatternList(XPatternListRef const &pPtrnLst)
Definition: cuitabarea.hxx:292
void SetHatchingList(XHatchListRef const &pHtchLst)
Definition: cuitabarea.hxx:289
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tparea.cxx:167
void SetBitmapList(XBitmapListRef const &pBmpLst)
Definition: cuitabarea.hxx:291
void SetColorList(XColorListRef const &pColorList)
Definition: cuitabarea.hxx:286
void SetGradientList(XGradientListRef const &pGrdLst)
Definition: cuitabarea.hxx:287
void SetTableMode()
Definition: border.cxx:1699
ChangeType mnColorTabState
Definition: sdrcelldlg.hxx:34
XPatternListRef mpPatternList
Definition: sdrcelldlg.hxx:38
XColorListRef mpColorTab
Definition: sdrcelldlg.hxx:33
const SfxItemSet & mrOutAttrs
Definition: sdrcelldlg.hxx:31
XHatchListRef mpHatchingList
Definition: sdrcelldlg.hxx:36
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
Definition: sdrcelldlg.cxx:70
XBitmapListRef mpBitmapList
Definition: sdrcelldlg.hxx:37
XGradientListRef mpGradientList
Definition: sdrcelldlg.hxx:35
SvxFormatCellsDialog(weld::Window *pParent, const SfxItemSet &rAttr, const SdrModel &rModel, bool bStyle)
Definition: sdrcelldlg.cxx:31
static WhichRangesContainer GetSdrRanges()
Definition: paragrph.hxx:171
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: paragrph.cxx:1279
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: tpshadow.cxx:435
bool IsAsianTypographyEnabled()
NONE
ChangeType