LibreOffice Module sd (master) 1
dlgchar.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 <svx/dialogs.hrc>
21#include <editeng/flstitem.hxx>
22#include <svx/flagsdef.hxx>
23#include <sfx2/objsh.hxx>
24#include <sfx2/sfxdlg.hxx>
25
26#include <dlg_char.hxx>
27#include <svx/svxids.hrc>
28#include <svl/intitem.hxx>
29
34 const SfxObjectShell* pDocShell)
35 : SfxTabDialogController(pParent, "modules/sdraw/ui/drawchardialog.ui",
36 "DrawCharDialog", pAttr)
37 , rDocShell(*pDocShell)
38{
40
41 AddTabPage("RID_SVXPAGE_CHAR_NAME", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_CHAR_NAME), nullptr);
42 AddTabPage("RID_SVXPAGE_CHAR_EFFECTS", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_CHAR_EFFECTS), nullptr);
43 AddTabPage("RID_SVXPAGE_CHAR_POSITION", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_CHAR_POSITION), nullptr);
44 AddTabPage("RID_SVXPAGE_BKG", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_BKG), nullptr);
45}
46
47void SdCharDlg::PageCreated(const OUString& rId, SfxTabPage &rPage)
48{
49 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
50 if (rId == "RID_SVXPAGE_CHAR_NAME")
51 {
52 SvxFontListItem aItem(* static_cast<const SvxFontListItem*>( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) );
53
54 aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
55 rPage.PageCreated(aSet);
56 }
57 else if (rId == "RID_SVXPAGE_CHAR_EFFECTS")
58 {
59 // Opt in for character transparency.
61 rPage.PageCreated(aSet);
62 }
63 else if (rId == "RID_SVXPAGE_BKG")
64 {
65 aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR)));
66 rPage.PageCreated(aSet);
67 }
68}
69
70/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
Definition: dlgchar.cxx:47
const SfxObjectShell & rDocShell
Definition: dlg_char.hxx:33
SdCharDlg(weld::Window *pParent, const SfxItemSet *pAttr, const SfxObjectShell *pDocShell)
Constructor of tab dialog: append pages to dialog.
Definition: dlgchar.cxx:33
static SfxAbstractDialogFactory * Create()
virtual CreateTabPage GetTabPageCreatorFunc(sal_uInt16 nId)=0
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
void AddTabPage(const OUString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
SfxItemSet * GetInputSetImpl()
virtual void PageCreated(const SfxAllItemSet &aSet)
const FontList * GetFontList() const
#define SVX_ENABLE_CHAR_TRANSPARENCY