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 <svx/dialogs.hrc>
25
27 : SfxTabDialogController(pParent, "cui/ui/formatcellsdialog.ui", "FormatCellsDialog", pAttr)
28 , mrOutAttrs(*pAttr)
29 , mpColorTab(rModel.GetColorList())
30 , mnColorTabState ( ChangeType::NONE )
31 , mpGradientList(rModel.GetGradientList())
32 , mpHatchingList(rModel.GetHatchList())
33 , mpBitmapList(rModel.GetBitmapList())
34 , mpPatternList(rModel.GetPatternList())
35{
36 AddTabPage("name", RID_SVXPAGE_CHAR_NAME);
37 AddTabPage("effects", RID_SVXPAGE_CHAR_EFFECTS);
38 AddTabPage("border", RID_SVXPAGE_BORDER );
39 AddTabPage("area", RID_SVXPAGE_AREA);
40 AddTabPage("shadow", SvxShadowTabPage::Create, nullptr);
41}
42
43void SvxFormatCellsDialog::PageCreated(const OString& rId, SfxTabPage &rPage)
44{
45 if (rId == "area")
46 {
47 SvxAreaTabPage& rAreaPage = static_cast<SvxAreaTabPage&>(rPage);
48 rAreaPage.SetColorList( mpColorTab );
51 rAreaPage.SetBitmapList( mpBitmapList );
52 rAreaPage.SetPatternList( mpPatternList );
53 rAreaPage.ActivatePage( mrOutAttrs );
54 }
55 else if (rId == "border")
56 {
57 SvxBorderTabPage& rBorderPage = static_cast<SvxBorderTabPage&>(rPage);
58 rBorderPage.SetTableMode();
59 }
60 else if (rId == "shadow")
61 {
62 static_cast<SvxShadowTabPage&>(rPage).SetColorList( mpColorTab );
63 static_cast<SvxShadowTabPage&>(rPage).SetColorChgd( &mnColorTabState );
64 }
65 else
67}
68
69/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void AddTabPage(const OString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
virtual void PageCreated(const OString &rName, SfxTabPage &rPage)
void SetPatternList(XPatternListRef const &pPtrnLst)
Definition: cuitabarea.hxx:286
void SetHatchingList(XHatchListRef const &pHtchLst)
Definition: cuitabarea.hxx:283
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tparea.cxx:166
void SetBitmapList(XBitmapListRef const &pBmpLst)
Definition: cuitabarea.hxx:285
void SetColorList(XColorListRef const &pColorList)
Definition: cuitabarea.hxx:280
void SetGradientList(XGradientListRef const &pGrdLst)
Definition: cuitabarea.hxx:281
void SetTableMode()
Definition: border.cxx:1700
ChangeType mnColorTabState
Definition: sdrcelldlg.hxx:34
XPatternListRef mpPatternList
Definition: sdrcelldlg.hxx:38
XColorListRef mpColorTab
Definition: sdrcelldlg.hxx:33
SvxFormatCellsDialog(weld::Window *pParent, const SfxItemSet *pAttr, const SdrModel &rModel)
Definition: sdrcelldlg.cxx:26
const SfxItemSet & mrOutAttrs
Definition: sdrcelldlg.hxx:31
XHatchListRef mpHatchingList
Definition: sdrcelldlg.hxx:36
virtual void PageCreated(const OString &rId, SfxTabPage &rPage) override
Definition: sdrcelldlg.cxx:43
XBitmapListRef mpBitmapList
Definition: sdrcelldlg.hxx:37
XGradientListRef mpGradientList
Definition: sdrcelldlg.hxx:35
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: tpshadow.cxx:435
NONE
ChangeType