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 
43 void SvxFormatCellsDialog::PageCreated(const OString& rId, SfxTabPage &rPage)
44 {
45  if (rId == "area")
46  {
47  SvxAreaTabPage& rAreaPage = static_cast<SvxAreaTabPage&>(rPage);
48  rAreaPage.SetColorList( mpColorTab );
49  rAreaPage.SetGradientList( mpGradientList );
50  rAreaPage.SetHatchingList( mpHatchingList );
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: */
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: tpshadow.cxx:440
XColorListRef mpColorTab
Definition: sdrcelldlg.hxx:33
void SetGradientList(XGradientListRef const &pGrdLst)
Definition: cuitabarea.hxx:275
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tparea.cxx:158
void SetColorList(XColorListRef const &pColorList)
Definition: cuitabarea.hxx:274
NONE
XHatchListRef mpHatchingList
Definition: sdrcelldlg.hxx:36
virtual void PageCreated(const OString &rName, SfxTabPage &rPage)
void SetPatternList(XPatternListRef const &pPtrnLst)
Definition: cuitabarea.hxx:280
ChangeType
void SetHatchingList(XHatchListRef const &pHtchLst)
Definition: cuitabarea.hxx:277
ChangeType mnColorTabState
Definition: sdrcelldlg.hxx:34
void SetTableMode()
Definition: border.cxx:1601
const SfxItemSet & mrOutAttrs
Definition: sdrcelldlg.hxx:31
XBitmapListRef mpBitmapList
Definition: sdrcelldlg.hxx:37
SvxFormatCellsDialog(weld::Window *pParent, const SfxItemSet *pAttr, const SdrModel &rModel)
Definition: sdrcelldlg.cxx:26
void AddTabPage(const OString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
XPatternListRef mpPatternList
Definition: sdrcelldlg.hxx:38
void SetBitmapList(XBitmapListRef const &pBmpLst)
Definition: cuitabarea.hxx:279
virtual void PageCreated(const OString &rId, SfxTabPage &rPage) override
Definition: sdrcelldlg.cxx:43
XGradientListRef mpGradientList
Definition: sdrcelldlg.hxx:35